Support DFU GET_STATUS request when in application mode.

This commit is contained in:
Gareth McMullin 2012-01-19 21:51:42 +13:00
parent f2f5fd2fa1
commit f5d8bda6e6
1 changed files with 14 additions and 0 deletions

View File

@ -434,6 +434,20 @@ static int cdcacm_control_request(struct usb_setup_data *req, uint8_t **buf,
return 1;
}
#endif
case DFU_GETSTATUS:
if(req->wIndex == DFU_IF_NO) {
u32 bwPollTimeout = 0; /* 24-bit integer in DFU class spec */
(*buf)[0] = DFU_STATUS_OK;
(*buf)[1] = 0;
(*buf)[2] = 0;
(*buf)[3] = 0;
(*buf)[4] = STATE_APP_IDLE;
(*buf)[5] = 0; /* iString not used here */
*len = 6;
return 1;
}
case DFU_DETACH:
if(req->wIndex == DFU_IF_NO) {
*complete = dfu_detach_complete;