class
Matter::Transport::MessageCounter
- Matter::Transport::MessageCounter
- Reference
- Object
Overview
Manages message IDs and deduplication
Matter protocol uses 32-bit message counters for:
- Ensuring message ordering
- Detecting duplicate messages
- Replay attack protection
Defined in:
matter/transport/message_counter.crConstant Summary
-
WINDOW_SIZE =
64 -
Rolling window size for duplicate detection (spec recommends at least 32)
Constructors
Instance Method Summary
- #counter : UInt32
-
#mark_received(message_id : UInt32) : Nil
Mark a message ID as received (for testing/manual tracking)
-
#next : UInt32
Get next message ID to send
-
#reset(value : UInt32 = 0_u32) : Nil
Reset counter (used when establishing new session)
-
#valid?(message_id : UInt32) : Bool
Check if a received message ID is valid (not a duplicate or replay) Returns true if message should be accepted
Constructor Detail
Instance Method Detail
def mark_received(message_id : UInt32) : Nil
#
Mark a message ID as received (for testing/manual tracking)
def valid?(message_id : UInt32) : Bool
#
Check if a received message ID is valid (not a duplicate or replay) Returns true if message should be accepted