class

Matter::Transport::Exchange

Inherits Reference < Object

Represents a message exchange (request/response pair)

In Matter protocol, exchanges are bidirectional conversations identified by an exchange ID. Each exchange tracks:

  • Exchange ID
  • Protocol ID
  • Whether we initiated the exchange
  • Pending acknowledgments
  • Retransmission state

Constants

MRP_BACKOFF_BASE = 1.6
MRP_BASE_TIMEOUT = 200

Retransmission parameters (from Matter spec)

MRP_MAX_RETRIES = 5
MRP_STANDALONE_ACK_MS = 200

Constructors

new(exchange_id : UInt16, protocol_id : UInt16, session_id : UInt16, initiator : Bool, peer_address : Socket::IPAddress | Nil = nil, peer_node_id : DataType::NodeId | Nil = nil)
Source

Instance methods

clear_pending_message

Clear pending message (successful acknowledgment received)

Source
close

Mark exchange as closed

Source
exchange_id
Source
fail

Mark exchange as failed

Source
initiator?
Source
needs_retransmit?

Check if message needs retransmission Returns the message to retransmit, or nil if none needed

Source
peer_address
Source
peer_node_id
Source
pending_message=(message : Codec::MessageCodec::Message) : Nil

Store message for retransmission if needed

Source
protocol_id
Source
session_id
Source
state
Source
timed_out?

Check if exchange has timed out

Source
touch

Update activity timestamp

Source

Nested types