mirror of
https://github.com/espressif/openthread.git
synced 2026-08-08 11:47:46 +00:00
Add ping stop command. (#1925)
This commit is contained in:
committed by
Jonathan Hui
parent
844482a52b
commit
70775bdb9a
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user