mirror of
https://github.com/espressif/openthread.git
synced 2026-08-14 14:47:46 +00:00
[trel] small updates and adding trel test (#7205)
- Adds platform API `trelDnssdInitialize` to initialize TREL DNS-SD module. - Adds `test_trel_connectivity.py` test. - Fixed `Border Router` TREL test to really use TREL.
This commit is contained in:
@@ -125,6 +125,8 @@ class OtbrDocker:
|
||||
config.OTBR_DOCKER_IMAGE,
|
||||
'-B',
|
||||
config.BACKBONE_IFNAME,
|
||||
'--trel-url',
|
||||
f'trel://{config.BACKBONE_IFNAME}',
|
||||
],
|
||||
stdin=subprocess.DEVNULL,
|
||||
stdout=sys.stdout,
|
||||
@@ -1145,6 +1147,21 @@ class NodeImpl:
|
||||
self.send_command(cmd)
|
||||
return int(self._expect_result('\d+'))
|
||||
|
||||
#
|
||||
# TREL utilities
|
||||
#
|
||||
|
||||
def get_trel_state(self) -> Union[None, bool]:
|
||||
states = [r'Disabled', r'Enabled']
|
||||
self.send_command('trel')
|
||||
try:
|
||||
return self._expect_result(states) == 'Enabled'
|
||||
except Exception as ex:
|
||||
if 'InvalidCommand' in str(ex):
|
||||
return None
|
||||
|
||||
raise
|
||||
|
||||
def _encode_txt_entry(self, entry):
|
||||
"""Encodes the TXT entry to the DNS-SD TXT record format as a HEX string.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user