mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 10:49:51 +00:00
[otci] address small reliability issues (#7372)
This commit addresses several small reliability issues revealed during testing.
This commit is contained in:
@@ -159,7 +159,7 @@ class OtCliSerial(OtCliHandler):
|
||||
line = self.__linebuffer + line
|
||||
self.__linebuffer = b''
|
||||
|
||||
return line.decode('utf-8').rstrip('\r\n')
|
||||
return line.decode('utf-8', errors='ignore').rstrip('\r\n')
|
||||
|
||||
return None
|
||||
|
||||
|
||||
@@ -47,7 +47,9 @@ class OTCI(object):
|
||||
manipulate an OpenThread device.
|
||||
"""
|
||||
|
||||
__exec_command_retry = 0
|
||||
DEFAULT_EXEC_COMMAND_RETRY = 4 # A command is retried 4 times if failed.
|
||||
|
||||
__exec_command_retry = DEFAULT_EXEC_COMMAND_RETRY
|
||||
|
||||
def __init__(self, otcmd: OTCommandHandler):
|
||||
"""
|
||||
@@ -278,7 +280,12 @@ class OTCI(object):
|
||||
for line in output[2:]:
|
||||
fields = line.strip().split('|')
|
||||
|
||||
_, J, netname, extpanid, panid, extaddr, ch, dbm, lqi, _ = fields
|
||||
try:
|
||||
_, J, netname, extpanid, panid, extaddr, ch, dbm, lqi, _ = fields
|
||||
except Exception:
|
||||
logging.warning('ignored output: %r', line)
|
||||
continue
|
||||
|
||||
networks.append({
|
||||
'joinable': bool(int(J)),
|
||||
'network_name': netname.strip(),
|
||||
|
||||
Reference in New Issue
Block a user