Add usb port or path information #252
Replies: 6 comments 16 replies
-
hidapi itself internally uses Can you clarify what do you mean by |
Beta Was this translation helpful? Give feedback.
-
I think path here means /dev/hidraw0 or /dev/hidraw1. but hidraw0 or hidraw1 is depend on device plug sequence. If device 1 plug on usb port firstly, it become hidraw0, if device 2 plug on usb port firstly, device 2 will be hidraw0 Now our test program uuu with libusb work like uuu -m 1:10 image_A ///for board A Board A and B will be power on off random. |
Beta Was this translation helpful? Give feedback.
-
If you want uniquly identify a specific device regardless when it was connected, or to which USB port - it is possible only by commenicating with the device itself, e.g. asking its unique ID (yeap, Some platforms (e.g. Windows) - don't even give you an API to ask to which USB port device is connected, or even is it a USB device or not. Even if you have a USB path of the device (e.g.: bus_no->port_no->...etc.) - it can easily change after reboot/kernel upgrade/another hub connected/etc. hidapi is a library to work with HID devices. HID != USB. A HID device could be a USB or Bluetooth or I2C or virtual bus-less device. |
Beta Was this translation helpful? Give feedback.
-
Currently uuu work well with libusb at windows and linux environment. but new mac os requirement coming. That's reason why consider HIDAPI now.
|
Beta Was this translation helpful? Give feedback.
-
The problem is the hidapi It sounds like your process is: 1. Issue HID command to device to trigger bootloader mode, 2. Issue LIBUSB command to upload new firmware. Is this correct? If so, what if you did something like: a. Pick a device randomly This algorithm depends on there being some differences detectable in step (d) between the device in bootloader and normal mode (the |
Beta Was this translation helpful? Give feedback.
-
I second this suggestion, as it can be crucial to distinguish multiple devices of the same kind being connected. On macOS However I don’t think there’s currently a way to access or use the location ID with HIDAPI. |
Beta Was this translation helpful? Give feedback.
-
It is not all devices that provided iserial info.
If two such devices plug into PC, need a method to distinguish it.
ref: libusb/libusb#885 and #250
Beta Was this translation helpful? Give feedback.
All reactions