Documentation of the progress of my project from RapidTrigger OSUpad by adding a HID with 3 Axis joystick.
The Device Descriptor and Configuration Descriptor can be understood by the HOST, the Keyboard and Joystick are registered.
The final problem with this code is that when sending a report with Endpoint 0x82
, no data is visible on USBPcap, but if I just send To Endpoint 0x81
(Keyborad HID report) the data is visible in USBPcap.
One of myRefence USBPcap file is my gaming mouse, with 3 interfaces (Mouse, Keyboard, Vendor)
if (ep_addr == 0x82) {
ep = &hpcd->IN_ep[0x81 & EP_ADDR_MSK];
} else {
ep = &hpcd->IN_ep[ep_addr & EP_ADDR_MSK];
}
To codeline, I think this change is because the index ep_addr
array if 0x82
contains an empty config endpoint, therefore I switched it to index 0x81
which contains the default config endpoint
uint8_t USBD_CUSTOM_HID_SendReport(USBD_HandleTypeDef *pdev,
uint8_t *report, uint16_t len, uint8_t Ep)
{
To codeline, I gave the function a new parameter, namely uint8_t Ep
so that I can choose which endpoint the uint8_t *report
packet is sent to