mirror of
https://github.com/espressif/openthread.git
synced 2026-07-08 21:30:24 +00:00
Add ping stop command. (#1925)
This commit is contained in:
committed by
Jonathan Hui
parent
844482a52b
commit
70775bdb9a
@@ -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