node-ds4
node-ds4 copied to clipboard
Data-dump bluetooth OSX
$ ds4-dump works great on USB, but with bluetooth it throws an error:
buffer.js:663
throw new RangeError('index out of range');
^
RangeError: index out of range
at checkOffset (buffer.js:663:11)
at Buffer.readInt16LE (buffer.js:798:5)
at parseDS4HIDData (/Users/mikkmartin/Documents/dualshock-test/node_modules/ds4/index.js:40:18)
when i log the buffer without parsing, the HID device returns smaller dataset (without trackpad / gyro data) initially:
<Buffer 01 80 7f 84 77 08 00 00 00 00>
and nothing after hidDevice.getFeatureReport(0x04, 66);
then I have to reconnect the controller on bluetooth to reset the controller state.
Change it to hidDevice.getFeatureReport(0x04, 37); and it works
Sending LED, rumble, etc. over bluetooth is also possible but it will take some work: https://github.com/todbot/node-hid-ds4-test/blob/master/node-hid-ds4-test.js