Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple connected devices #1

Open
danielsiwiec opened this issue Dec 8, 2016 · 0 comments
Open

Support multiple connected devices #1

danielsiwiec opened this issue Dec 8, 2016 · 0 comments

Comments

@danielsiwiec
Copy link

Hi @tcabanski, currently the module supports only one connected device. Could we have a support for multiple? It could be as simple as:

  constructor(deviceNo) {
    ....
    ....
    this.device = this.findDevice(deviceNo);
    ....
    ....
  }

  findDevice(deviceNo) {
    var devices = hid.devices(this.vendorId, this.productId);
    if (devices !== undefined) {
      return devices[deviceNo || 0];
    }
  }

It wouldn't affect existing consumers of the module, but would allow the new ones to select the device. I'd be happy to submit a pull request for this.

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

No branches or pull requests

1 participant