📡 Read a Credential over Proximity
The POS accepts an ISO/IEC 18013-5 engagement over NFC or by scanning an mdoc: QR code. Once it
has the engagement, it creates a session transcript, builds the request against that transcript,
and starts the reader exchange.
Model the reader lifecycle
ProximityReaderModelkeeps the engagement, request, and result in a small state machine so the UI cannot start a transfer before it has both an endpoint and a request.setConnectionEndpoint()moves the model toWAITING_FOR_DEVICE_REQUESTstate. At that point, create our request using the session transcript; then callsetDeviceRequest()and start the exchange. This order prevents a request from being detached from the specific proximity session.
Send the request and receive the response
The above code block:
- Opens an
MdocTransportrequest to the other peer. - Sends the request through ISO/IEC 18013-5
SessionEncryption - And closes the transport whether the holder responds or not surfacing the outcomes
The flow returns an explicit outcome for no response, a non-zero device-response status, or a successful response. Surface those outcomes to the cashier; do not advance the sale until the authoritative settlement step succeeds.