Add ping stop command. (#1925)

This commit is contained in:
Łukasz Duda
2017-06-22 00:04:24 -07:00
committed by Jonathan Hui
parent 844482a52b
commit 70775bdb9a
2 changed files with 24 additions and 0 deletions
+9
View File
@@ -1272,6 +1272,15 @@ Send an ICMPv6 Echo Request.
16 bytes from fdde:ad00:beef:0:558:f56b:d688:799: icmp_seq=1 hlim=64 time=28ms
```
### ping stop
Stop sending ICMPv6 Echo Requests.
```bash
> ping stop
Done
```
### pollperiod
Get the customized data poll period of sleepy end device (seconds). Only for certification test
+15
View File
@@ -1623,6 +1623,21 @@ void Interpreter::ProcessPing(int argc, char *argv[])
long value;
VerifyOrExit(argc > 0, error = OT_ERROR_PARSE);
if (strcmp(argv[0], "stop") == 0)
{
if (!mPingTimer.IsRunning())
{
error = OT_ERROR_INVALID_STATE;
}
else
{
mPingTimer.Stop();
}
ExitNow();
}
VerifyOrExit(!mPingTimer.IsRunning(), error = OT_ERROR_BUSY);
memset(&mMessageInfo, 0, sizeof(mMessageInfo));