circuitmatter.exchange

Attributes

MRP_MAX_TRANSMISSIONS

The maximum number of transmission attempts for a given reliable message. The sender MAY choose

MRP_BACKOFF_BASE

The base number for the exponential backoff equation.

MRP_BACKOFF_JITTER

The scaler for random jitter in the backoff equation.

MRP_BACKOFF_MARGIN

The scaler margin increase to backoff over the peer idle interval.

MRP_BACKOFF_THRESHOLD

The number of retransmissions before transitioning from linear to exponential backoff.

MRP_STANDALONE_ACK_TIMEOUT_MS

Amount of time to wait for an opportunity to piggyback an acknowledgement on an outbound message

Classes

Exchange

Module Contents

circuitmatter.exchange.MRP_MAX_TRANSMISSIONS = 5

The maximum number of transmission attempts for a given reliable message. The sender MAY choose this value as it sees fit.

circuitmatter.exchange.MRP_BACKOFF_BASE = 1.6

The base number for the exponential backoff equation.

circuitmatter.exchange.MRP_BACKOFF_JITTER = 0.25

The scaler for random jitter in the backoff equation.

circuitmatter.exchange.MRP_BACKOFF_MARGIN = 1.1

The scaler margin increase to backoff over the peer idle interval.

circuitmatter.exchange.MRP_BACKOFF_THRESHOLD = 1

The number of retransmissions before transitioning from linear to exponential backoff.

circuitmatter.exchange.MRP_STANDALONE_ACK_TIMEOUT_MS = 200

Amount of time to wait for an opportunity to piggyback an acknowledgement on an outbound message before falling back to sending a standalone acknowledgement.

class circuitmatter.exchange.Exchange(session, protocols, initiator: bool = True, exchange_id: int = -1)
initiator
exchange_id
protocols
session
pending_acknowledgement = None

Message number that is waiting for an ack from us

send_standalone_time = None
retry_count = 0
next_retransmission_time = None

When to next resend the message that hasn’t been acked

pending_retransmission = None

Message that we’ve attempted to send but hasn’t been acked

pending_payloads = []
send(application_payload=None, protocol_id=None, protocol_opcode=None, reliable=True)
send_pending(ignore_time=False) bool
send_standalone()
queue(payload)
receive(message) bool

Process the message and return if the packet should be dropped.

close()
resend_pending()