NfcCceTransportMdoc

class NfcCceTransportMdoc(sendMessageViaNfc: suspend (message: ByteString) -> Boolean) : MdocTransport

Transport for ISO/IEC 18013-5 Second Edition NFC Concurrent Channel Engagement (CCE) on the mdoc side.

Parameters

sendMessageViaNfc

a function to send a message via NFC, returns false if the NFC connection is no longer up.

Constructors

Link copied to clipboard
constructor(sendMessageViaNfc: suspend (message: ByteString) -> Boolean)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

A MdocConnectionMethod which can be sent to the other peer to connect to, or null if not applicable.

Link copied to clipboard

All single-mode MdocConnectionMethod instances advertised or handled by this transport.

Link copied to clipboard
val isNfcConnected: StateFlow<Boolean>

Whether the NFC connection is currently active.

Link copied to clipboard

Whether this CCE transport is operating in NFC-only mode without a secondary transport.

Link copied to clipboard
open override val role: MdocRole

The role which the transport is for.

Link copied to clipboard
open override val scanningTime: Duration?

The time spent scanning for the other peer.

Link copied to clipboard

Whether the next outgoing session message should include "disconnectNfc": true because the secondary transport is connected and NFC is still active.

Link copied to clipboard
open override val state: StateFlow<MdocTransport.State>

The current state of the transport.

Link copied to clipboard
open override val stats: MdocTransportStats

Statistics about the NfcCceTransportMdoc.

Functions

Link copied to clipboard
open suspend override fun advertise()

Starts advertising the connection.

Link copied to clipboard
open suspend override fun close()

Closes the connection.

Link copied to clipboard

Marks that a response is pending transmission for the current request.

Link copied to clipboard
suspend fun onMessageReceivedViaNfc(message: ByteString)

Called when a message has been received via NFC.

Link copied to clipboard

Called when a deactivation event on NFC has occurred.

Link copied to clipboard
open suspend override fun open(eSenderKeyBytes: ByteString)

Opens the connection to the other peer.

Link copied to clipboard
open suspend override fun sendMessage(message: ByteArray)

Sends a message to the other peer.

Link copied to clipboard
fun setExpectTransport(expectTransport: Boolean, connectionMethod: MdocConnectionMethod? = null)

Sets whether a setTransport is expected to be called.

Link copied to clipboard
suspend fun setTransport(transport: MdocTransport)

Called when the negotiated transport is connected.

Link copied to clipboard
open suspend override fun waitForMessage(): ByteArray

Waits for the other peer to send a message.

Link copied to clipboard

Wraps this Throwable as an MdocTransportException unless it's a CancellationException.