/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { SessionParameters } from "#session/SessionParameters.js"; import { ChannelType, Duration } from "@matter/general"; export declare namespace MRP { /** * Additive retransmission margins for a network, by traffic class. Bulk transfer sustains many round trips over * the same path, so it tolerates — and on a constrained medium needs — a different margin than normal messaging. */ interface Margins { messaging: Duration; bdx: Duration; } /** Selects the margin a protocol's traffic belongs to. */ function marginFor(margins: Margins | undefined, protocolId: number): Duration | undefined; /** * The maximum number of transmission attempts for a given reliable message. The sender MAY choose this value as it * sees fit. */ const MAX_TRANSMISSIONS = 5; /** The base number for the exponential backoff equation. */ const BACKOFF_BASE = 1.6; /** The scaler for random jitter in the backoff equation. */ const BACKOFF_JITTER = 0.25; /** The scaler margin increase to backoff over the applicable (active/idle) interval. */ const BACKOFF_MARGIN = 1.1; /** The number of retransmissions before transitioning from linear to exponential backoff. */ const BACKOFF_THRESHOLD = 1; /** @see {@link MatterSpecification.v161.Core}, section 4.12.8 */ const STANDALONE_ACK_TIMEOUT: Duration; /** * Default expected processing time for a messages in milliseconds. The value is derived from kExpectedIMProcessingTime * from chip implementation. This is basically the default used with different names, also kExpectedLowProcessingTime or * kExpectedSigma1ProcessingTime. */ const DEFAULT_EXPECTED_PROCESSING_TIME: Duration; interface ResponseTimeInputs { /** * When local session parameters are missing we only calculate the expected maximum time from the device back to us */ peerSessionParameters?: SessionParameters; localSessionParameters: SessionParameters; channelType: ChannelType; isPeerActive: boolean; usesMrp?: boolean; expectedProcessingTime?: Duration; /** Our own sender-side backoff additions, applied to the local (our-retransmissions) direction only. */ localAdditionalDelay?: Duration; localFixedBackoff?: Duration; } function maxPeerResponseTimeOf({ peerSessionParameters, localSessionParameters, channelType, isPeerActive, usesMrp, expectedProcessingTime, localAdditionalDelay, localFixedBackoff, }: ResponseTimeInputs): Duration; interface RetryDelayInputs { transmissionNumber: number; sessionParameters: SessionParameters; isPeerActive: boolean; /** * Additive margin applied to the base interval. Supplied by the caller from the combined peer/own * network-profile policy; 0 means the bare spec interval. Because it joins the base interval, it is amplified * by the exponential backoff factor. */ additionalDelay?: Duration; /** * Fixed sender-side pad added to the final backoff after margin, exponent and jitter — so it is *not* * amplified. Used for an ICD sender's fast-polling interval grace (CHIP * {@link ReliableMessageMgr::GetBackoff}); 0 means no pad. */ fixedBackoff?: Duration; } /** * Calculates the maximum backoff time for a resubmission based on the current retransmission count. * Maximum means we calculate the maximum time without any randomness. */ function maxRetransmissionIntervalOf(inputs: RetryDelayInputs): Duration; /** * Calculates the backoff time for a resubmission based on the current retransmission count. * If no session parameters are provided, the parameters of the current session are used. * If session parameters are provided, the method can be used to calculate the maximum backoff time for the other * side of the exchange. * * When `calculateMaximum` is set to true, we calculate the maximum time without any randomness. * `additionalDelay` (default 0) joins the base interval (so it is amplified) and `fixedBackoff` (default 0) is * added to the final backoff (so it is not); both apply to the maximum as well so it upper-bounds the real send. * * @see {@link MatterSpecification.v161.Core}, section 4.12.2.1 */ function retransmissionIntervalOf({ transmissionNumber, sessionParameters, isPeerActive, additionalDelay, fixedBackoff, }: RetryDelayInputs, calculateMaximum?: boolean): Duration; } //# sourceMappingURL=MRP.d.ts.map