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.
This commit is contained in:
Abtin Keshavarzian
2016-08-17 16:11:21 -07:00
committed by Jonathan Hui
parent a0c6f50051
commit 94f1da1ada
+6 -6
View File
@@ -514,19 +514,19 @@ void NcpBase::UpdateChangedProps(void)
{
if ((mChangedFlags & NCP_PLAT_RESET_REASON) != 0)
{
mChangedFlags &= ~static_cast<uint32_t>(NCP_PLAT_RESET_REASON);
SendLastStatus(
SuccessOrExit(SendLastStatus(
SPINEL_HEADER_FLAG | SPINEL_HEADER_IID_0,
ResetReasonToSpinelStatus(otPlatGetResetReason())
);
));
mChangedFlags &= ~static_cast<uint32_t>(NCP_PLAT_RESET_REASON);
}
else if ((mChangedFlags & OT_IP6_LL_ADDR_CHANGED) != 0)
{
mChangedFlags &= ~static_cast<uint32_t>(OT_IP6_LL_ADDR_CHANGED);
HandleCommandPropertyGet(
SuccessOrExit(HandleCommandPropertyGet(
SPINEL_HEADER_FLAG | SPINEL_HEADER_IID_0,
SPINEL_PROP_IPV6_LL_ADDR
);
));
mChangedFlags &= ~static_cast<uint32_t>(OT_IP6_LL_ADDR_CHANGED);
}
else if ((mChangedFlags & OT_IP6_ML_ADDR_CHANGED) != 0)
{