cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD Type-C

New Contributor II

Hi,

I am writing code to have CCG3PA send a "dpm_pd_command" request to the end device to do a DR_SWAP (data role swap). Originally I thought that the return status (ccg_status_t) will tell me if the end device accepted or rejected the request, but it seems that the ccg status will only tell me if the request is registered or not.

How to I read the response back from the end device to see if it accepted or rejected my DR_SWAP request?

Thanks,

Jonathan

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi Jonathan,

Two ways:

1. Add a timer (about 1s) after you sent DR_SWAP. And define a callback function after timeout. And use the callback function read status as below example.

    if(resp == RES_RCVD || pkt_ptr->msg == CTRL_MSG_REJECT)

2. Add judge condition in app.c

Function: void app_event_handler(uint8_t port, app_evt_t evt, const void* dat)

        case APP_EVT_DR_SWAP_COMPLETE:

Best Regards,

Lisa

View solution in original post

0 Likes
Reply
1 Reply
Moderator
Moderator

Hi Jonathan,

Two ways:

1. Add a timer (about 1s) after you sent DR_SWAP. And define a callback function after timeout. And use the callback function read status as below example.

    if(resp == RES_RCVD || pkt_ptr->msg == CTRL_MSG_REJECT)

2. Add judge condition in app.c

Function: void app_event_handler(uint8_t port, app_evt_t evt, const void* dat)

        case APP_EVT_DR_SWAP_COMPLETE:

Best Regards,

Lisa

View solution in original post

0 Likes
Reply