FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

getDeviceList() does not update the list of devices properly · Issue #803 · node-usb/node-usb · GitHub

getDeviceList() does not update the list of devices properly #803

Description

Bug Description:

getDeviceList() will not show a device's new address if it is connected, removed, then reconnected.

Steps to Reproduce:

I tested this using "usbview.exe" to check the Device Address and a Typescript program that tries to find a Silicon Labs C8051 device with VID=0x10C4 and PID=0xEA61 every 3 seconds.

  1. Connect the device and check the Device Address in "usbview.exe".
  2. Launch the Typescript program. Observe that it can detect the device and reports the same Device Address.
  3. Disconnect the device. Wait 2 seconds.
  4. Reconnect the device. Observe that "usbview.exe" shows a different Device Address for the C8051, but the Typescript program continues to report the old Device Address.

Additional Information

  • Operating System: Windows 10
  • Runtime: Node v16.17.0
  • Node USB Version: usb@2.13.0

Typescript to reproduce:

import * as usb from 'usb';
async function main() {
	let i = 0;
	do {
		await delay(3000);	
		const devices = usb.findByIds(<VENDOR_ID>, <PRODUCT_ID>);		
		console.log(`device run ${i}: `, devices);
		i++;
	} while (true);
}
function delay(ms: number) {
    return new Promise( resolve => setTimeout(resolve, ms) );
}
main();

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL