mirror of
https://github.com/espressif/openthread.git
synced 2026-08-07 11:17:46 +00:00
[trel] add cli to get TREL UDP port (#10702)
The test software for certification currently uses the mDNS packets of trel service responses to find out the trel port, and then use the port number to determine which packets in a capture should be decoded as TREL packets. However this may not be reliable since it depends on when the capture starts. Added a cli to get trel port, so this can be used by a THCI function.
This commit is contained in:
@@ -160,6 +160,8 @@ class TestTrelConnectivity(thread_cert.TestCase):
|
||||
self.assertTrue(counters['Outbound']['bytes'] == 0)
|
||||
self.assertTrue(counters['Outbound']['failures'] == 0)
|
||||
|
||||
self.assertGreater(br1.get_trel_port(), 0)
|
||||
|
||||
def verify(self, pv: PacketVerifier):
|
||||
pkts: PacketFilter = pv.pkts
|
||||
BR1_RLOC16 = pv.vars['BR1_RLOC16']
|
||||
|
||||
@@ -1451,6 +1451,11 @@ class NodeImpl:
|
||||
self.send_command(cmd)
|
||||
self._expect_done()
|
||||
|
||||
def get_trel_port(self):
|
||||
cmd = 'trel port'
|
||||
self.send_command(cmd)
|
||||
return int(self._expect_command_output()[0])
|
||||
|
||||
def set_epskc(self, keystring: str, timeout=120000, port=0):
|
||||
cmd = 'ba ephemeralkey set ' + keystring + ' ' + str(timeout) + ' ' + str(port)
|
||||
self.send_command(cmd)
|
||||
|
||||
Reference in New Issue
Block a user