BleAction

A NetworkAction framed as a Bluetooth Low Energy payload.

Where a WebSocket action builds a URL, a BLE action builds a byte payload: the connection is assumed to be already established, so each step only needs an opcode, a set of type codes, and its data laid out in a fixed order.

This is transport scaffolding for a future BLE channel. No shipping protocol routes through it today — WebSocket (com.silencelaboratories.silentshard.network.websocket.WebsocketAction) is the active transport — so treat the wire format below as provisional.

Payload layout produced by buildBlePayload:

[opCode:1][length:2 big-endian][algorithmCode:1][actionCode:1][protocolCode:1][data:N]

Properties

Link copied to clipboard
abstract val actionCode: Byte

Action identifier, e.g. 0x01 = keygen, 0x02 = sign, 0x03 = refresh.

Link copied to clipboard
abstract val algorithmCode: Byte

Algorithm identifier: 0x01 = ECDSA, 0x02 = EdDSA.

Link copied to clipboard
abstract val opCode: Byte

Operation code identifying the action type.

Link copied to clipboard
abstract val protocolCode: Byte

Protocol-variant identifier: 0x01 = Duo, 0x02 = Trio.

Functions

Link copied to clipboard

Builds the type-code header without the length prefix or data.

Link copied to clipboard

Builds the full BLE payload: opCode, a big-endian 2-byte length, the algorithmCode, actionCode, and protocolCode type codes, then the data bytes.