From cdc3751e597ed7e018f9bdf2959ae7b2b13729ef Mon Sep 17 00:00:00 2001 From: Yakun Xu Date: Thu, 15 Aug 2019 13:21:58 +0800 Subject: [PATCH] [diag] fix processing platform command (#4099) --- src/core/diags/factory_diags.cpp | 10 +--------- src/ncp/ncp_base.cpp | 10 ++++++++++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/core/diags/factory_diags.cpp b/src/core/diags/factory_diags.cpp index 5cb0d9a69..03ba1d7c1 100644 --- a/src/core/diags/factory_diags.cpp +++ b/src/core/diags/factory_diags.cpp @@ -475,15 +475,7 @@ exit: { case OT_ERROR_NONE: - if (argCount >= 1) - { - ProcessCmd(argCount - 1, (argCount == 1) ? NULL : &argVector[1], aOutput, aOutputMaxLen); - } - else - { - ProcessCmd(0, NULL, aOutput, aOutputMaxLen); - } - + ProcessCmd(argCount, &argVector[0], aOutput, aOutputMaxLen); break; case OT_ERROR_NO_BUFS: diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index b5702a2c9..84acfdfdb 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -1288,6 +1288,16 @@ otError NcpBase::HandlePropertySet_SPINEL_PROP_NEST_STREAM_MFG(uint8_t aHeader) VerifyOrExit(error == OT_ERROR_NONE, error = WriteLastStatusFrame(aHeader, ThreadErrorToSpinelStatus(error))); output[sizeof(output) - 1] = '\0'; + +#if OPENTHREAD_MTD || OPENTHREAD_FTD + // TODO do not pass mfg prefix + // skip mfg prefix from wpantund + if (memcmp(string, "mfg ", 4) == 0) + { + string += 4; + } +#endif + otDiagProcessCmdLine(mInstance, string, output, sizeof(output) - 1); // Prepare the response