node-ds4 icon indicating copy to clipboard operation
node-ds4 copied to clipboard

Data-dump bluetooth OSX

Open mikkmartin opened this issue 10 years ago • 2 comments

$ 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.

mikkmartin avatar Apr 11 '16 15:04 mikkmartin

Change it to hidDevice.getFeatureReport(0x04, 37); and it works

matthewbauer avatar Mar 08 '17 09:03 matthewbauer

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

matthewbauer avatar Mar 08 '17 10:03 matthewbauer