mirror of
https://github.com/espressif/openthread.git
synced 2026-08-12 05:37:46 +00:00
[cert] THCI: enhance firmware validation (#2797)
This commit is contained in:
@@ -53,6 +53,10 @@ class OpenThread(IThci):
|
||||
LOWEST_POSSIBLE_PARTATION_ID = 0x1
|
||||
LINK_QUALITY_CHANGE_TIME = 100
|
||||
|
||||
# Used for reference firmware version control for Test Harness.
|
||||
# This variable will be updated to match the OpenThread reference firmware officially released.
|
||||
firmwarePrefix = "OPENTHREAD/201806"
|
||||
|
||||
#def __init__(self, SerialPort=COMPortName, EUI=MAC_Address):
|
||||
def __init__(self, **kwargs):
|
||||
"""initialize the serial port and default network parameters
|
||||
@@ -647,9 +651,17 @@ class OpenThread(IThci):
|
||||
"""initialize the serial port with baudrate, timeout parameters"""
|
||||
print '%s call intialize' % self.port
|
||||
try:
|
||||
self.deviceConnected = False
|
||||
|
||||
# init serial port
|
||||
self._connect()
|
||||
self.deviceConnected = True
|
||||
|
||||
if self.firmwarePrefix in self.UIStatusMsg:
|
||||
self.deviceConnected = True
|
||||
else:
|
||||
self.UIStatusMsg = "Firmware Not Matching Expecting " + self.firmwarePrefix + " Now is " + self.UIStatusMsg
|
||||
ModuleHelper.WriteIntoDebugLogger("Err: OpenThread device Firmware not matching..")
|
||||
|
||||
except Exception, e:
|
||||
ModuleHelper.WriteIntoDebugLogger("intialize() Error: " + str(e))
|
||||
self.deviceConnected = False
|
||||
|
||||
Reference in New Issue
Block a user