mirror of
https://github.com/espressif/openthread.git
synced 2026-06-06 05:24:51 +00:00
[tests] initialize mesh-local prefix instead of extended pan id (#7668)
This commit is contained in:
@@ -45,7 +45,6 @@ import sniffer
|
||||
from tlvs_parsing import SubTlvsFactory
|
||||
|
||||
# This extended address will generate the MESH_LOCAL_PREFIX
|
||||
EXTENDED_PANID = '000db80000000000'
|
||||
MESH_LOCAL_PREFIX = 'fd00:db8::/64'
|
||||
MESH_LOCAL_PREFIX_REGEX_PATTERN = '^fd00:0?db8:0{0,4}:0{0,4}'
|
||||
ROUTING_LOCATOR = '64/:0:ff:fe00:/16'
|
||||
|
||||
@@ -614,7 +614,7 @@ class NodeImpl:
|
||||
|
||||
super().__init__(nodeid, **kwargs)
|
||||
|
||||
self.set_extpanid(config.EXTENDED_PANID)
|
||||
self.set_mesh_local_prefix(config.MESH_LOCAL_PREFIX)
|
||||
self.set_addr64('%016x' % (thread_cert.EXTENDED_ADDRESS_BASE + nodeid))
|
||||
|
||||
def _expect(self, pattern, timeout=-1, *args, **kwargs):
|
||||
@@ -1417,6 +1417,14 @@ class NodeImpl:
|
||||
self.send_command('extpanid')
|
||||
return self._expect_result('[0-9a-fA-F]{16}')
|
||||
|
||||
def get_mesh_local_prefix(self):
|
||||
self.send_command('prefix meshlocal')
|
||||
return self._expect_command_output()[0]
|
||||
|
||||
def set_mesh_local_prefix(self, mesh_local_prefix):
|
||||
self.send_command('prefix meshlocal %s' % mesh_local_prefix)
|
||||
self._expect_done()
|
||||
|
||||
def get_joiner_id(self):
|
||||
self.send_command('joiner id')
|
||||
return self._expect_result('[0-9a-fA-F]{16}')
|
||||
|
||||
Reference in New Issue
Block a user