Skip to content

Commit

Permalink
mtp-responder: Send setup response if in state ONSERVICE
Browse files Browse the repository at this point in the history
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
  • Loading branch information
JianyuWang0623 authored and xiaoxiang781216 committed Jan 7, 2025
1 parent 9492875 commit 80b84de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/mtp_usb_driver_nuttx.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,12 @@ static void __handle_control_request(mtp_int32 request)
sent_busy = FALSE;
}

status = write(g_usb_ep0, &statusreq_data, sizeof(statusreq_data));
if (status < 0) {
ERR("IOCTL MTP_SEND_STATUS_ACK Failed [%d]\n",
errno);
if (_transport_get_mtp_operation_state() == MTP_STATE_ONSERVICE) {
status = write(g_usb_ep0, &statusreq_data, sizeof(statusreq_data));
if (status < 0) {
ERR("IOCTL MTP_SEND_STATUS_ACK Failed [%d]\n",
errno);
}
}
break;

Expand Down

0 comments on commit 80b84de

Please sign in to comment.