diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 381d92bf2475..bc2c5e7e3646 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -276,11 +276,34 @@ template <> otError Interpreter::Process(Arg aArgs[]) template <> otError Interpreter::Process(Arg aArgs[]) { - OT_UNUSED_VARIABLE(aArgs); + otError error = OT_ERROR_NONE; - otInstanceReset(GetInstancePtr()); + if (aArgs[0].IsEmpty()) + { + otInstanceReset(GetInstancePtr()); + } - return OT_ERROR_NONE; +#if OPENTHREAD_CONFIG_PLATFORM_BOOTLOADER_MODE_ENABLE + /** + * @cli reset bootloader + * @code + * reset bootloader + * @endcode + * @par + * Resets platform to bootloader mode, if supported. + */ + else if (aArgs[0] == "bootloader") + { + otInstanceResetToBootloader(GetInstancePtr()); + } +#endif + else + { + ExitNow(error = OT_ERROR_INVALID_COMMAND); + } + +exit: + return error; } void Interpreter::ProcessLine(char *aBuf)