Packet Types

Every CONDUYT packet carries a 1-byte type code in the header. Commands flow host to device. Events flow device to host.

Payload fields use the notation u8 (unsigned byte), u16 (unsigned 16-bit little-endian), i32 (signed 32-bit little-endian), f32 (32-bit IEEE 754 float little-endian), N (variable length remaining bytes). Fields in [brackets] are optional.

Commands (Host to Device)

CodeNamePayloadResponse
0x01PING(none)PONG
0x02HELLO(none)HELLO_RESP
0x10PIN_MODEpin(u8) + mode(u8)ACK
0x11PIN_WRITEpin(u8) + value(u8) + mode(u8)ACK
0x12PIN_READpin(u8) + mode(u8)PIN_READ_RESP
0x13PIN_SUBSCRIBEpin(u8) + mode(u8) + interval_ms(u16) + threshold(u16)ACK
0x14PIN_UNSUBSCRIBEpin(u8)ACK
0x20I2C_WRITEaddr(u8) + data(N)ACK
0x21I2C_READaddr(u8) + count(u8)I2C_READ_RESP
0x22I2C_READ_REGaddr(u8) + reg(u8) + count(u8)I2C_READ_RESP
0x30SPI_XFERcs_pin(u8) + data(N)SPI_XFER_RESP
0x40MOD_CMDmodule_id(u8) + cmd(u8) + payload(N)ACK or MOD_RESP
0x50STREAM_STARTpin_mask(u16) + rate_hz(u16)ACK
0x51STREAM_STOP(none)ACK
0x60DS_WRITEds_index(u8) + value(N)ACK
0x61DS_READds_index(u8)DS_READ_RESP
0x62DS_SUBSCRIBEds_index(u8) + interval_ms(u16)ACK
0x70OTA_BEGINtotal_bytes(u32) + sha256(32)ACK
0x71OTA_CHUNKoffset(u32) + data(N)ACK
0x72OTA_FINALIZE(none)ACK (then reboot)
0xF0RESET(none)ACK

Events (Device to Host)

CodeNamePayloadTrigger
0x80PONG(none)Response to PING
0x81HELLO_RESPcapability binaryResponse to HELLO
0x82ACK(none)Command success
0x83NAKerror_code(u8)Command failure
0x90PIN_EVENTpin(u8) + value(u16)Subscription trigger
0x91PIN_READ_RESPpin(u8) + value(u16)Response to PIN_READ
0xA0I2C_READ_RESPdata(N)Response to I2C_READ
0xB0SPI_XFER_RESPdata(N)Response to SPI_XFER
0xC0MOD_EVENTmodule_id(u8) + event_code(u8) + data(N)Unsolicited module event
0xC1MOD_RESPmodule_id(u8) + data(N)Response to MOD_CMD
0xD0STREAM_DATAvalues(N x u16)Streaming sample
0xD1DS_EVENTds_index(u8) + value(N)Datastream push
0xD2DS_READ_RESPds_index(u8) + value(N)Response to DS_READ
0xE0LOGstring(N)Debug log message
0xFFFATALstring(N)Unrecoverable error

Common Payload Examples

Actual payload bytes for frequently used packets:

PIN_MODE -- set pin 13 to output mode:

0D 01

0D = pin 13, 01 = DIGITAL_OUT mode.

PIN_WRITE -- set pin 13 high:

0D 01

0D = pin 13, 01 = value HIGH.

PIN_READ -- read pin 0:

00

00 = pin 0. The device responds with PIN_READ_RESP containing the current value.

MOD_CMD -- send command 0x02 to module 0:

00 02

00 = module_id 0, 02 = command byte. Additional payload bytes follow if the command requires data.

Sequence Numbers

Every command carries a seq byte (0 to 255, wrapping). The device echoes seq in its response (ACK, NAK, or typed response). This correlates multiple in-flight commands to their responses.

Unsolicited events (PIN_EVENT, MOD_EVENT, DS_EVENT, STREAM_DATA, LOG, FATAL) use seq = 0.