mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
[CoAP] Adding CLI commands (#1539)
* [CoAP] Adding CLI commands Adds CLI commands for a simple CoAP client and server with one resource
This commit is contained in:
committed by
Jonathan Hui
parent
6c44b0759a
commit
6a520dd63c
@@ -66,6 +66,9 @@
|
||||
#include "cli.hpp"
|
||||
#include "cli_dataset.hpp"
|
||||
#include "cli_uart.hpp"
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
#include "cli_coap.hpp"
|
||||
#endif
|
||||
|
||||
using Thread::Encoding::BigEndian::HostSwap16;
|
||||
using Thread::Encoding::BigEndian::HostSwap32;
|
||||
@@ -84,6 +87,9 @@ const struct Command Interpreter::sCommands[] =
|
||||
{ "child", &Interpreter::ProcessChild },
|
||||
{ "childmax", &Interpreter::ProcessChildMax },
|
||||
{ "childtimeout", &Interpreter::ProcessChildTimeout },
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
{ "coap", &Interpreter::ProcessCoap },
|
||||
#endif
|
||||
#if OPENTHREAD_ENABLE_COMMISSIONER
|
||||
{ "commissioner", &Interpreter::ProcessCommissioner },
|
||||
#endif
|
||||
@@ -602,6 +608,17 @@ exit:
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
#if OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
|
||||
void Interpreter::ProcessCoap(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error;
|
||||
error = Coap::Process(mInstance, argc, argv, *sServer);
|
||||
AppendResult(error);
|
||||
}
|
||||
|
||||
#endif // OPENTHREAD_ENABLE_APPLICATION_COAP
|
||||
|
||||
void Interpreter::ProcessContextIdReuseDelay(int argc, char *argv[])
|
||||
{
|
||||
ThreadError error = kThreadError_None;
|
||||
|
||||
Reference in New Issue
Block a user