mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 22:07:36 +00:00
Add version command. (#237)
This commit is contained in:
@@ -35,6 +35,7 @@ OpenThread test scripts use the CLI to execute test cases.
|
||||
* [start](#start)
|
||||
* [state](#state)
|
||||
* [stop](#stop)
|
||||
* [version](#version)
|
||||
* [whitelist](#whitelist)
|
||||
|
||||
## OpenThread Command Details
|
||||
@@ -558,6 +559,16 @@ Disable OpenThread.
|
||||
Done
|
||||
```
|
||||
|
||||
### version
|
||||
|
||||
Print the build version information.
|
||||
|
||||
```bash
|
||||
> version
|
||||
OPENTHREAD/gf4f2f04; Jul 1 2016 17:00:09
|
||||
Done
|
||||
```
|
||||
|
||||
### whitelist
|
||||
|
||||
List the whitelist entries.
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <openthread.h>
|
||||
#include <openthread-config.h>
|
||||
|
||||
#include "cli.hpp"
|
||||
#include <common/encoding.hpp>
|
||||
@@ -79,6 +80,7 @@ const struct Command Interpreter::sCommands[] =
|
||||
{ "start", &ProcessStart },
|
||||
{ "state", &ProcessState },
|
||||
{ "stop", &ProcessStop },
|
||||
{ "version", &ProcessVersion },
|
||||
{ "whitelist", &ProcessWhitelist },
|
||||
};
|
||||
|
||||
@@ -1267,6 +1269,12 @@ exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessVersion(int argc, char *argv[])
|
||||
{
|
||||
sServer->OutputFormat("%s\r\n", PACKAGE_NAME "/" PACKAGE_VERSION "; " __DATE__ " " __TIME__);
|
||||
AppendResult(kThreadError_None);
|
||||
}
|
||||
|
||||
void Interpreter::ProcessWhitelist(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
@@ -123,6 +123,7 @@ private:
|
||||
static void ProcessStart(int argc, char *argv[]);
|
||||
static void ProcessState(int argc, char *argv[]);
|
||||
static void ProcessStop(int argc, char *argv[]);
|
||||
static void ProcessVersion(int argc, char *argv[]);
|
||||
static void ProcessWhitelist(int argc, char *argv[]);
|
||||
|
||||
static void HandleEchoResponse(void *aContext, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||
|
||||
Reference in New Issue
Block a user