Hi.
I have a class-compliant usb device which announces its serial number as m4121095
, as per its kUSBSerialNumberString
property. However, the file name it is provided is tty.usbmodemm41210951
– it's the serial number with an additional 1
at the end. What is the meaning of this appendage?
(I'm tempted to believe that the 1
at the end is there in the unlikely case another device with the same SN is connected, but there's no way to test this possibility).
In the end, I would like to obtain a filename that is guaranteed to be representing a connection to exactly this device. Can I assume that the filename of a device that follows the same protocol of serial numbering will be consistently appended with a number that can in some way be inferred?
Thank you.
Thanks a lot for the response.
The main intention is indeed persistence across device reconnections, but I also expect to allow connections of multiple devices of the same make. Going through /dev
filenames without knowing their precise schema looks unreliable.
I see that I have to leave IOUSB
for this. I'm getting the paths alright, but now I have no access to its IOUSB
representation, meaning I can't access its vendor, SN, etc.. Is it possible to retrieve the properties of IOUSBHostDevice
that is served by a file and vice versa?
Could you expand on what you mean by this being a different question?