![]() You might find it helpful to use the IORegistryExplorer app to help visualise this, as the full ioreg output is slightly difficult to read! This is available in XCode's "Hardware IO Tools" package which you can find by searching the downloads on the Apple developer site. ![]() You could then parse this with a library such as plistlib. ![]() If you then want to do this programmatically, you could add the -a option to the ioreg command, which will output a plist version of the above output. This will contain the property IODialinDevice which is what you want. Once you've found it, you should be able to scan through its subtree, and eventually find an object of class IOSerialBSDClient. You should be able to find your device on the top level based on its ID or serial number. It will print all the USB host devices, and it will print out all properties from the subtree of each device. ![]() Try this command: ioreg -r -c IOUSBHostDevice -l Actually, you should be able to find the mapping from device ID/serial number to serial port name using ioreg. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |