I think I needs something like this
void EVENT_USB_Device_ControlRequest(void)
{
if (USB_ControlRequest.wValue == 0x0301 && USB_ControlRequest.bRequest == 6)
{
XData[0] = 1;
XData[1] = 3;
XData[2] = 0x0e;
while ( !Endpoint_IsINReady() ); Endpoint_Write_Stream_LE( &XData, sizeof(XData), NULL);
}
Endpoint_ClearOUT();
}
I also tried setting a flag and doing
Endpoint_Write_Stream_LE( &XData, sizeof(XData), NULL);
in the normal hid task but the timing is way off..
The reason I want to do this is because of xinput, they use some proprietary crap.
I see it sends an Out bulk transfer with 1,3,6 and then an bulk in transfer answered it. Though I'm pretty sure the answer needs to be the next transfer after the out. I can not seem to get LUFA to stack them. This handshake happens jut after enumeration. and what I see is the out transfer and then a lot of in transfer (like normal ) followed by the in transfer I need.
What i want..
1,3,6 out
1 3 0 in
but instead get.
1,3,6 out
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
... and many more
.. and more
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
00 80 ff f7 .... (normal in bulk transfer)
1 3 0 in finally my custom transfer
I was hoping putting the
Endpoint_Write_Stream_LE in the EVENT_USB_Device_ControlRequest itself would have worked but it didn't.