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
+8
View File
@@ -21,6 +21,7 @@ OpenThread test scripts use the CLI to execute test cases.
* [eui64](#eui64)
* [extaddr](#extaddr)
* [extpanid](#extpanid)
* [factoryreset](#factoryreset)
* [hashmacaddr](#hashmacaddr)
* [ifconfig](#ifconfig)
* [ipaddr](#ipaddr)
@@ -711,6 +712,13 @@ Set the Thread Extended PAN ID value.
Done
```
### factoryreset
Delete all stored settings, and signal a platform reset.
```bash
> factoryreset
```
### hashmacaddr
Get the HashMac address.
+8
View File
@@ -87,6 +87,7 @@ const struct Command Interpreter::sCommands[] =
#endif
{ "extaddr", &Interpreter::ProcessExtAddress },
{ "extpanid", &Interpreter::ProcessExtPanId },
{ "factoryreset", &Interpreter::ProcessFactoryReset },
{ "hashmacaddr", &Interpreter::ProcessHashMacAddress },
{ "ifconfig", &Interpreter::ProcessIfconfig },
{ "ipaddr", &Interpreter::ProcessIpAddr },
@@ -650,6 +651,13 @@ exit:
AppendResult(error);
}
void Interpreter::ProcessFactoryReset(int argc, char *argv[])
{
otFactoryReset(mInstance);
(void)argc;
(void)argv;
}
void Interpreter::ProcessHashMacAddress(int argc, char *argv[])
{
ThreadError error = kThreadError_None;
+1
View File
@@ -160,6 +160,7 @@ private:
#endif
void ProcessExtAddress(int argc, char *argv[]);
void ProcessExtPanId(int argc, char *argv[]);
void ProcessFactoryReset(int argc, char *argv[]);
void ProcessHashMacAddress(int argc, char *argv[]);
void ProcessIfconfig(int argc, char *argv[]);
void ProcessIpAddr(int argc, char *argv[]);