I've developed a custom USB comms device that has a unique VID:PID. When using lsusb I can of course see this VID:PID.
When connected, this device is controlled by my golang software tools. These tools use standard open/read/write calls with OS paths such as /dev/tty.usbmodem14421 (mac) or /dev/ttyS0 (linux) or COM13 (win).
But it's a horrendous task for a "normal" using any of these OS's to figure out what port was dynamically assigned when they plug it in. I'd very much like to make this easier.
I can see in google/gousb that I can enumerate devices to look for my VID:PID, or can even use OpenDeviceWithVidPid() to see if it's there.
And of course I can enumerate OS serial ports devices on each OS if necessary.
However, perhaps because of my lack of depth in USB features/terminology, I can't seem to find a way to answer the question "If OpenDeviceWithVidPid returns a (non-nil) device, how may I map this to its /dev/* or COM* serial port path?"
My utils need to run on all of Win, MacOS, and Linux, so if there's a platform-independent way of doing this it would be ideal.
Guidance appreciated; thanks very much.