mirror of
https://github.com/espressif/openthread.git
synced 2026-10-02 13:57:38 +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)
|
* [start](#start)
|
||||||
* [state](#state)
|
* [state](#state)
|
||||||
* [stop](#stop)
|
* [stop](#stop)
|
||||||
|
* [version](#version)
|
||||||
* [whitelist](#whitelist)
|
* [whitelist](#whitelist)
|
||||||
|
|
||||||
## OpenThread Command Details
|
## OpenThread Command Details
|
||||||
@@ -558,6 +559,16 @@ Disable OpenThread.
|
|||||||
Done
|
Done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
Print the build version information.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
> version
|
||||||
|
OPENTHREAD/gf4f2f04; Jul 1 2016 17:00:09
|
||||||
|
Done
|
||||||
|
```
|
||||||
|
|
||||||
### whitelist
|
### whitelist
|
||||||
|
|
||||||
List the whitelist entries.
|
List the whitelist entries.
|
||||||
|
|||||||
@@ -36,6 +36,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <openthread.h>
|
#include <openthread.h>
|
||||||
|
#include <openthread-config.h>
|
||||||
|
|
||||||
#include "cli.hpp"
|
#include "cli.hpp"
|
||||||
#include <common/encoding.hpp>
|
#include <common/encoding.hpp>
|
||||||
@@ -79,6 +80,7 @@ const struct Command Interpreter::sCommands[] =
|
|||||||
{ "start", &ProcessStart },
|
{ "start", &ProcessStart },
|
||||||
{ "state", &ProcessState },
|
{ "state", &ProcessState },
|
||||||
{ "stop", &ProcessStop },
|
{ "stop", &ProcessStop },
|
||||||
|
{ "version", &ProcessVersion },
|
||||||
{ "whitelist", &ProcessWhitelist },
|
{ "whitelist", &ProcessWhitelist },
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1267,6 +1269,12 @@ exit:
|
|||||||
AppendResult(error);
|
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[])
|
void Interpreter::ProcessWhitelist(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
ThreadError error = kThreadError_None;
|
ThreadError error = kThreadError_None;
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ private:
|
|||||||
static void ProcessStart(int argc, char *argv[]);
|
static void ProcessStart(int argc, char *argv[]);
|
||||||
static void ProcessState(int argc, char *argv[]);
|
static void ProcessState(int argc, char *argv[]);
|
||||||
static void ProcessStop(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 ProcessWhitelist(int argc, char *argv[]);
|
||||||
|
|
||||||
static void HandleEchoResponse(void *aContext, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
static void HandleEchoResponse(void *aContext, Message &aMessage, const Ip6::MessageInfo &aMessageInfo);
|
||||||
|
|||||||
Reference in New Issue
Block a user