mirror of
https://github.com/espressif/openthread.git
synced 2026-08-31 06:19:54 +00:00
[thci] add support for Thread Version 4 (1.3) (#7806)
This commit is contained in:
@@ -75,7 +75,8 @@ OT13_VERSION = 'OPENTHREAD'
|
||||
OT11_CAPBS = DevCapb.V1_1
|
||||
OT12_CAPBS = (DevCapb.L_AIO | DevCapb.C_FFD | DevCapb.C_RFD)
|
||||
OT12BR_CAPBS = (DevCapb.C_BBR | DevCapb.C_Host | DevCapb.C_Comm)
|
||||
OT13_CAPBS = DevCapb.NotSpecified
|
||||
OT13_CAPBS = (DevCapb.C_FTD13 | DevCapb.C_MTD13)
|
||||
OT13BR_CAPBS = (DevCapb.C_BR13 | DevCapb.C_Host13)
|
||||
|
||||
ZEPHYR_PREFIX = 'ot '
|
||||
"""CLI prefix used for OpenThread commands in Zephyr systems"""
|
||||
@@ -3123,23 +3124,26 @@ class OpenThreadTHCI(object):
|
||||
|
||||
def __discoverDeviceCapability(self):
|
||||
"""Discover device capability according to version"""
|
||||
if self.IsBorderRouter:
|
||||
thver = self.__executeCommand('thread version')[0]
|
||||
if thver in ['1.3', '4'] and not self.IsBorderRouter:
|
||||
self.log("Setting capability of {}: (DevCapb.C_FTD13 | DevCapb.C_MTD13)".format(self))
|
||||
self.DeviceCapability = OT13_CAPBS
|
||||
elif thver in ['1.3', '4'] and self.IsBorderRouter:
|
||||
self.log("Setting capability of {}: (DevCapb.C_BR13 | DevCapb.C_Host13)".format(self))
|
||||
self.DeviceCapability = OT13BR_CAPBS
|
||||
elif thver in ['1.2', '3'] and not self.IsBorderRouter:
|
||||
self.log("Setting capability of {}: DevCapb.L_AIO | DevCapb.C_FFD | DevCapb.C_RFD".format(self))
|
||||
self.DeviceCapability = OT12_CAPBS
|
||||
elif thver in ['1.2', '3'] and self.IsBorderRouter:
|
||||
self.log("Setting capability of BR {}: DevCapb.C_BBR | DevCapb.C_Host | DevCapb.C_Comm".format(self))
|
||||
self.DeviceCapability = OT12BR_CAPBS
|
||||
elif thver in ['1.1', '2']:
|
||||
self.log("Setting capability of {}: DevCapb.V1_1".format(self))
|
||||
self.DeviceCapability = OT11_CAPBS
|
||||
else:
|
||||
# Get Thread stack version to distinguish device capability.
|
||||
thver = self.__executeCommand('thread version')[0]
|
||||
|
||||
if thver in ['1.2', '3']:
|
||||
self.log("Setting capability of {}: DevCapb.L_AIO | DevCapb.C_FFD | DevCapb.C_RFD".format(self))
|
||||
self.DeviceCapability = OT12_CAPBS
|
||||
elif thver in ['1.1', '2']:
|
||||
self.log("Setting capability of {}: DevCapb.V1_1".format(self))
|
||||
self.DeviceCapability = OT11_CAPBS
|
||||
else:
|
||||
self.log("Capability not specified for {}".format(self))
|
||||
self.DeviceCapability = DevCapb.NotSpecified
|
||||
assert False, thver
|
||||
self.log("Capability not specified for {}".format(self))
|
||||
self.DeviceCapability = DevCapb.NotSpecified
|
||||
assert False, thver
|
||||
|
||||
@staticmethod
|
||||
def __lstrip0x(s):
|
||||
|
||||
Reference in New Issue
Block a user