macula_protocol_encoder (macula v0.20.5)
View SourceProtocol message encoder for Macula mesh. Encodes message maps to binary wire format.
Frame Format (8-byte header + payload): - Version (1 byte): Protocol version (currently 0x01) - Type (1 byte): Message type ID - Flags (1 byte): Reserved for future use (0x00) - Reserved (1 byte): Must be 0x00 - Payload Length (4 bytes): Big-endian uint32 - Payload (N bytes): MessagePack-encoded message data
Summary
Functions
Encode a message to binary format. Returns a binary with 8-byte header + MessagePack payload.
Functions
-spec encode(macula_protocol_types:message_type(), map()) -> binary().
Encode a message to binary format. Returns a binary with 8-byte header + MessagePack payload.