You can change the DR_SWAP logic as per your requirements. You can see that the default firmware setting as when PD contract is established and the role is DFP, initial DR_SWAP.
You can use same way, but gate difference, for example, you can sent the Discovery Identify first and then get the VID&PID, ans then inital DR_SWAP use same API.
Thanks for getting back. Got 3 follow-up questions:
1. In the attached PD-log it looks like it is the laptop that initiates the DR_SWAP so will it still be possible to trigger the DI at the APP_EVT_PD_CONTRACT_NEGOTIATE_COMPLETE ?
2. If yes, how would that code look like?
3. Noticed the define "UFP_MODE_DISC_ENABLE?" that is used in vdm_task_mgr.c among other files. Is this a better way to do it? Or that would be releventa if the device in question is a dock?
1. There is no stick define for this as per PD SPEC.
2. You can initial Discovery Identify as per your want, but after APP_EVT_PD_CONTRACT_NEGOTIATE_COMPLETE and check whether CCG4 is UFP or not, And then initial Discovery Identify is OK.
3. I do not recommend you use this, since this is for DFP and identify all of ALT mode as per DisplayPort Alt Mode. And your hardware design is not support DisplayPort host.