In my usbFunctionSetup I have this.
Code: Select all
if((rq->bmRequestType & USBRQ_TYPE_MASK) == USBRQ_TYPE_CLASS)
{ /* class request type */
if(rq->bRequest == USBRQ_HID_GET_REPORT)
{
if ( rq->wValue.bytes[1] == 3 )//feature
{
if ( rq->wValue.bytes[0] == 2 )
{//PID Block Load Report
reportBuffer[0]=2; //report id 2
reportBuffer[1]=_FFB_effect_index;//effect index
reportBuffer[2]=1;//1 = success:2 = full: 3 = error
reportBuffer[3]=255;
reportBuffer[4]=255;
return 5;//the size its looking for.
}
return USB_NO_MSG;
}
}
else if (rq->bRequest == USBRQ_HID_SET_REPORT)
{
if ( rq->wValue.bytes[1] == 3 )//feature
{
if ( rq->wValue.bytes[0] == 1 ) {/* get data in usb write */}//set effect Report
return USB_NO_MSG;
}
}
else if(rq->bRequest == USBRQ_HID_GET_IDLE)
{
usbMsgPtr = &idleRate;
return 1;
}
else if(rq->bRequest == USBRQ_HID_SET_IDLE)
{
idleRate = rq->wValue.bytes[1];
}
}
return 0;
}
The problem is that after I get and send this report I no longer see any bulk out transfers in my usbFunctionWrite. If I dont reply with the code above and just use return USB_NO_MSG I see my bulk transfers. Why would returning data, stop me from getting bulk transfers? usbLyzer indicates they are still being sent.
update: Ok doing this is bad, it sends an input report 3 matching my feature report immediately after ( not too surprised ) .