From 94f1da1adad9fc1970ac89b2ff696fa1801585b4 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Wed, 17 Aug 2016 16:11:21 -0700 Subject: [PATCH] Ncp: Clear the "prop changed flags" after successful message sent. (#397) This commit updates how the `mChangedFlags` (which keeps track of properties which are changed) is cleared for `RESET_REASON` and `IP6_LL_ADDR` to ensure that the notification message is successfully queued/sent before clearing the flag. --- src/ncp/ncp_base.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ncp/ncp_base.cpp b/src/ncp/ncp_base.cpp index d4877f815..8dd77cfe2 100644 --- a/src/ncp/ncp_base.cpp +++ b/src/ncp/ncp_base.cpp @@ -514,19 +514,19 @@ void NcpBase::UpdateChangedProps(void) { if ((mChangedFlags & NCP_PLAT_RESET_REASON) != 0) { - mChangedFlags &= ~static_cast(NCP_PLAT_RESET_REASON); - SendLastStatus( + SuccessOrExit(SendLastStatus( SPINEL_HEADER_FLAG | SPINEL_HEADER_IID_0, ResetReasonToSpinelStatus(otPlatGetResetReason()) - ); + )); + mChangedFlags &= ~static_cast(NCP_PLAT_RESET_REASON); } else if ((mChangedFlags & OT_IP6_LL_ADDR_CHANGED) != 0) { - mChangedFlags &= ~static_cast(OT_IP6_LL_ADDR_CHANGED); - HandleCommandPropertyGet( + SuccessOrExit(HandleCommandPropertyGet( SPINEL_HEADER_FLAG | SPINEL_HEADER_IID_0, SPINEL_PROP_IPV6_LL_ADDR - ); + )); + mChangedFlags &= ~static_cast(OT_IP6_LL_ADDR_CHANGED); } else if ((mChangedFlags & OT_IP6_ML_ADDR_CHANGED) != 0) {