module

Matter::Codec::MessageCodec::Base

Instance methods

compute_flags(source_node_id : DataType::NodeId | Nil, destination_node_id : DataType::NodeId | Nil, destination_group_id : DataType::GroupId | Nil) : UInt8

Helper method to compute the flags byte from packet header fields This is used both when encoding and when creating new packet headers

Presence is determined by nil-ness, NOT by the node ID value. Callers should pass nil when there's no node ID (e.g., PASE sessions), not NodeId(0). This ensures consistent AAD computation across the codebase.

Source
decode_packet(data : Slice(UInt8)) : Packet
Source
decode_payload(packet : Packet) : Message
Source
encode_packet(packet : Packet) : Slice(UInt8)
Source
encode_packet_header(packet_header : PacketHeader, io : IO::Memory, byte_format : IO::ByteFormat = IO::ByteFormat::LittleEndian)
Source
encode_payload(message : Message) : Packet
Source
encode_payload_header(payload_header : PayloadHeader, io : IO::Memory, byte_format : IO::ByteFormat = IO::ByteFormat::LittleEndian)
Source