Antilatency Radio Metrics Library

Antilatency Radio Metrics Library

A library for assessing the quality of wireless connections between the devices that use the Antilatency Radio Protocol.

Library’s functions

This library allows obtaining current radio metrics that reflect the quality of a connection between a client and an access point. For example, the signal strength (RSSI) and the rate of lost radio packets.

How to use the library

  1. Load the library;
  2. For the target client TargetNode define its parent ParentNode using Antilatency.DeviceNetwork.INetwork.nodeGetParent;
  3. Start the Task on the ParentNode from the previous step using startTask;
  4. Using a defined interval, make requests for statictics for the TargetNode using ICotask.getMetrics. The optimal interval is 100-500 ms.
Each ICotask.getMetrics request or ICotask.getExtendedMetrics request resets the previously accumulated statistics. Therefore, it makes no sense to use two requests at the same time.
The ICotask.getMetrics and ICotask.getExtendedMetrics methods will throw an exception when you use a targetNode that is not currently connected to the ParentNode.

Metrics

struct Metrics {
sbyte averageRssi;
float packetLossRate;
}
Metrics contains only two values ​​by which you can access the current quality of the radio connection, and it’s enough in most cases:

Extended metrics

struct ExtendedMetrics {
uint txBytes;
uint txPacketsCount;
uint rxBytes;
uint rxPacketsCount;
uint flowCount;
sbyte averageRssi;
sbyte minRssi;
sbyte maxRssi;
uint missedPacketsCount;
uint failedPacketsCount;
}
ExtendedMetrics contains many values that can be useful for debugging and diagnostics of a radio connection. For example, the number of packets and the amount of data that have been successfully received/transferred since the previous request, the average/minimum/maximum RSSI value, and the number of lost and failed packets.
A large number of packet losses can be caused by the congestion of the selected radio channel. Use the RadioScanner utility to analyze radio congestion and select a more suitable channel.