THCI: setMinDelayTimer() API (#1329)

This commit is contained in:
rongli
2017-02-18 04:09:36 +08:00
committed by Jonathan Hui
parent 2502bca6f1
commit fa04f1c4cb
10 changed files with 127 additions and 5 deletions
+24
View File
@@ -79,6 +79,7 @@ const struct Command Interpreter::sCommands[] =
{ "contextreusedelay", &Interpreter::ProcessContextIdReuseDelay },
{ "counter", &Interpreter::ProcessCounters },
{ "dataset", &Interpreter::ProcessDataset },
{ "delaytimermin", &Interpreter::ProcessDelayTimerMin},
#if OPENTHREAD_ENABLE_DIAG
{ "diag", &Interpreter::ProcessDiag },
#endif
@@ -568,6 +569,29 @@ void Interpreter::ProcessDataset(int argc, char *argv[])
AppendResult(error);
}
void Interpreter::ProcessDelayTimerMin(int argc, char *argv[])
{
ThreadError error = kThreadError_None;
if (argc == 0)
{
sServer->OutputFormat("%d\r\n", (otGetDelayTimerMinimal(mInstance) / 1000));
}
else if (argc == 1)
{
unsigned long value;
SuccessOrExit(error = ParseUnsignedLong(argv[0], value));
SuccessOrExit(error = otSetDelayTimerMinimal(mInstance, static_cast<uint32_t>(value * 1000)));
}
else
{
error = kThreadError_InvalidArgs;
}
exit:
AppendResult(error);
}
void Interpreter::ProcessDiscover(int argc, char *argv[])
{
ThreadError error = kThreadError_None;