Why Router and PAN Coord sends its beacons in the same moments? It's not logical...
lex4098 wrote:
in my case the Coordinator sends beacons exactly when also the
PAN Coordinator does. So, it is like the StartTime parameter is discarded.
I do exactly in this way for set start time PIB, rembember you must set SO and BO before calling MLME-SYNC and after you can set the start time pib.
lex4098 wrote:
Let's suppose it is little endian and exactly 24 bits.
So we can build an array of 3 bytes and send it as a StartTime parameter.
lex4098 wrote:
(PS: ragazzi, ma qua siamo tutti italiani?)
Yes, it works
Federico wrote:
If we are all italian we can write in italian or is forbidden!
In your code (spell) I find how to set the pib atrribute but, don't work or better when I try to set it to false I don't receive a message with state success.
You have check if when you try to set the pib the procedure really work!
Saluti federico
Seq No Channel Time Time Delta MAC Src MAC Dest Protocol Packet Type -------------------------------------------------------------------------------------------------------------------------------------------------------2545 11 10:09:31.708 +00:00:00.983 0xcafa IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 1, AP: 1 2546 11 10:09:31.710 +00:00:00.002 0xfaffffffffffffff 0xcafa IEEE 802.15.4 Command: Association Request 2547 11 10:09:31.712 +00:00:00.001 IEEE 802.15.4 Acknowledgment 2548 11 10:09:32.691 +00:00:00.980 0xcafa IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 1, AP: 1 2549 11 10:09:33.674 +00:00:00.983 0xcafa IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 1, AP: 1 2550 11 10:09:33.679 +00:00:00.005 0xfaffffffffffffff IEEE 802.15.4 Command: Data Request 2551 11 10:09:33.680 +00:00:00.001 IEEE 802.15.4 Acknowledgment 2552 11 10:09:33.684 +00:00:00.004 0xfaffffffffffffff 0xfaffffffffffffff IEEE 802.15.4 Command: Association Response 2553 11 10:09:33.685 +00:00:00.001 IEEE 802.15.4 Acknowledgment 2554 11 10:09:34.657 +00:00:00.972 0x0001 IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 0, AP: 1 2555 11 10:09:35.641 +00:00:00.983 0x0001 IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 0, AP: 1 2556 11 10:09:36.624 +00:00:00.983 0x0001 IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 0, AP: 1 2557 11 10:09:37.607 +00:00:00.983 0x0001 IEEE 802.15.4 Beacon: BO: 6, SO: 0, PC: 0, AP: 1
I've check your code and I think you uncorrectly set the pibAttributeValue.
lex4098 wrote:
I tried almost everything today, but with no result.
I post here my source for the router, the problem is that beacon of Coordinator are at the same time of those from PAN Coordinator.
Thank you for your help.
Leonardo
static uint8_t macBeaconOrder; static uint8_t macSuperFrameOrder; . . . /*Set Beacon Order PIB*/ pMsgOut->msgType = gMlmeSetReq_c; pMsgOut->msgData.setReq.pibAttribute = gMPibBeaconOrder_c; pMsgOut->msgData.setReq.pibAttributeValue = (uint8_t *) &macBeaconOrder; ret = MSG_Send(NWK_MLME, pMsgOut); UartUtil_Print("\nBO:"); UartUtil_PrintHex(pMsgOut->msgData.setReq.pibAttributeValue, 1, FALSE); /*Set SuperFrame Order PIB*/ pMsgOut->msgType = gMlmeSetReq_c; pMsgOut->msgData.setReq.pibAttribute = gMPibSuperFrameOrder_c; pMsgOut->msgData.setReq.pibAttributeValue = (uint8_t *) &macSuperFrameOrder; ret = MSG_Send(NWK_MLME, pMsgOut); UartUtil_Print(", SO:"); UartUtil_PrintHex(pMsgOut->msgData.setReq.pibAttributeValue, 1, FALSE);
static uint32_t macTreemodeStartTime; . . . uint8_t temp[3]; macTreemodeStartTime = 0x0005DC; //1500 symbolstemp[0] = macTreemodeStartTime & 0xFF;temp[1] = (macTreemodeStartTime >> 8) & 0xFF;temp[2] = (macTreemodeStartTime >> 16)& 0xFF;/*Set macTreemodeStartTime Order PIB*/pMsg->msgType = gMlmeSetReq_c;pMsg->msgData.setReq.pibAttribute = gMPibTreemodeStartTime_c;pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)temp;UartUtil_Print(", TxOffset:");UartUtil_PrintHex(pMsg->msgData.setReq.pibAttributeValue, 3, FALSE);/* Send the Set request to the MLME. */if(MSG_Send(NWK_MLME, pMsg) == gSuccess_c){ UartUtil_Print(" Set request Treemode done ");}else{ /* One or more parameters in the Set Request message were invalid. */ UartUtil_Print(" Invalid parameter in set request! "); return errorInvalidParameter;}
/*Set Beacon Order PIB*/pMsgOut->msgType = gMlmeSetReq_c;pMsgOut->msgData.setReq.pibAttribute = gMPibBeaconOrder_c;pMsgOut->msgData.setReq.pibAttributeValue = (uint8_t *) &macBeaconOrder;ret = MSG_Send(NWK_MLME, pMsgOut);UartUtil_Print("\nBO:");UartUtil_PrintHex(pMsgOut->msgData.setReq.pibAttributeValue, 1, FALSE);/*Set SuperFrame Order PIB*/pMsgOut->msgType = gMlmeSetReq_c;pMsgOut->msgData.setReq.pibAttribute = gMPibSuperFrameOrder_c;pMsgOut->msgData.setReq.pibAttributeValue = (uint8_t *) &macSuperFrameOrder;ret = MSG_Send(NWK_MLME, pMsgOut);UartUtil_Print(", SO:");UartUtil_PrintHex(pMsgOut->msgData.setReq.pibAttributeValue, 1, FALSE);/*Set PAN Id Conflict PIB*/pMsgOut->msgType = gMlmeSetReq_c;pMsgOut->msgData.setReq.pibAttribute = gMPibPanIdConflictDetection_c;boolFlag = FALSE;pMsgOut->msgData.setReq.pibAttributeValue = &boolFlag;ret = MSG_Send(NWK_MLME, pMsgOut);