Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add methods to nRF_Connect_SDK_1_3 THCI #11674

Merged
merged 1 commit into from
Jul 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions samples/openthread/cli/harness-thci-1-3/nRF_Connect_SDK_1_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -3720,6 +3720,38 @@ def srp_add(self, dst_addr=None,service_type = '_thread-test._udp',tcp_service_t
cmd = 'srp client start %s' % dst_addr[0]
self.__executeCommand(cmd)

@API
def get_br_omr_address(self):
cmd = 'br omrprefix'
getomr = self.__executeCommand(cmd)
print(getomr)
cmd = 'ipaddr'
ipaddr = self.__executeCommand(cmd)
print(ipaddr)
result = []
for ip in ipaddr:
try:
if (ipaddress.ip_address(unicode(ip)) in ipaddress.ip_network(unicode(getomr[0]))):
result.append(ip)
except:
continue
if not result:
raise ValueError("No OMR address found for the registered OMR prefix.")
else:
return result

@API
def get_ed_omr_address(self, br_omr_prefix):
cmd = 'ipaddr'
ipaddr = self.__executeCommand(cmd)
print(ipaddr)
full_addr = []
for i in ipaddr[:-1]:
full_addr.append(ModuleHelper.GetFullIpv6Address(i.strip()))
print(full_addr)
result = (filter(lambda x: x.startswith(''.join(br_omr_prefix)), full_addr))
return result

def dns_query(self, service_type='_thread-test._udp'):
""" Send unicast DNS query

Expand Down