[thci] support 1.3 border router configurations (#7826)

Adding support for 1.3 style border router configurations which are
different from the 1.2 style border router configurations.  The
'device capabilities' is used to differentiate between these 2 device
types to assign them their needed configuration parameters.

Also moving restartAgentService to the proper class.
This commit is contained in:
JaneFromSilabs
2022-06-28 12:32:39 -04:00
committed by GitHub
parent ba7d5f1b94
commit 7576306553
2 changed files with 12 additions and 11 deletions
+10 -9
View File
@@ -197,7 +197,6 @@ class OpenThreadTHCI(object):
NETWORK_ATTACHMENT_TIMEOUT = 10
IsBorderRouter = False
IsBackboneRouter = False
IsHost = False
externalCommissioner = None
@@ -559,10 +558,9 @@ class OpenThreadTHCI(object):
]:
self.__setRouterSelectionJitter(1)
elif self.deviceRole in [Thread_Device_Role.BR_1, Thread_Device_Role.BR_2]:
self.IsBackboneRouter = True
self.__setRouterSelectionJitter(1)
if self.IsBackboneRouter:
if self.DeviceCapability == OT12BR_CAPBS:
# Configure default BBR dataset
self.__configBbrDataset(SeqNum=self.bbrSeqNum,
MlrTimeout=self.bbrMlrTimeout,
@@ -1072,7 +1070,10 @@ class OpenThreadTHCI(object):
# set ROUTER_DOWNGRADE_THRESHOLD
self.__setRouterDowngradeThreshold(33)
elif eRoleId in (Thread_Device_Role.BR_1, Thread_Device_Role.BR_2):
print('join as BBR')
if self.DeviceCapability == OT12BR_CAPBS:
print('join as BBR')
else:
print('join as BR')
mode = 'rdn'
if self.AutoDUTEnable is False:
# set ROUTER_DOWNGRADE_THRESHOLD
@@ -1390,9 +1391,8 @@ class OpenThreadTHCI(object):
# to default when joining network
self.hasSetChannel = False
# indicate whether the default domain prefix is used.
self.__useDefaultDomainPrefix = True
self.__useDefaultDomainPrefix = (self.DeviceCapability == OT12BR_CAPBS)
self.__isUdpOpened = False
self.IsBackboneRouter = False
self.IsHost = False
# remove stale multicast addresses
@@ -1400,9 +1400,10 @@ class OpenThreadTHCI(object):
self.stopListeningToAddrAll()
# BBR dataset
self.bbrSeqNum = random.randint(0, 126) # 5.21.4.2
self.bbrMlrTimeout = 3600
self.bbrReRegDelay = 5
if self.DeviceCapability == OT12BR_CAPBS:
self.bbrSeqNum = random.randint(0, 126) # 5.21.4.2
self.bbrMlrTimeout = 3600
self.bbrReRegDelay = 5
# initialize device configuration
self.setMAC(self.mac)
+2 -2
View File
@@ -439,7 +439,7 @@ class OpenThread_BR(OpenThreadTHCI, IThci):
if hop_limit is None:
hop_limit = 5
if self.IsHost or self.IsBackboneRouter:
if self.IsHost or self.IsBorderRouter:
ifName = 'eth0'
else:
ifName = 'wpan0'
@@ -465,7 +465,7 @@ class OpenThread_BR(OpenThreadTHCI, IThci):
"""
hop_limit = 5
if self.IsHost or self.IsBackboneRouter:
if self.IsHost or self.IsBorderRouter:
ifName = 'eth0'
else:
ifName = 'wpan0'