pub struct SubscriptionPolicy {
pub max_interval_limit_s: u16,
pub preferred_max_interval_s: Option<u16>,
}Expand description
How a publisher answers a subscriber’s requested bounds.
Fields§
§max_interval_limit_s: u16SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT for this node.
An ICD raises it to its Idle Mode Duration; §2.11.2.2 says “whichever is greater”, so
it is never below MAX_INTERVAL_PUBLISHER_LIMIT_S.
preferred_max_interval_s: Option<u16>The interval this publisher would prefer, before the subscriber’s bounds are applied.
None means “honour the subscriber’s ceiling”, which is the polite default and what a
mains-powered device should do. A battery-powered one names a longer value here, and
§8.5.3.2’s MAX(limit, ceiling) upper bound is what makes that legal.
Implementations§
Source§impl SubscriptionPolicy
impl SubscriptionPolicy
Sourcepub fn max_interval(&self, floor_s: u16, ceiling_s: u16) -> u16
pub fn max_interval(&self, floor_s: u16, ceiling_s: u16) -> u16
The MaxInterval to put in the SubscribeResponse (§8.5.3.2).
This SHALL respect the following constraint: MinIntervalFloor ≤ MaxInterval ≤ MAX(SUBSCRIPTION_MAX_INTERVAL_PUBLISHER_LIMIT, MaxIntervalCeiling)
The floor wins over the ceiling when a subscriber asks for a ceiling below its own floor — which is a contradictory request, and the constraint resolves it in exactly one direction.