mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 22:27:47 +00:00
[tests] add traffic analysis for Cert_5_3_08 as TestPlan (#2484)
This commit adds the method set_lowpan_context to set the lowpan context of sniffer.
This commit is contained in:
committed by
Jonathan Hui
parent
092021ad45
commit
2636df1952
@@ -32,6 +32,7 @@ import sys
|
||||
import time
|
||||
import pexpect
|
||||
import re
|
||||
import ipaddress
|
||||
|
||||
import config
|
||||
|
||||
@@ -388,6 +389,17 @@ class otCli:
|
||||
|
||||
return addrs
|
||||
|
||||
def get_addr(self, prefix):
|
||||
network = ipaddress.ip_network(unicode(prefix))
|
||||
addrs = self.get_addrs()
|
||||
|
||||
for addr in addrs:
|
||||
ipv6_address = ipaddress.ip_address(addr.decode("utf-8"))
|
||||
if ipv6_address in network:
|
||||
return ipv6_address.exploded.encode('utf-8')
|
||||
|
||||
return None
|
||||
|
||||
def add_service(self, enterpriseNumber, serviceData, serverData):
|
||||
cmd = 'service add ' + enterpriseNumber + ' ' + serviceData+ ' ' + serverData
|
||||
self.send_command(cmd)
|
||||
|
||||
Reference in New Issue
Block a user