mirror of
https://github.com/espressif/openthread.git
synced 2026-08-24 03:09:52 +00:00
[low-power] implement forward tracking series (#5608)
This commit implements the Forward Tracking Series feature in Link Metrics.
- Two new apis are added:
- otLinkMetricsSendMgmtRequestForwardTrackingSeries, which is used
to send an MLE Link Metrics Management Request
- otLinkMetricsSendLinkProbe, which is used to send an MLE Link Probe
- A new class LinkMetricsSeriesInfo is used to maintain the data of
one Series configured by a neighbor. This class inherits
LinkedListEntry and each Neighbor has a list of
LinkMetricsSeriesInfo. All LinkedListEntrys are allocated and freed
by a Pool in LinkMetrics.
- To specify SeriesFlags in cli command for Forward Tracking Series, a
similar approach with LinkMetricsFlags is used. Another character
flags is used to represent SeriesFlags.
- Whenever the node receives a frame (including ACK) from a neighbor,
it would call Neighbor::AggregateLinkMetrics which goes through each
LinkMetricsSeriesInfo entry in the neighbor's list and aggregate the
data if the frame type matches the entry.
- Two test scripts are added to test this function:
- v1_2_LowPower_7_2_01_ForwardTrackingSeries.py
- v1_2_LowPower_test_forward_tracking_series.py
This commit is contained in:
@@ -58,6 +58,9 @@ class CommandType(IntEnum):
|
||||
ANNOUNCE = 15
|
||||
DISCOVERY_REQUEST = 16
|
||||
DISCOVERY_RESPONSE = 17
|
||||
LINK_METRICS_MANAGEMENT_REQUEST = 18
|
||||
LINK_METRICS_MANAGEMENT_RESPONSE = 19
|
||||
LINK_PROBE = 20
|
||||
TIME_SYNC = 99
|
||||
|
||||
|
||||
@@ -90,11 +93,22 @@ class TlvType(IntEnum):
|
||||
CSL_CHANNEL = 80
|
||||
CSL_SYNCHRONIZED_TIMEOUT = 85
|
||||
LINK_METRICS_QUERY = 87
|
||||
LINK_METRICS_MANAGEMENT = 88
|
||||
LINK_METRICS_REPORT = 89
|
||||
LINK_PROBE = 90
|
||||
TIME_REQUEST = 252
|
||||
TIME_PARAMETER = 253
|
||||
|
||||
|
||||
class LinkMetricsSubTlvType(IntEnum):
|
||||
LINK_METRICS_REPORT = 0
|
||||
LINK_METRICS_QUERY_ID = 1
|
||||
LINK_METRICS_QUERY_OPTIONS = 2
|
||||
FORWARD_PROBING_REGISTRATION = 3
|
||||
LINK_METRICS_STATUS = 5
|
||||
ENHANCED_ACK_LINK_METRICS_CONFIGURATION = 7
|
||||
|
||||
|
||||
class SourceAddress(object):
|
||||
|
||||
def __init__(self, address):
|
||||
@@ -1117,6 +1131,19 @@ class LinkMetricsQueryFactory:
|
||||
return LinkMetricsQuery()
|
||||
|
||||
|
||||
class LinkMetricsManagement:
|
||||
# TODO: Not implemented yet
|
||||
|
||||
def __init__(self):
|
||||
print("LinkMetricsManagement is not implemented yet.")
|
||||
|
||||
|
||||
class LinkMetricsManagementFactory:
|
||||
|
||||
def parse(self, data, message_info):
|
||||
return LinkMetricsManagement()
|
||||
|
||||
|
||||
class LinkMetricsReport:
|
||||
# TODO: Not implemented yet
|
||||
|
||||
@@ -1130,6 +1157,19 @@ class LinkMetricsReportFactory:
|
||||
return LinkMetricsReport()
|
||||
|
||||
|
||||
class LinkProbe:
|
||||
# TODO: Not implemented yet
|
||||
|
||||
def __init__(self):
|
||||
print("LinkProbe is not implemented yet.")
|
||||
|
||||
|
||||
class LinkProbeFactory:
|
||||
|
||||
def parse(self, data, message_info):
|
||||
return LinkProbe()
|
||||
|
||||
|
||||
class MleCommand(object):
|
||||
|
||||
def __init__(self, _type, tlvs):
|
||||
|
||||
Reference in New Issue
Block a user