Search documentation of macula

# macula_protocol_encoder (macula v4.4.9)

View Source

Protocol 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(Type, Msg)

Encode a message to binary format. Returns a binary with 8-byte header + MessagePack payload.

# Functions

# encode(Type, Msg)

    -spec encode(macula_protocol_types:message_type(), map()) -> binary().

Encode a message to binary format. Returns a binary with 8-byte header + MessagePack payload.