Cesar P

ZigBee:MAC problems, MSG_Send...doesn't send!!!

Discussion created by Cesar P on Jul 24, 2007
Latest reply on Sep 12, 2007 by Jonathan Corriveau

Hi,
 
I'm rookie in this world of ZigBee. I want to use as example the "Ex05", "My Wireless App", code that freescale furnishes like example of communication between one coordinator and a device, through the hyperterminal, isn't it?
 
I want to use the function "App_TransmitUartData" but instead of send a input message, through the serial port, I want to send a fix character...
 
"pPacket->msgData.dataReq.msdu[0] = 'h';"
 
and I use the primitive "NR MSG_Send(NWK_MCPS, pPacket);" to put into the NWK_MCPS_queue the request but, doesn't work...I saw that nothing going into the  NWK_MCPS_queue ( I debugged and saw that when I use the original App_TransmitUartData function, the packet goes into...) what is the problem?
 
and what means the "NR" ?, I only see these instruction in the example, and if I cancel these instruction the original code has problems. I've seen in the Reference Manual that only I need to put  MSG_Send, I'm going to post the complete code.

 

thank you in advance,

Cesar
 
//************************************************************************************************************************************
void App_TransmitInfo(void)
{  
   
          
      pPacket = MSG_Alloc(sizeof(nwkToMcpsMessage_t) - 1 + DEFAULT_DATA_LENGTH);
      msduLength=1;
      pPacket->msgData.dataReq.msdu[0] = 'h';
      pPacket->msgType = gMcpsDataReq_c;

      /* Create the header using coordinator information gained during
         the scan procedure. Also use the short address we were assigned
         by the coordinator during association. */

      memcpy(pPacket->msgData.dataReq.dstAddr, coordInfo.coordAddress, 8);
      memcpy(pPacket->msgData.dataReq.srcAddr, myAddress, 8);
      memcpy(pPacket->msgData.dataReq.dstPanId, coordInfo.coordPanId, 2);
      memcpy(pPacket->msgData.dataReq.srcPanId, coordInfo.coordPanId, 2);
      pPacket->msgData.dataReq.dstAddrMode = coordInfo.coordAddrMode;
      pPacket->msgData.dataReq.srcAddrMode = myAddrMode;
      pPacket->msgData.dataReq.msduLength = msduLength;

      /* Request MAC level acknowledgement of the data packet */
      pPacket->msgData.dataReq.txOptions = gTxOptsAck_c;

      /* Give the data packet a handle. The handle is
         returned in the MCPS-Data Confirm message. */
      pPacket->msgData.dataReq.msduHandle = msduHandle++;
    
    
      /* Send the Data Request to the MCPS */
      NR MSG_Send(NWK_MCPS, pPacket);
     //MSG_Send(NWK_MCPS, pPacket);
    
    /* Prepare for another data buffer */
      pPacket = NULL;
      numPendingPackets++;
     
}
 
//**************************************************************************************************************

Outcomes