mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 13:20:25 +00:00
THCI: setMinDelayTimer() API (#1329)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user