MdocNfcPresentmentService

Base class for NFC APDU services that initiate and manage an ISO/IEC 18013-5 mdoc presentment transaction (MdocNdefService and MdocNfcCceService).

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
protected val serviceScope: CoroutineScope

CoroutineScope tied to the lifecycle of this service (cancelled in stop).

Functions

Link copied to clipboard

Signals that the NFC link has been deactivated.

Link copied to clipboard
protected abstract suspend fun processCommandApdu(commandApdu: CommandApdu): ResponseApdu

Processes a CommandApdu sequentially on the service's background coroutine.

Link copied to clipboard
protected open suspend fun processDeactivated(reason: NfcDeactivationReason)

Processes a deactivation event sequentially on the service's background coroutine.

Link copied to clipboard

Enqueues an incoming CommandApdu for sequential processing by processCommandApdu.

Link copied to clipboard
open fun start()

Starts the service and its internal APDU dispatch coroutine.

Link copied to clipboard
open fun stop()

Stops the service and cancels its internal APDU dispatch coroutine.

Link copied to clipboard
protected fun vibrateError()

Triggers haptic feedback indicating an NFC engagement error, if supported by the platform.

Link copied to clipboard
protected fun vibrateSuccess()

Triggers haptic feedback indicating successful NFC engagement, if supported by the platform.