[thci] update pollperiod command to accept ms resolution configuration (#3361)

This commit is contained in:
Jing
2018-12-28 07:39:46 +08:00
committed by Jonathan Hui
parent 7dc645a856
commit eca3e81fd3
3 changed files with 19 additions and 9 deletions
+3 -2
View File
@@ -1996,12 +1996,13 @@ void Interpreter::ProcessPollPeriod(int argc, char *argv[])
if (argc == 0)
{
mServer->OutputFormat("%d\r\n", (otLinkGetPollPeriod(mInstance) / 1000)); // ms->s
mServer->OutputFormat("%d\r\n", otLinkGetPollPeriod(mInstance));
}
else
{
SuccessOrExit(error = ParseLong(argv[0], value));
otLinkSetPollPeriod(mInstance, static_cast<uint32_t>(value * 1000)); // s->ms
VerifyOrExit(value >= OPENTHREAD_CONFIG_MINIMUM_POLL_PERIOD, error = OT_ERROR_PARSE);
otLinkSetPollPeriod(mInstance, static_cast<uint32_t>(value));
}
exit: