ILibrary
;ICotaskConstructor
using getCotaskConstructor
;TargetNode
define its parent ParentNode
using Antilatency.DeviceNetwork.INetwork.nodeGetParent
;TargetNode
using ICotask.getMetrics
. The optimal interval is 100-500 ms.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.ICotask.getMetrics
and ICotask.getExtendedMetrics
methods will throw an exception when you use a targetNode
that is not currently connected to the ParentNode.}
Metrics
contains only two values by which you can access the current quality of the radio connection, and it’s enough in most cases:averageRssi
(in dBm) shows the approximate distance between devices.packetLossRate
shows the noise level of the radio channel. It has a value in the range of 0..1
, where 0
is no loss at all (perfect connection).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.