Teensy 4.1 USB MIDI Host device information

jsissom

New member
Hello, I have connected the USB connector to the 5 pin header on the Teensy 4.1 and have code that receives MIDI messages from USB Devices. I would like to have my code know when a USB MIDI device is plugged in and removed and if possible, the vendor, device ID, manufacturer IDs or other identifying information.

I see that this information is available on the USBDriver but I'm not sure how to access that from the MIDIDevice object.

Is there a way to do this?

Thanks
Jay
 
All the USB host driver instances can be tested as a boolean to know when a device is connected, just like how "while (!Serial) ;" waits for the Arduino serial monitor.

There are also functions which query the vendor and product ID of the connected device.
 
Thanks for your quick reply. I saw those on a different class but didn't realize that the Midi class inherited them. I got it working using those methods.

Thanks again
Jay
 
Back
Top