[udp] add cli-based example for UDP APIs (#2027)

This commit is contained in:
Jonathan Hui
2017-07-26 12:14:44 -07:00
committed by GitHub
parent 4dc80ee357
commit f88c537c6c
13 changed files with 484 additions and 10 deletions
+13
View File
@@ -201,6 +201,9 @@ const struct Command Interpreter::sCommands[] =
{ "state", &Interpreter::ProcessState },
{ "thread", &Interpreter::ProcessThread },
{ "txpowermax", &Interpreter::ProcessTxPowerMax },
#ifndef OTDLL
{ "udp", &Interpreter::ProcessUdp },
#endif
{ "version", &Interpreter::ProcessVersion },
};
@@ -248,6 +251,7 @@ Interpreter::Interpreter(otInstance *aInstance):
#if OPENTHREAD_ENABLE_DNS_CLIENT
mResolvingInProgress(0),
#endif
mUdp(*this),
#endif
mInstance(aInstance)
{
@@ -2487,6 +2491,15 @@ void Interpreter::ProcessVersion(int argc, char *argv[])
OT_UNUSED_VARIABLE(argv);
}
#ifndef OTDLL
void Interpreter::ProcessUdp(int argc, char *argv[])
{
otError error;
error = mUdp.Process(argc, argv);
AppendResult(error);
}
#endif
#if OPENTHREAD_ENABLE_COMMISSIONER && OPENTHREAD_FTD
void Interpreter::ProcessCommissioner(int argc, char *argv[])