Skip to content

Support multiple connected devices #1

@danielsiwiec

Description

@danielsiwiec

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions