diff --git a/tools/harness-thci/Makefile.am b/tools/harness-thci/Makefile.am index a11068adc..a9ad21eb4 100644 --- a/tools/harness-thci/Makefile.am +++ b/tools/harness-thci/Makefile.am @@ -29,7 +29,7 @@ include $(abs_top_nlbuild_autotools_dir)/automake/pre.am EXTRA_DIST = \ - ARM.py \ + OpenThread.py \ README.md \ $(NULL) diff --git a/tools/harness-thci/ARM.py b/tools/harness-thci/OpenThread.py similarity index 99% rename from tools/harness-thci/ARM.py rename to tools/harness-thci/OpenThread.py index 4f053f897..9fa8842e1 100644 --- a/tools/harness-thci/ARM.py +++ b/tools/harness-thci/OpenThread.py @@ -28,8 +28,8 @@ ''' >> Thread Host Controller Interface ->> Device : ARM THCI ->> Class : ARM +>> Device : OpenThread THCI +>> Class : OpenThread ''' import re @@ -48,8 +48,8 @@ from Queue import Queue linesepx = re.compile(r'\r\n|\n') """regex: used to split lines""" -class ARM(IThci): - firmware = 'Nov 4 2016 07:24:59' # keep the consistency with ARM firmware style +class OpenThread(IThci): + firmware = 'g7d33184; CC2538; Dec 1 2016 15:43:40' UIStatusMsg = '' networkDataRequirement = '' # indicate Thread device requests full or stable network data isPowerDown = False # indicate if Thread device experiences a power down event @@ -1237,7 +1237,6 @@ class ARM(IThci): self.isWhiteListEnabled = False self.isBlackListEnabled = False self.isActiveCommissioner = False - self.firmware = 'Nov 4 2016 07:24:59' except Exception, e: ModuleHelper.WriteIntoDebugLogger("setDefaultValue() Error: " + str(e)) @@ -2410,7 +2409,7 @@ class ARM(IThci): if xChannelTlv != None: cmd += ' binary ' - cmd += '000300' + hex(xChannelTlv).lstrip('0x').zfill(4) + cmd += '000300' + hex(xChannelTlv).lstrip('0x').zfill(4) print cmd @@ -2501,3 +2500,6 @@ class ARM(IThci): print '%s call setRouterThresholdValues' % self.port self.__setRouterUpgradeThreshold(upgradeThreshold) self.__setRouterDowngradeThreshold(downgradeThreshold) + + def setMinDelayTimer(self, iSeconds): + print '%s call setMinDelayTimer' % self.port diff --git a/tools/harness-thci/README.md b/tools/harness-thci/README.md index 59d9fab6f..c375bb702 100644 --- a/tools/harness-thci/README.md +++ b/tools/harness-thci/README.md @@ -4,64 +4,17 @@ OpenThread THCI OpenThread THCI(Thread Host Controller Interface) is implemented according to the python abstract class template-"IThci" that is provided by GRL. It's intented to be called by Thread Test Harness Software to control the reference -unit behavior. - -## Restriction ## - -Currently Test Harness Software only supports three kinds of reference unit -officially: ARM, NXP(Freescale) and SiLabs. We make OpenThread THCI be able -to interact with Test Harness Software with the aid of the official THCI class -name of our partner ARM. And we are using TI CC2538DK as a target hardware platform -for reference unit. - -OpenThread THCI works along with Thread Test Harness Software on Windows OS. +device behavior. ## Environment Setup ## -1. install or update essential modules `pexpect` and `pexpect_serial` with pip command. - current `pexpect_serial` module version is 0.4.4; `pexpect` module version is 4.1.0 +1. Copy the "OpenThread.py" to /GRL/Thread1.1/Thread_Harness/THCI folder. - * pip install pexpect +2. Connect DUT(Device Under Test), sniffer and CC2538DK(or hardware running OpenThread) as reference device to Host PC. - * pip install pexpect_serial +3. Launch Thread Test Harness Software and modify the default configuration if needed then click "Start". - If there is already `pexpect` and `pexpect_serial` installed, just need to upgrade them. +4. Drag OpenThread: TI CC2538DK reference device to Test Bed list with desired number. - * pip install pexpect --upgrade - - * pip install pexpect_serial --upgrade - - If there is no 'pip' command installed before, please follow the below instructions to install 'pip' on - Windows OS first. - - 1). Download the pip python source code from "https://pypi.python.org/pypi/pip#downloads" - - 2). Unzip the source package and go to the pip directory then install. - - * python setup.py install - - 3). Add "pip" executable file path in the Environment Variables. - - * add "C\:Python27\Scripts" to environment variable "Path". - -2. Copy the new installed or upgraded `pexpect` and `pexpect_serial` packages to Harness' Python27 directory. - - * copy C:\Python27\Lib\site-packages\pexpect C:\GRL\Thread1.1\Python27\Lib\site-packages\ - - * copy C:\Python27\Lib\site-packages\pexpect-4.1.0.dist-info C:\GRL\Thread1.1\Python27\Lib\site-packages\ - - * copy C:\Python27\Lib\site-packages\pexpect_serial C:\GRL\Thread1.1\Python27\Lib\site-packages\ - - * copy C:\Python27\Lib\site-packages\pexpect_serial-0.4.4-py2.7.egg-info C:\GRL\Thread1.1\Python27\Lib\site-packages\ - -3. Replace the origin "ARM.py" in Harness THCI directory with OpenThread THCI python script in /tools/harness-thci - (the same name "ARM.py"). - -4. Connect sniffer and CC2538DK as reference unit to Host PC. - -5. Launch Thread Test Harness Software and modify the default configuration if needed then click "Start". - -6. Drag ARM:NXP FRDM-K64F with FireFly 6LoWPAN SHIELD reference unit to Test Bed list with desired number. - -7. Select one or multiple test cases to execute. +5. Select one or multiple test cases to execute.