Init()
Initializes the `LinkQualityInfo` object.
Clear()
Clears the all the data in the object.
Clears the average RSS value.
Adds a new received signal strength (RSS) value to the average.
Returns the current average received signal strength value.
Returns an encoded version of current average signal strength value. The encoded value is the average multiplied by a precision factor (currently -8).
ToInfoString() const
Converts the link quality info to info/debug human-readable string.
GetLinkMargin() const
Returns the link margin. The link margin is calculated using the link's current average received signal strength (RSS) and average noise floor.
GetLinkQuality() const
Returns the current one-way link quality value. The link quality value is a number 0-3. The link quality is calculated by comparing the current link margin with a set of thresholds (per Thread spec). More specifically, link margin > 20 dB gives link quality 3, link margin > 10 dB gives link quality 2, link margin > 2 dB gives link quality 1, and link margin below or equal to 2 dB yields link quality of 0. In order to ensure that a link margin near the boundary of two different link quality values does not cause frequent changes, a hysteresis of 2 dB is applied when determining the link quality. For example, the average link margin must be at least 12 dB to change a quality 1 link to a quality 2 link.
Returns the most recent RSS value.
AddFrameTxStatus()
Adds a MAC frame transmission status (success/failure) and updates the frame tx error rate.
AddMessageTxStatus()
Adds a message transmission status (success/failure) and updates the message error rate.
GetFrameErrorRate() const
Returns the MAC frame transmission error rate for the link. The rate is maintained over a window of (roughly) last `OPENTHREAD_CONFIG_FRAME_TX_ERR_RATE_AVERAGING_WINDOW` frame transmissions.
GetMessageErrorRate() const
Returns the message error rate for the link. The rate is maintained over a window of (roughly) last `OPENTHREAD_CONFIG_IPV6_TX_ERR_RATE_AVERAGING_WINDOW` (IPv6) messages. Note that a larger (IPv6) message can be fragmented and sent as multiple MAC frames. The message transmission is considered a failure, if any of its fragments fail after all MAC retry attempts.
SetLinkQuality()
CalculateLinkQuality()