HwTransport

interface HwTransport : KmpHwTransport

Transport-agnostic hardware transport interface.

Extends KmpHwTransport (UniFFI callback) with session configuration and lifecycle management. Each transport implementation (BLE, USB, etc.) provides its own framing, fragmentation, and connection handling.

The Rust MPC SDK interacts with this via sendToHw/recvFromHw. Protocol classes use the session properties and drainIncomingBuffer for protocol-level coordination.

Properties

Link copied to clipboard
abstract val deviceInfo: DeviceInfo
Link copied to clipboard
abstract var fromPartyId: String

Party ID for TssMessage encoding.

Link copied to clipboard
abstract var groupId: String

MPC group identifier for IDCP/TssMessage encoding.

Link copied to clipboard
abstract var partyIndex: UInt

Party index for TssMessage encoding (3 = mobile).

Link copied to clipboard

Functions

Link copied to clipboard
abstract fun close()

Release all transport resources.

Link copied to clipboard
abstract suspend fun drainIncomingBuffer(stabilizationMs: Long = 500, maxWaitMs: Long = 5000): List<ByteArray>

Drain incoming buffer after batch-send operations. Clears stale data from the transport buffer between protocol steps.

Link copied to clipboard
abstract fun recvFromHw(expectedType: String): ByteArray
Link copied to clipboard
abstract fun sendToHw(msgType: String, payload: ByteArray, partyIndex: UInt, roundIndex: UInt)