title: Trying to get node.js to work with HID device
body: <p>I'm working on a node.js project to communicate with a Magtek eDynamo card reader using <a href="https://github.com/node-hid/node-hid" rel="nofollow noreferrer">node-hid</a>  I'm able to get connected and wait for data to be sent, but when I try and send feature report requests the code fails every time.</p>
  
  <p>I'm using the <a href="https://www.magtek.com/Content/DocumentationFiles/D998200115.pdf" rel="nofollow noreferrer">programming manual here</a> to get information needed to send the report requests.  I've tried the following with zero success.</p>
  
  <pre><code>var HID = require('node-hid');
  var os = require('os');
  
  var device_array = HID.devices('0x0801', '0x0019');
  console.log(device_array);
  
  if (device_array.length &gt; 1){
    console.log('More than one magstripe reader is plugged in!');
    process.exit(1);
  } else if (device_array.length == 0){
    console.log('No magstripe reader is plugged in!');
    process.exit(1);
  }
  
  var device = device_array[0];
  var magstripe = new HID.HID(device.path);
  
  magstripe.sendFeatureReport([0x20,0x09,0x00,0x00]); // Report request
  </code></pre>
  
  <p>For the report request I have tried the following</p>
  
  <p>0x00 (all reports ran below with and without the zero bit at beginning for win32 per documentation)</p>
  
  <p>0x20, 0x09, 0x00 (no last zero bit)</p>
  
  <p>0x20, 0x09, 0x00 0x00 (data bit zero per documentation)</p>
  
  <p>0x09, 0x00</p>
  
  <p>0x09, 0x00, 0x00</p>
  
  <p>Any help would be much appreciated as Magtek support is not very helpful and I'm stumped.</p>
  
  <p>error I receive</p>
  
  <pre><code>Error: could not send feature report to device
  at Object.&lt;anonymous&gt; (L:\code\nodejs\node-hid\index.js:45:22)
  at Module._compile (module.js:652:30)
  at Object.Module._extensions..js (module.js:663:10)
  at Module.load (module.js:565:32)
  at tryModuleLoad (module.js:505:12)
  at Function.Module._load (module.js:497:3)
  at Function.Module.runMain (module.js:693:10)
  at startup (bootstrap_node.js:188:16)
  at bootstrap_node.js:609:3
  </code></pre>
  
  <p>NOTE: index.js 45:22 is this code</p>
  
  <pre><code>var resp = magstripe.sendFeatureReport(messageA);
  </code></pre>