From 919e902e1800caba7dc7671ed3093f643fbba418 Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Sat, 22 Oct 2016 12:52:44 +0800 Subject: [PATCH] THCI: clean up bugs found during testing and detected by pylint. (#861) --- tools/harness-thci/ARM.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/tools/harness-thci/ARM.py b/tools/harness-thci/ARM.py index be47cc6db..c1aa4ff2d 100644 --- a/tools/harness-thci/ARM.py +++ b/tools/harness-thci/ARM.py @@ -1843,7 +1843,7 @@ class ARM(IThci): print cmd if self.__sendCommand(cmd)[0] == 'Done': if self.logThreadStatus == self.logStatus['stop']: - self.logThread = ThreadRunner.run(target = self.__readCommissioningLogs, args = (120,)) + self.logThread = ThreadRunner.run(target=self.__readCommissioningLogs, args=(120,)) return True else: return False @@ -2105,17 +2105,11 @@ class ARM(IThci): if listChannelMask != None: cmd += ' channelmask ' - print listChannelMask - entry = self.__convertLongToString(self.__convertChannelMask(listChannelMask)) + cmd += str(hex(1 << listChannelMask[1])) - if len(entry) < 8: - entry = entry.zfill(8) - - cmd += '0x' + entry - - if sPSKc != None or listSecurityPolicy != None \ - xCommissioningSessionId != None or xTmfPort != None or xSteeringData != None or xBorderRouterLocator != None or \ - BogusTLV != None: + if sPSKc != None or listSecurityPolicy != None or \ + xCommissioningSessionId != None or xTmfPort != None or xSteeringData != None or xBorderRouterLocator != None or \ + BogusTLV != None: cmd += ' binary ' if sPSKc != None: @@ -2330,6 +2324,7 @@ class ARM(IThci): def setPSKc(self, strPSKc): print '%s call setPSKc' % self.port + return try: cmd = 'dataset pskc %s' % strPSKc print cmd