mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 19:27:46 +00:00
[thread-cert] set node addr64 to EXTENDED_ADDRESS_BASE + nodeid (#5601)
This commit sets nodes' extaddrs to 0x166e0a0000000000 + nodeid, which does not change node behavior but makes it easier for us to analyze pcaps.
This commit is contained in:
@@ -45,6 +45,7 @@ import pexpect.popen_spawn
|
||||
|
||||
import config
|
||||
import simulator
|
||||
import thread_cert
|
||||
|
||||
PORT_OFFSET = int(os.getenv('PORT_OFFSET', "0"))
|
||||
|
||||
@@ -412,6 +413,7 @@ class NodeImpl:
|
||||
super().__init__(nodeid, **kwargs)
|
||||
|
||||
self.set_extpanid(config.EXTENDED_PANID)
|
||||
self.set_addr64('%016x' % (thread_cert.EXTENDED_ADDRESS_BASE + nodeid))
|
||||
|
||||
def _expect(self, pattern, timeout=-1, *args, **kwargs):
|
||||
""" Process simulator events until expected the pattern. """
|
||||
@@ -831,7 +833,10 @@ class NodeImpl:
|
||||
self.send_command('extaddr')
|
||||
return self._expect_result('[0-9a-fA-F]{16}')
|
||||
|
||||
def set_addr64(self, addr64):
|
||||
def set_addr64(self, addr64: str):
|
||||
# Make sure `addr64` is a hex string of length 16
|
||||
assert len(addr64) == 16
|
||||
int(addr64, 16)
|
||||
self.send_command('extaddr %s' % addr64)
|
||||
self._expect('Done')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user