How to read a USB stream

Discussion in 'Mac Programming' started by hfuhruhurr, Sep 18, 2015.

  1. hfuhruhurr macrumors newbie

    hfuhruhurr

    Joined:
    May 5, 2012
    Location:
    Denver
    #1
    I have specialty software that is Windows-only and hasn't been updated since the 90s. I would like to make a Mac program for it. Fundamentally, it's not that complex: there are measurements that come in from a proprietary device via USB. Those measurements are then displayed and analyzed against known norms.

    Is there an easy way to view/use the USB stream data? What would be the best tools for the job?
     
  2. asaggynoodle macrumors member

    asaggynoodle

    Joined:
    Sep 22, 2015
    #2
    If you want to try to run the software itself, I'd take a shot at using it in a Wine Wrapper. Or else just run it in a virtual machine. What software are you using?
     
  3. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #3
    Unfortunately, we need more information than you're providing. USB devices present themselves as different "classes". For example: USB-sound, USB-printers, USB-serial, USB-HID (mice, keyboards, etc). If the device presents itself as a USB-serial device, for example, then you're life is pretty easy. There will be several Unix-level devices created that would allow you to communicate with the USB-thing automatically. But if the thing you're plugging in presents itself as something else, then different steps would need to be taken depending on what kind of USB class the device presents itself as.

    I would plug in the device, then go to "About this Mac"... "System Report"... "USB". You should get more information about this the widget is presenting itself to the Mac over USB.

    Report back with what shows up for the device in question.
     
  4. hfuhruhurr thread starter macrumors newbie

    hfuhruhurr

    Joined:
    May 5, 2012
    Location:
    Denver
    #4
    In the 'USB Device Tree,' under the second 'USB Hi-Speed Hub' root, under the 'Hub' branch, the properties for the device are:
    Product ID: 0x0001
    Vendor ID: 0x0f77
    Version: 1.23
    Speed: Up to 12 Mb/sec
    Manufacturer: SRS Medical, Inc.
    Location ID: 0xfd120000 / 4
    Current Available (mA): 500
    Current Required (mA): 2

    I don't know if that narrows down the USB type. My guess is that it is indeed a USB-serial because it doesn't produce sound, doesn't print, and it's not an HID device.
     
  5. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #5
    I plugged in a USB-Serial cable I have into my Mac. At the top of the USB information screen which shows the USB device tree, it showed up as a "USB-Serial Controller". Do you see that on your 'tree view'? Also, a device was created "/dev/ttys000" when I plugged in the device. That's the serial port device associated with the USB-Serial controller. I would look for devices of the form of "/dev/ttys*" owned by your username with a recent date when you plug in the device. That will likely be the way to access the information from the serial port.
     

Share This Page