SouthsideSoftware / delcom-indicator

A node library to drive a Declom Visual Indicator (http://www.delcomproducts.com/products_usblmp.asp)
MIT License
2 stars 3 forks source link

"Error: Cannot write to HID device" on Windows #2

Closed hegold closed 6 years ago

hegold commented 7 years ago

Attempting to use a Gen 2 device on Windows 10, I encountered this error.

It seems that instead of write, sendFeatureReport must be used, and the payload array must be zero padded to 8 elements (presumably there is a difference in how the underlying lib handles this on Linux).

As a workaround, something like the following can be used:


var buildLight = new DelcomIndicator();

buildLight.deviceConnection.write = input => {

    while(input.length < 8) {
        input.push(0);
    }

    buildLight.deviceConnection.sendFeatureReport(input);
};```
hegold commented 6 years ago

Created #3 which fixes this