xcode - Mapping between /dev/tty.usbmodemXXXX and Location ID -


i'm trying identify specific usb device on osx machine. device arduino device slighly modified driver , it's own pid , vid.

i can list device using bash command "system_profiler spusbdatatype":

powerbrain      :    product id: 0x4243   vendor id: 0x2bfd   version: 1.00   speed: 12 mb/sec   manufacturer: kinematics    location id: 0x14200000 / 27   current available (ma): 1000   current required (ma): 500   operating current (ma): 0 

i can list device using bash command "ioreg -p iousb -l -b":

powerbrain      @14200000  <class appleusbdevice, id 0x100000d1b, registered, matched, active, busy 0 (8 ms), retain 15>     {       "sessionid" = 34690005456990       "imanufacturer" = 1       "bnumconfigurations" = 1       "idproduct" = 16963       "bcddevice" = 256       "bus power available" = 500       "usb address" = 27       "bmaxpacketsize0" = 64       "iproduct" = 2       "iserialnumber" = 0       "bdeviceclass" = 2       "built-in" = no       "locationid" = 337641472       "bdevicesubclass" = 0       "bcdusb" = 512       "usb product name" = "powerbrain      "       "portnum" = 2       "non-removable" = "no"       "iocfplugintypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="iousbfamily.kext/contents/plugins/iousblib.bundle"}       "bdeviceprotocol" = 0       "iouserclientclass" = "iousbdeviceuserclientv2"       "iopowermanagement" = {"devicepowerstate"=0,"currentpowerstate"=3,"capabilityflags"=65536,"maxpowerstate"=4,"driverpowerstate"=3}       "device speed" = 1       "usb vendor name" = "kinematics "       "idvendor" = 11261       "iogeneralinterest" = "iocommand not serializable"       "ioclassnameoverride" = "iousbdevice"     } 

i can see port name "/dev/tty.usbmodem1421" , communicate it.

the problem - how location id "0x14200000 / 27" map "usbmodem1421"?

if there way archive using mono c# / xcode, please let me know.

i solved problem using iokit - there method iterate on modem services , find respective usb device of communications device.

the code can used monomac accessible @ github: https://github.com/lunatix89/monomac-iokit-usbdevice


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -