Message Edited by kevinlee on 06-02-2006 06:26 AM
uint8_t App_TrackParentBeacon(void) { uint8_t ret; uint8_t b_order; uint8_t s_order; mlmeMessage_t *pMsg; mlmeSyncReq_t *pSyncReq; b_order = BEACON_ORDER; s_order = SUPERFRAME_ORDER; pMsg = MSG_AllocType(mlmeMessage_t); /* Set Beacon Order */ pMsg->msgType = gMlmeSetReq_c; pMsg->msgData.setReq.pibAttribute = gMPibBeaconOrder_c; pMsg->msgData.setReq.pibAttributeValue = &b_order ret = MSG_Send(NWK_MLME, pMsg); if (ret != gSuccess_c) { Uart_Print("set beacon order failed.\n"); } /* Set Super frame Order */ pMsg->msgType = gMlmeSetReq_c; pMsg->msgData.setReq.pibAttribute = gMPibSuperFrameOrder_c; pMsg->msgData.setReq.pibAttributeValue = &s_order ret = MSG_Send(NWK_MLME, pMsg); if (ret != gSuccess_c) { Uart_Print("set superframe order failed.\n"); } MSG_Free(pMsg); pMsg = MSG_AllocType(mlmeMessage_t); pSyncReq = &pMsg->msgData.syncReq; if (pMsg != NULL) { pMsg->msgType = gMlmeSyncReq_c; pSyncReq->trackBeacon = TRUE; pSyncReq->logicalChannel = logicalChannel; if (MSG_Send(NWK_MLME, pMsg) == gSuccess_c) { Uart_Print("App_TrackParentBeacon succeeded.\n"); return errorNoError; } else { Uart_Print("App_TrackParentBeacon failed.\n"); return errorNotSuccessful; } } }