diff --git a/src/core/meshcop/dataset_manager_ftd.cpp b/src/core/meshcop/dataset_manager_ftd.cpp index e80c4a687..25da998d1 100644 --- a/src/core/meshcop/dataset_manager_ftd.cpp +++ b/src/core/meshcop/dataset_manager_ftd.cpp @@ -256,7 +256,7 @@ otError DatasetManager::HandleSet(Coap::Message &aMessage, const Ip6::MessageInf SuccessOrExit( Get().GetCommissionerAloc(destination, localSessionId->GetCommissionerSessionId())); - IgnoreError(Get().SendDatasetChanged(destination)); + Get().SendDatasetChanged(destination); } exit: diff --git a/src/core/meshcop/meshcop_leader.cpp b/src/core/meshcop/meshcop_leader.cpp index 7d5c734df..629acc392 100644 --- a/src/core/meshcop/meshcop_leader.cpp +++ b/src/core/meshcop/meshcop_leader.cpp @@ -117,12 +117,12 @@ void Leader::HandlePetition(Coap::Message &aMessage, const Ip6::MessageInfo &aMe mTimer.Start(Time::SecToMsec(kTimeoutLeaderPetition)); exit: - IgnoreError(SendPetitionResponse(aMessage, aMessageInfo, state)); + SendPetitionResponse(aMessage, aMessageInfo, state); } -otError Leader::SendPetitionResponse(const Coap::Message & aRequest, - const Ip6::MessageInfo &aMessageInfo, - StateTlv::State aState) +void Leader::SendPetitionResponse(const Coap::Message & aRequest, + const Ip6::MessageInfo &aMessageInfo, + StateTlv::State aState) { otError error = OT_ERROR_NONE; Coap::Message *message; @@ -150,12 +150,15 @@ otError Leader::SendPetitionResponse(const Coap::Message & aRequest, exit: - if (error != OT_ERROR_NONE && message != NULL) + if (error != OT_ERROR_NONE) { - message->Free(); - } + otLogInfoMeshCoP("Failed to send petition response: %s", otThreadErrorToString(error)); - return error; + if (message != NULL) + { + message->Free(); + } + } } void Leader::HandleKeepAlive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo) @@ -203,15 +206,15 @@ void Leader::HandleKeepAlive(Coap::Message &aMessage, const Ip6::MessageInfo &aM mTimer.Start(Time::SecToMsec(kTimeoutLeaderPetition)); } - IgnoreError(SendKeepAliveResponse(aMessage, aMessageInfo, responseState)); + SendKeepAliveResponse(aMessage, aMessageInfo, responseState); exit: return; } -otError Leader::SendKeepAliveResponse(const Coap::Message & aRequest, - const Ip6::MessageInfo &aMessageInfo, - StateTlv::State aState) +void Leader::SendKeepAliveResponse(const Coap::Message & aRequest, + const Ip6::MessageInfo &aMessageInfo, + StateTlv::State aState) { otError error = OT_ERROR_NONE; Coap::Message *message; @@ -229,15 +232,18 @@ otError Leader::SendKeepAliveResponse(const Coap::Message & aRequest, exit: - if (error != OT_ERROR_NONE && message != NULL) + if (error != OT_ERROR_NONE) { - message->Free(); - } + otLogWarnMeshCoP("Failed to send keep alive response: %s", otThreadErrorToString(error)); - return error; + if (message != NULL) + { + message->Free(); + } + } } -otError Leader::SendDatasetChanged(const Ip6::Address &aAddress) +void Leader::SendDatasetChanged(const Ip6::Address &aAddress) { otError error = OT_ERROR_NONE; Ip6::MessageInfo messageInfo; @@ -256,12 +262,15 @@ otError Leader::SendDatasetChanged(const Ip6::Address &aAddress) exit: - if (error != OT_ERROR_NONE && message != NULL) + if (error != OT_ERROR_NONE) { - message->Free(); - } + otLogWarnMeshCoP("Failed to send dataset changed: %s", otThreadErrorToString(error)); - return error; + if (message != NULL) + { + message->Free(); + } + } } otError Leader::SetDelayTimerMinimal(uint32_t aDelayTimerMinimal) diff --git a/src/core/meshcop/meshcop_leader.hpp b/src/core/meshcop/meshcop_leader.hpp index dfadf7e82..25b8c02ef 100644 --- a/src/core/meshcop/meshcop_leader.hpp +++ b/src/core/meshcop/meshcop_leader.hpp @@ -77,11 +77,8 @@ public: * * @param[in] aAddress The IPv6 address of destination. * - * @retval OT_ERROR_NONE Successfully send MGMT_DATASET_CHANGED message. - * @retval OT_ERROR_NO_BUFS Insufficient buffers to generate a MGMT_DATASET_CHANGED message. - * */ - otError SendDatasetChanged(const Ip6::Address &aAddress); + void SendDatasetChanged(const Ip6::Address &aAddress); /** * This method sets minimal delay timer. @@ -119,13 +116,13 @@ private: static void HandlePetition(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandlePetition(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - otError SendPetitionResponse(const Coap::Message & aRequest, + void SendPetitionResponse(const Coap::Message & aRequest, const Ip6::MessageInfo &aMessageInfo, StateTlv::State aState); static void HandleKeepAlive(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo); void HandleKeepAlive(Coap::Message &aMessage, const Ip6::MessageInfo &aMessageInfo); - otError SendKeepAliveResponse(const Coap::Message & aRequest, + void SendKeepAliveResponse(const Coap::Message & aRequest, const Ip6::MessageInfo &aMessageInfo, StateTlv::State aState);