I am using the NXP reader library (version 05.16.00) to communicate with a PN5180 front end. I am trying to implement EMVCo card removal.This is quite easy to achieve through the discovery loop layer:
phacDiscLoop_SetConfig(sDiscLoop, PHAC_DISCLOOP_CONFIG_NEXT_POLL_STATE, PHAC_DISCLOOP_POLL_STATE_REMOVAL);
However this command will block until the card is removed (the code reaches the while loop starting on line phacDiscLoop_Sw_Int.c:443). Our host processor is running a bare board application (no threading support) which means that the system will freeze until the card is removed and this while loop terminates. This is not acceptable for our application for a number of reasons. I am wondering if anyone can suggest a way of achieving this removal in a non-blocking manner. For example I could keep calling phacDiscLoop_Run which would return an error if the card is still in the field and success if it is removed. Would such a design be possible based on the EMVCo standard? Ideally I would like to do so without modifying the reader library source code to make updates in the future as simple as possible.
Currently my thoughts are to make my own version of phacDiscLoop_Sw_Int_EmvcoRemovalProcedure that does not block and then call this instead of phacDiscLoop_Run but if anyone can suggest a simpler way that does not have to bypass the discovery loop layer that would be a preferable solution.