Permalink
Browse files

Preparing of MLME-RESET.request is done.

  • Loading branch information...
1 parent 89e3722 commit ee226cfd77380613c57c5ff090c758d5d516e8ce @MaxGekk committed Apr 16, 2012
Showing with 21 additions and 5 deletions.
  1. +21 −5 Components/NWK/src/nwkReset.c
@@ -76,14 +76,30 @@ void NWK_ResetReq(SYS_Ref_t resetRef)
}
}
+/**************************************************************************//**
+ @brief Memory for parameters of MLME-RESET.request is allocated.
+ @details Prepare the request, link the box with NLME-RESET.request parameter's
+ structure and the allocated box for MLME-RESET.request.
+
+ @param[in] allocReqRef - reference to original SYS Allocation request that
+ is placed in the NLME-RESET.request box.
+ @return None.
+ ******************************************************************************/
void nwkMacResetReqAllocated(SYS_Ref_t allocReqRef)
{
SYS_AllocReq_t *const allocReq = SYS_RefPtr(allocReqRef);
- MAC_ResetReq_t *const macReset = SYS_RefPtr(allocReq->result);
-
- macReset->setDefaultPib = nwkReset->setDefaultNib;
- macReset->MAC_ResetConf = nwkMacResetConf;
-
+ MAC_ResetReq_t *const macResetReq = SYS_RefPtr(allocReq->result);
+ const NWK_ResetReq_t *nwkResetReq;
+
+ nwkResetReq = GET_STRUCT_BY_FIELD(NWK_ResetReq_t, service.allocReq, allocReq);
+ /* On receipt of the NLME-RESET.request primitive, the NLME issues
+ * the MLME-RESET.request primitive with the SetDefaultPIB parameter
+ * set to the value of the SetDefaultNIB parameter.
+ * See ZigBee RF4CE Specification r00, 3.1.2.14.3, page 40. */
+ macResetReq->setDefaultPib = nwkResetReq->setDefaultNib;
+ macResetReq->MAC_ResetConf = nwkMacResetConf;
+
+ nwkReset->state = NWK_RESET_MAC_STATE;
MAC_ResetReq(allocReq->result);
}

0 comments on commit ee226cf

Please sign in to comment.