openthread_sys

Function otChannelMonitorGetChannelOccupancy

Source
pub unsafe extern "C" fn otChannelMonitorGetChannelOccupancy(
    aInstance: *mut otInstance,
    aChannel: u8,
) -> u16
Expand description

Gets the current channel occupancy for a given channel.

The channel occupancy value represents the average rate/percentage of RSSI samples that were above RSSI threshold (“bad” RSSI samples).

For the first “sample window” samples, the average is maintained as the actual percentage (i.e., ratio of number of “bad” samples by total number of samples). After “window” samples, the averager uses an exponentially weighted moving average. Practically, this means the average is representative of up to 3 * window last samples with highest weight given to the latest kSampleWindow samples.

Max value of 0xffff indicates all RSSI samples were above RSSI threshold (i.e. 100% of samples were “bad”).

@param[in] aInstance A pointer to an OpenThread instance. @param[in] aChannel The channel for which to get the link occupancy.

@returns The current channel occupancy for the given channel.