(I changed the subject back to something more useful)

on my Mac at the moment
ioreg -w0 -l 

gives me this (amongst others)

    | 
    +-o AppleUSBFTDI  <class AppleUSBFTDI, id 0x10000fbf3, !registered,
!matched, active, busy 0 (0 ms), retain 6>
      | {
      |   "IOClass" = "AppleUSBFTDI"
      |   "CFBundleIdentifier" = "com.apple.driver.AppleUSBFTDI"
      |   "IOProviderClass" = "IOUSBInterface"
      |   "IOPowerManagement" =
{"CapabilityFlags"=32768,"MaxPowerState"=3,"CurrentPowerState"=3}
      |   "idProduct" = 17402
      |   "IOProbeScore" = 89999
      |   "bConfigurationValue" = 1
      |   "IOMatchCategory" = "IODefaultMatchCategory"
      |   "idVendor" = 2652
      |   "InputBuffers" = 8
      |   "bInterfaceNumber" = 1
      |   "OutputBuffers" = 16
      | }
      | 
      +-o IORS232SerialStreamSync  <class IORS232SerialStreamSync, id
0x10000fbf4, registered, matched, active, busy 0 (0 ms), retain 6>
        | {
        |   "IOTTYBaseName" = "usbserial-"
        |   "Product Name" = "BCM943362WCD3"
        |   "IOTTYSuffix" = "FTXKTFCPB"
        |   "Max Packet" = 512
        | }
        | 
        +-o IOSerialBSDClient  <class IOSerialBSDClient, id 0x10000fbf6,
registered, matched, active, busy 0 (0 ms), retain 5>
            {
              "IOClass" = "IOSerialBSDClient"
              "CFBundleIdentifier" = "com.apple.iokit.IOSerialFamily"
              "IOProviderClass" = "IOSerialStreamSync"
              "IOTTYBaseName" = "usbserial-"
              "IOSerialBSDClientType" = "IORS232SerialStream"
              "IOProbeScore" = 1000
              "IOCalloutDevice" = "/dev/cu.usbserial-FTXKTFCPB"
              "IODialinDevice" = "/dev/tty.usbserial-FTXKTFCPB"
              "IOMatchCategory" = "IODefaultMatchCategory"
              "IOTTYDevice" = "usbserial-FTXKTFCPB"
              "IOResourceMatch" = "IOBSD"
              "IOGeneralInterest" = "IOCommand is not serializable"
              "IOTTYSuffix" = "FTXKTFCPB"
            }


so, given a mount point like /dev/tty.usbserial-FTXKTFCPB, look for an
IOSerialBSDClient with IODialinDevice = </dev/tty.usbserial-FTXKTFCPB>
then go up the tree until you find an object with idProduct and idVendor
keys, and use this values.

Given a vid/pid, look for an object with idVendor and idProduct matching
your vid/pid, then look down the tree for the IODialinDevice key; its
value gives you the mount point.
If your USB-serial converters have unique serial numbers, you should be
able to differentiate them using those. If not, you can use the USB
location, or you can ask the user to only use one at a time.
I believe that the /dev node name is generated by the serial driver
itself. In the case above, the driver is Apple's FTDI driver, which uses
the device's serial number to make the name unique. Some drivers seem to
just generate a random name, which is bumped every time you replug the
serial/USB converter. But if the USB device has a unique serial number,
you'll find it further up the tree (key="USB Serial Number")

hth, Stuart

On 7/8/15, 5:32 PM, "[email protected] on
behalf of [email protected]"
<[email protected] on behalf of
[email protected]> wrote:

>Message: 6
>Date: Wed, 08 Jul 2015 17:32:36 -0700
>From: Carl Hoefs <[email protected]>
>To: Roland King <[email protected]>
>Cc: [email protected], [email protected]
>Subject: Re: Usb Digest, Vol 12, Issue 44
>Message-ID:
>       <[email protected]>
>Content-Type: text/plain; charset="utf-8"
>
>I’m not seeing this step:
>
>>On Jul 8, 2015, at 5:27 PM, Roland King <[email protected]> wrote:
>>      map mount point/device to VID/PID
>




 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Usb mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/usb/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to