HciPacketIo

interface HciPacketIo

Abstraction for reading and writing H4-framed Bluetooth HCI packets (0x01 Command, 0x02 ACL Data, 0x04 Event).

Inheritors

Properties

Link copied to clipboard

Whether the underlying transport keeps its descriptor open across close calls for reuse.

Functions

Link copied to clipboard
abstract fun close()

Closes the underlying HCI transport and unblocks any pending readPacket call.

Link copied to clipboard

Notifies the transport that HCI_Reset has already been executed and acknowledged prior to close.

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

Reads the next H4-framed HCI packet from the controller, or returns null if closed.

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

Writes an H4-framed HCI packet to the controller.