uint8_t setTreemode(uint32_t treeModeStart,uint8_t bo, uint8_t so)
{
mlmeMessage_t *pMsg;
uint8_t temp[3];
uint8_t ret;
#ifdef PRINT_MLME
Uart_Print("Sending the MLME-Stard Coord message to the MAC...");
#endif PRINT_MLME
pMsg = MSG_AllocType(mlmeMessage_t);
if(pMsg != NULL)
{
temp[0]= treeModeStart & 0xFF;
temp[1]= (treeModeStart >> 8) & 0xFF;
temp[2]= (treeModeStart >> 16) & 0xFF;
#ifdef PRINT_ADDR
Uart_Print("\nTree delay beacon ");
Uart_PrintHex(temp,3,0);
#endif PRINT_ADDR
//Prima di impostare i valori di offset con cui trasmettere il mio beacon
//vado a settare i valori di bo ed so del coordinatore a cui sono associato
ret = setBeaconSuperframe( bo, so);
if (ret != gSuccess_c) return ret;
pMsg->msgType = gMlmeSetReq_c;
pMsg->msgData.setReq.pibAttribute = gMPibTreemodeStartTime_c;
pMsg->msgData.setReq.pibAttributeValue = (uint8_t *)(temp);
ret = MSG_Send(NWK_MLME, pMsg);
if (ret != gSuccess_c)
{
Uart_Print("error tree mode ") ;
Uart_PrintHex(&ret,1,0);
}
return ret;
}
I look your software, and I think you wrong to set the treemodeStartTime.
I use this function, I hope that this can help you.