diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index b4cad097af8f..b5e56f896b69 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)