Package-level declarations

Types

Link copied to clipboard
data class CommandApdu(val cla: Int, val ins: Int, val p1: Int, val p2: Int, val payload: ByteString, val le: Int)

A Command APDU according to ISO/IEC 7816.

Link copied to clipboard
data class HandoverRequestRecord(val version: Int, val embeddedMessage: NdefMessage)

Handover Request record.

Link copied to clipboard
data class HandoverSelectRecord(val version: Int, val embeddedMessage: NdefMessage)

Handover Select record.

Link copied to clipboard
data class NdefMessage(val records: List<NdefRecord>)

An immutable NDEF message.

Link copied to clipboard
data class NdefRecord(val tnf: NdefRecord.Tnf, val type: ByteString = ByteString(), val id: ByteString = ByteString(), val payload: ByteString = ByteString())

An immutable NDEF Record.

Link copied to clipboard
object Nfc

Constants and utilities related to NFC.

Link copied to clipboard
class NfcCommandFailedException(message: String, val status: Int) : Exception

Exception thrown if an NFC command doesn't return success.

Link copied to clipboard
abstract class NfcIsoTag

Class representing a ISO/IEC 14443-4 tag.

Link copied to clipboard
Link copied to clipboard

Exception thrown if a NfcIsoTag is removed while trying to communicate with it.

Link copied to clipboard
data class ResponseApdu(val status: Int, val payload: ByteString = ByteString())

A response APDU according to ISO/IEC 7816-4.

Link copied to clipboard
data class ServiceParameterRecord(val tnepVersion: Int, val serviceNameUri: String, val tnepCommunicationMode: Int, val wtInt: Int, val nWait: Int, val maxNdefSize: Int)

Service Parameter Record.

Link copied to clipboard
data class ServiceSelectRecord(val serviceName: String)
Link copied to clipboard
data class TnepStatusRecord(val status: Int)

Properties

Link copied to clipboard

Is set to true if the device supports NFC scanning.

actual val nfcTagScanningSupported: Boolean = true
actual val nfcTagScanningSupported: Boolean = false
Link copied to clipboard

Is set to true if the device supports NFC scanning and scanNfcTag works without showing a dialog.

Functions

Link copied to clipboard

Converts Minimum Waiting Time to a duration.

Link copied to clipboard
actual suspend fun <T : Any> scanNfcTag(message: String?, tagInteractionFunc: suspend (tag: NfcIsoTag, updateMessage: (message: String) -> Unit) -> T?): T
expect suspend fun <T : Any> scanNfcTag(message: String?, tagInteractionFunc: suspend (tag: NfcIsoTag, updateMessage: (message: String) -> Unit) -> T?): T

Shows a dialog prompting the user to scan a NFC tag.

actual suspend fun <T : Any> scanNfcTag(message: String?, tagInteractionFunc: suspend (<Error class: unknown class>, updateMessage: (message: String) -> Unit) -> T?): T
actual suspend fun <T : Any> scanNfcTag(message: String?, tagInteractionFunc: suspend (tag: NfcIsoTag, updateMessage: (message: String) -> Unit) -> T?): T