-
Notifications
You must be signed in to change notification settings - Fork 65
Description
In DinamicHID.cpp, inside the get report function, it is written that if wValue's value is equal to INPUT_REPORT (0x1), then we should prepare the next report : [the code]
if (report_type == DYNAMIC_HID_REPORT_TYPE_INPUT)
{
// /* Create the next HID report to send to the host */
// GetNextReport(0xFF, &JoystickReportData);
// /* Write the report data to the control endpoint */
// USB_SendControl(TRANSFER_RELEASE, &JoystickReportData, sizeof(JoystickReportData));
}
However that is not true, I've read the libraries made by Hoantv including the arduino project and researched quite a lot on this topic.
Here :
uint8_t bmRequest = 0xa1
uint8_t bRequest = 0x1
uint8_t wValueH = 0x1
uint8_t wValueL = 0x2
uint16_t wIndex = 0x0
uint16_t wLength = 0x3
(this` function assumes that bRequest = 1 and that bmRequest was parsed correctly; What we're discussing is wValueH)
On this specific request if wValueH = INPUT_REPORT (or DYNAMIC_HID_REPORT_TYPE_INPUT in the code) and wValueL = 2 then the PID status should be sent. Huantv made a function called something like FfbOnPIDStatus that returns this struct USB_FFBReport_PIDStatus_Input_Data_t initialized by default to {2,30,0}. This was the case for his force-feedback-core library at least (inside legacy branch).
This should be causing some issues, at least theoretically, if not, then maybe I am wrong, if I'm not, then should be changed to not confuse people.