-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to use HidD_SetOutputReport for writing output (DS4) #378
Comments
Can I get an answer on this? I need to use the DS4 for an app I'm making. |
Update:So after endlessly searching the hidapi fork tree for hours, I found this one: https://github.com/jarveson/hidapi I've created a fork of node-hid here: https://github.com/Pecacheu/node-hid that accepts an optional boolean argument to With this change, now the DS4 can work via bluetooth! |
That fork was used for RPCS3/rpcs3#2733. |
Please see #468 |
Moved from node-hid/node-hid#245.
Context: DS4Windows sends data packet and Dualshock 4 responds. Node-hid (hidapi) sends exact same type of message with exact same data, and nothing happens.
Looking at the DS4Windows source code, specifically the source code of the native wrapper, it has to be down to the difference between WriteOutputReportViaControl and WriteOutputReportViaInterrupt.
In DS4Device.cs, WriteOutputReportViaControl is called when using bluetooth, which calls the function in HidDevice.cs. WriteOutputReportViaControl uses the HidD_SetOutputReport function, while WriteOutputReportViaInterrupt writes to the device using a filestream.
Meanwhile, hidapi (hence node-hid) uses only the filestream (aka WriteOutputReportViaInterrupt) approach for hid_write. I tried changing this to HidD_SetOutputReport in
hidapi\windows\hid.c
and recompiling using node-gyp. The file compiled successfully with no errors, however the program crashes silently when attempting to call.write
. The program must be crashing during the call to HidD_SetOutputReport, as I tried intentionally crashing the program on the next line in hid.c, and the program still crashes silently.Somewhere near top of file:
Additionally, I recompiled DS4Windows to use WriteOutputReportViaInterrupt over bluetooth, and the application behaved normally except LED/rumble settings had no effect. So that's definitely why it's not working with hidapi. (I propose an additional boolean argument to hid_write or a second function.)
The text was updated successfully, but these errors were encountered: