NciPacketIo

interface NciPacketIo

Abstraction for reading and writing raw NFC Controller Interface (NCI) packets (3-byte header [MT|PBF|GID_or_ConnID, OID_or_RFU, PayloadLen] + payload) and controlling the hardware reset / enable (VEN) pin.

Inheritors

Functions

Link copied to clipboard
abstract fun close()

Closes the underlying transport, powers down the controller if applicable, and unblocks any pending readPacket call.

Link copied to clipboard
abstract suspend fun readPacket(): ByteArray?

Reads the next complete NCI packet from the controller, or returns null if closed.

Link copied to clipboard
abstract suspend fun resetHardware()

Performs a hardware power-cycle / reset of the NFC controller (for example, toggling the VEN GPIO pin low and then high).

Link copied to clipboard
abstract suspend fun writePacket(packet: ByteArray)

Writes a complete NCI packet to the controller.