MdocNfcV2EngagementHelper

constructor(eDeviceKey: EcPublicKey, onHandoverComplete: (connectionMethod: MdocConnectionMethod, encodedDeviceEngagement: ByteString, handover: DataItem) -> Unit, onMessageReceived: suspend (ByteString) -> Unit, onError: (error: Exception) -> Unit, negotiatedHandoverPicker: (connectionMethods: List<MdocConnectionMethod>) -> MdocConnectionMethod, apduCommandMaxSize: Long = 65536)

Parameters

eDeviceKey

EDeviceKey as per ISO/IEC 18013-5:2021.

onHandoverComplete

the function to call when handover is complete.

onMessageReceived

the function to call when a data message has been received over NFC.

onError

the function to call if an error occurs.

negotiatedHandoverPicker

a function to choose one of the connection methods from the mdoc reader. This always contain a MdocConnectionMethodNfcV2 instance and contains others if the mdoc reader is capable of data transfer over e.g. BLE or Wifi Aware. If the mdoc only supports data transfer over NFC, it should return the element for MdocConnectionMethodNfcV2.

apduCommandMaxSize

the maximum length of the command data field.