cli: pollperiod fix (#387)

This commit is contained in:
rongli
2016-08-16 09:08:50 -07:00
committed by Jonathan Hui
parent 01a3f7aea9
commit 1144982a06
5 changed files with 45 additions and 29 deletions
+4 -4
View File
@@ -567,20 +567,20 @@ Send an ICMPv6 Echo Request.
### pollperiod
Get the data poll period of sleepy end device
Get the customized data poll period of sleepy end device (seconds). Only for certification test
```bash
> pollperiod
240
0
Done
```
### pollperiod \<pollperiod>\
Set the data poll period for sleepy end device
Set the customized data poll period for sleepy end device (seconds). Only for certification test
```bash
> pollperiod 240
> pollperiod 10
Done
```
+2 -2
View File
@@ -1040,12 +1040,12 @@ void Interpreter::ProcessPollPeriod(int argc, char *argv[])
if (argc == 0)
{
sServer->OutputFormat("%d\r\n", otGetPollPeriod());
sServer->OutputFormat("%d\r\n", (otGetPollPeriod() / 1000)); // ms->s
}
else
{
SuccessOrExit(error = ParseLong(argv[0], value));
otSetPollPeriod(static_cast<uint32_t>(value));
otSetPollPeriod(static_cast<uint32_t>(value * 1000)); // s->ms
}
exit: