2019-11-21 12:00 AM
I sended a dr_swap request, and the target will response a ack/reject/wait.
I use the follow api to send dr_swap, and the target response a reject. However, this api just return USB_OK not USBPD_REJECT. And where I could get the response from the target?
yy = USBPD_PE_Request_CtrlMessage(port_num, USBPD_CONTROLMSG_DR_SWAP, USBPD_SOPTYPE_SOP);
Solved! Go to Solution.
2019-11-21 04:59 AM
All the request functions (like USBPD_DPM_RequestDataRoleSwap) will not trig directly the sent of the message to port partner. Idea is to post a request to the stack and when stack is ready, it will consume this request to send it to the port partner.
Only 1 request is possible. Another request sent whereas the previous one has not been consumed will be not taken in account (USBPD_BUSY status will be returned)
USBPD_BUSY is also returned if there are no connected port partners.
In your case, USBPD_OK from USBPD_DPM_RequestDataRoleSwap means than request has been posted to the stack.
Answer from port partner will be available in the different notifications received in the USBPD_DPM_Notification function and mainly:
Please refer to message sequence chart available in UM2552, §4.4.1 Data role swap.
2019-11-21 04:59 AM
All the request functions (like USBPD_DPM_RequestDataRoleSwap) will not trig directly the sent of the message to port partner. Idea is to post a request to the stack and when stack is ready, it will consume this request to send it to the port partner.
Only 1 request is possible. Another request sent whereas the previous one has not been consumed will be not taken in account (USBPD_BUSY status will be returned)
USBPD_BUSY is also returned if there are no connected port partners.
In your case, USBPD_OK from USBPD_DPM_RequestDataRoleSwap means than request has been posted to the stack.
Answer from port partner will be available in the different notifications received in the USBPD_DPM_Notification function and mainly:
Please refer to message sequence chart available in UM2552, §4.4.1 Data role swap.