01-12-2025 07:42 AM
I have severral arduino leonardos in for a midi in and output application.
The usb connections are remeberd when i shut off the system.
How can i define a good connection?
Thanks in advance.
greetings Paul
Solved! Go to Solution.
01-15-2025 05:02 AM - edited 01-15-2025 05:03 AM
@moving_machines wrote:
I have severral arduino leonardos in for a midi in and output application.
The usb connections are remeberd when i shut off the system.
How can i define a good connection?
Thanks in advance.
This makes not much sense. Did you forgot the word NOT in the sentence: The usb connections are NOT remembered when I shut off the system.
If so the problem is that your USB devices do not provide a unique serial number in their initial USB descriptor message. That is the only way Windows can identify identical hardware and distinguish it from another hardware of the same type. And if they do not provide such a unique serial number there is no simple way to magically force that into the system afterwards.
The only possible option is if there is anyhow some unique identifier that you can query on the device with its own commands. On startup enumerate all serial ports, go through each and query that unique identifier, build a table with serial port and identifier and store it somewhere, let the user assign somewhere in your app, which identifier belongs to which operation, functionality or resource and use the right identifier when trying to communicate to that resource.
On next startup repeat and compare the new enumerated hardware with the table you stored to disk. Reassign the various entries accordingly and prompt the user for configuration of new not earlier encountered hardware. All done! 😁
Or you buy a different and probably more expensive MIDI adapter which does have a unique serial number in its USB descriptor.
01-31-2025 05:44 AM
thanks for your answer
rolf
greetimgs paul