From aa3d17fa5f0e5426cb51dbd84b66f72e293faa82 Mon Sep 17 00:00:00 2001 From: Shu Chen Date: Sat, 2 Dec 2017 10:00:10 +0800 Subject: [PATCH] [diag] remove diag sleep command (#2378) So then platforms could define their own sleep behavior. --- src/diag/diag_process.cpp | 16 ---------------- src/diag/diag_process.hpp | 1 - tests/unit/test_diag.cpp | 4 ---- 3 files changed, 21 deletions(-) diff --git a/src/diag/diag_process.cpp b/src/diag/diag_process.cpp index 0740f7c77..533371c64 100644 --- a/src/diag/diag_process.cpp +++ b/src/diag/diag_process.cpp @@ -52,7 +52,6 @@ const struct Command Diag::sCommands[] = { "power", &ProcessPower }, { "send", &ProcessSend }, { "repeat", &ProcessRepeat }, - { "sleep", &ProcessSleep }, { "stats", &ProcessStats }, }; @@ -304,21 +303,6 @@ exit: AppendErrorResult(error, aOutput, aOutputMaxLen); } -void Diag::ProcessSleep(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen) -{ - otError error = OT_ERROR_NONE; - - VerifyOrExit(otPlatDiagModeGet(), error = OT_ERROR_INVALID_STATE); - - otPlatRadioSleep(sContext); - snprintf(aOutput, aOutputMaxLen, "sleeping now...\r\n"); - -exit: - OT_UNUSED_VARIABLE(argc); - OT_UNUSED_VARIABLE(argv); - AppendErrorResult(error, aOutput, aOutputMaxLen); -} - void Diag::ProcessStats(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen) { otError error = OT_ERROR_NONE; diff --git a/src/diag/diag_process.hpp b/src/diag/diag_process.hpp index dcd6013e5..8e1c911b4 100644 --- a/src/diag/diag_process.hpp +++ b/src/diag/diag_process.hpp @@ -76,7 +76,6 @@ public: private: static void AppendErrorResult(otError error, char *aOutput, size_t aOutputMaxLen); - static void ProcessSleep(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen); static void ProcessStart(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen); static void ProcessStop(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen); static void ProcessSend(int argc, char *argv[], char *aOutput, size_t aOutputMaxLen); diff --git a/tests/unit/test_diag.cpp b/tests/unit/test_diag.cpp index 0e33beaba..38dc2bc4f 100644 --- a/tests/unit/test_diag.cpp +++ b/tests/unit/test_diag.cpp @@ -139,10 +139,6 @@ void TestDiag() "diag repeat 100 100\n", "sending packets of length 0x64 at the delay of 0x64 ms\r\nstatus 0x00\r\n" }, - { - "diag sleep\n", - "sleeping now...\r\n", - }, { "diag stop\n", "received packets: 0\r\nsent packets: 0\r\nfirst received packet: rssi=0, lqi=0\r\n\nstop diagnostics mode\r\nstatus 0x00\r\n",