Add 'factoryreset' cli (#892)

* add 'factoryreset' cli to delete all stored settings and then reset

* use 'factoryreset' in THCI reset API to ensure that there is no pre-settings in DUT before running any test
This commit is contained in:
Shu Chen
2016-10-27 11:08:39 -07:00
committed by Jonathan Hui
parent f0a5239a59
commit f3ebcff818
6 changed files with 34 additions and 6 deletions
+4 -6
View File
@@ -1103,7 +1103,9 @@ class ARM(IThci):
"""power down the Thread device"""
print '%s call powerDown' % self.port
self.isPowerDown = True
self.reset()
self._sendline('reset')
time.sleep(3)
self.setMAC(self.mac)
def powerUp(self):
"""power up the Thread device"""
@@ -1225,7 +1227,7 @@ class ARM(IThci):
"""factory reset"""
print '%s call reset' % self.port
try:
self._sendline('reset')
self._sendline('factoryreset')
self._read()
except Exception, e:
ModuleHelper.WriteIntoDebugLogger("reset() Error: " + str(e))
@@ -2211,10 +2213,6 @@ class ARM(IThci):
cmd += ' panid '
cmd += str(xPanId)
if xDelayTimer != None:
cmd += ' delay '
cmd += str(xDelayTimer)
if listChannelMask != None:
cmd += ' channelmask '
cmd += str(hex(1 << listChannelMask[1]))