mirror of
https://github.com/espressif/openthread.git
synced 2026-08-03 01:17:46 +00:00
[netdata] new API to get lowpan context IDs (#8870)
This commit adds `otNetDataGetNextLowpanContextInfo()` to iterate through the list of LoWPAN Context entries in Thread Network Data providing info about the prefix, its LoWPAN Context ID and Compress flag (relating to `ContextTlv` sub-TLVs of `PrefixTlv`s in Network Data). This commit also updates CLI command `netdata show` to list the context IDs in addition to prefixes, routes, and services.
This commit is contained in:
@@ -2300,6 +2300,8 @@ class NodeImpl:
|
||||
for line in netdata:
|
||||
if line.startswith('Services:'):
|
||||
services_section = True
|
||||
elif line.startswith('Contexts'):
|
||||
services_section = False
|
||||
elif services_section:
|
||||
services.append(line.strip().split(' '))
|
||||
return services
|
||||
@@ -2310,8 +2312,8 @@ class NodeImpl:
|
||||
|
||||
def get_netdata(self):
|
||||
raw_netdata = self.netdata_show()
|
||||
netdata = {'Prefixes': [], 'Routes': [], 'Services': []}
|
||||
key_list = ['Prefixes', 'Routes', 'Services']
|
||||
netdata = {'Prefixes': [], 'Routes': [], 'Services': [], 'Contexts': []}
|
||||
key_list = ['Prefixes', 'Routes', 'Services', 'Contexts']
|
||||
key = None
|
||||
|
||||
for i in range(0, len(raw_netdata)):
|
||||
|
||||
Reference in New Issue
Block a user