T3.6 USB Host MIDI - Theory of operation question

Status
Not open for further replies.

SteveBar

Well-known member
If I missed this info in another thread feel free to point to it, I’ve been browsing and reading for several hours today and haven’t come across these answers. But learned a ton of other stuff in the search! :)

I’m working on a MIDI router device that bridges several “5-pin DINs” (via serial UARTs) to the “USB device port” and the “USB host ports via 4 port hub”.

I’d like to know when a device is connected/disconnected to one of the USB host ports. Is there a callback function I can register with the USB host object to be notified? Or do I need to poll it through the available() function? Or???

I know about the product string and manufacture string functions, but The device really needs to keep a list of which physical port each device is plugged into. This info is needed so the user can select routings for MIDI messages by physical port numbers. Perhaps the hub number is also needed in case an additional hub is plugged in.

I noticed the device port/hub number in the debug dump, but can’t find an easy way to get this info via a function?

Any help would be awesome. And thanks to all who are working on the USB host! Especially Paul for keeping MIDI top of mind.
 
I’d like to know when a device is connected/disconnected to one of the USB host ports.

USBHost_t36 follows the Arduino convention where you can use the device name as a boolean, which tests as true if the USB device is connected, or false if not connected.
 
Hi Paul thanks for the reply.
Any chance of getting a function to read the port and hub numbers? Otherwise the user has no idea which physical device corresponds to which logical device# in the enumeration list:
MIDIDevice midi01(myusb);
MIDIDevice midi02(myusb);
MIDIDevice midi03(myusb);
...etc

All my tests show the sort order of this list is based on the device response time not physical USB port. See UI moc-up below.


Also I’m trying to find the “required reading” USB chapter you suggested, can you re-post the link here?
Thanks again
Steve

MRTR Black Top Mount v5.jpg
 
Last edited:
Status
Not open for further replies.
Back
Top