Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

deviceAddress does not match libusb device address #8

Open
matthova opened this issue Apr 29, 2015 · 3 comments
Open

deviceAddress does not match libusb device address #8

matthova opened this issue Apr 29, 2015 · 3 comments
Labels

Comments

@matthova
Copy link

matthova commented Apr 29, 2015

The deviceAddress provided by usb-detection is not consistent with the same device's device address via libusb. This is on Windows 7, Node 0.10.35.

For example
usb-detection provides:

 { locationId: 0,
  vendorId: 1133,
  productId: 50484,
  deviceName: 'USB Composite Device',
  manufacturer: '(Standard USB Host Controller)',
  serialNumber: '',
  deviceAddress: 18 }

while (npm's) usb provides

 { busNumber: 1,
  deviceAddress: 21,
  deviceDescriptor:
   { bLength: 18,
     bDescriptorType: 1,
     bcdUSB: 512,
     bDeviceClass: 0,
     bDeviceSubClass: 0,
     bDeviceProtocol: 0,
     bMaxPacketSize0: 8,
     idVendor: 1133,
     idProduct: 50484,
     bcdDevice: 10496,
     iManufacturer: 1,
     iProduct: 2,
     iSerialNumber: 0,
     bNumConfigurations: 1 },
  portNumbers: [ 1 ] }

The offset between libusb and usb-detection changes with any instance of the node process.

All the same, awesome library! Very useful.

@MadLittleMods
Copy link
Owner

@matthova Thank you for the bug report. I saw your issue the moment you posted but I haven't gotten around to investigating.

@thegecko
Copy link
Contributor

Just hit this issue, any idea where the problem may be?

@thegecko
Copy link
Contributor

On Windows it looks like it's just incrementing an internal counter which makes it unique (to this library) but certainly isn't correct:

resultItem->deviceAddress = dummy++;

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants