MyWireless application data transmission

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MyWireless application data transmission

2,332 Views
AmZig
Contributor I
Hi all,
I am using My wireless application and Mc13213 SRB and NCB. While working with the application demo , i am facing problem regarding the data transmission. I have created the simple application 07a and 07b through Beekit , its all function and cases are working , except the function for Handle MCPS and Transmit Uart data. I have tried all the things , but the code never call these functions , i have tried to change the MCPS cases with MLME cases , and it worked and called the MLME function.
Following are those event and the function
 
if (events & evtMessageFromMCPS) // Program Never Ever call this event 
    {     
       /* Get the message from MCPS */
      pMsgIn = MSG_DeQueue(&mMcpsNwkInputQueue);
      if (pMsgIn)
      {             
             
        App_HandleMcpsInput(pMsgIn);
        /* Messages from the MCPS must always be freed. */
        MSG_Free(pMsgIn); 
       }
       else { Uartutil_Print("Bug finder ");
      }
      }
 

    App_TransmitUartData();
    TS_SendEvent(gZappTaskID_c, evtListen);
    break;
  }
static void App_HandleMcpsInput(mcpsToNwkMessage_t *pMsgIn)
{
  switch(pMsgIn->msgType)
  {
    /* The MCPS-Data confirm is sent by the MAC to the network
       or application layer when data has been sent. */
  case gMcpsDataCnf_c:
    if(mcPendingPackets)
      mcPendingPackets--;
    break;
  case gMcpsDataInd_c:
    /* Copy the received data to the UART. */
    UartUtil_Tx(pMsgIn->msgData.dataInd.pMsdu, pMsgIn->msgData.dataInd.msduLength);
    break;
  }
}
 
So , any suggestion what to do . I ll be very thankful .
 
chiao.


Message Edited by AmZig on 2007-09-21 04:17 PM
Labels (1)
0 Kudos
4 Replies

395 Views
Spell
Contributor I
The MCPS-Data indication is sent by the MAC to the network or application layer when data has been received. Are you sure to be able to receive data?
Are you able to trasmit any kind of data via Uart?

regards, Filippo
0 Kudos

395 Views
AmZig
Contributor I
Hej Spell,
First of all thank you for the reply. Secondly , as i have told that i am using Beekit generated test application 07a for  NCB and O7b for SRB. And in that application there  is a function called "Transmit Uart Data". Accordin to the IEEE 802.15.4 specification Data Request is always generated by the NWK or App layer to MAC , and then MAC layer will send this data to the MAC layer of other device and there MCPS.Data.Indication is passed to next higher layer.This procedure is described in MCPS description and the functionality sub section.
On , basis of this information , when i  this code , its transmitting a predefined data through UART . As this code is for MCPS.DATA.Request , and send to the device MCPS to send to other medium. Problem is this currently this thing is not working , my code if i put it also not working. 
 
kindly correct me , may be i am wrong in this code understanding.
 
 
 
static void App_TransmitUartData(void)
{  
  uint8_t msduLength;
 
  /* Use multi buffering for increased TX performance. It does not really
     have any effect at a UART baud rate of 19200bps but serves as an
     example of how the throughput may be improved in a real-world
     application where the data rate is of concern. */
  if( (mcPendingPackets < mDefaultValueOfMaxPendingDataPackets_c) && (mpPacket == NULL) )
  {
    /* If the maximum number of pending data buffes is below maximum limit
       and we do not have a data buffer already then allocate one. */
    mpPacket = MSG_AllocType(nwkToMcpsMessage_t);
  }
  if(mpPacket != NULL)
 
 
  {   
    mpPacket->msgData.dataReq.pMsdu = (uint8_t*)(&(mpPacket->msgData.dataReq.pMsdu)) + sizeof(uint8_t*);
    /* If we have a buffer, then get data from the UART. */
    msduLength = UartUtil_Poll(mpPacket->msgData.dataReq.pMsdu);
   
    if(msduLength)
    {
      /* Data was available in the UART receive buffer. Now create an
         MCPS-Data Request message containing the UART data. */
      mpPacket->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. */
      FLib_MemCpy(mpPacket->msgData.dataReq.dstAddr, mCoordInfo.coordAddress, 8);
      FLib_MemCpy(mpPacket->msgData.dataReq.srcAddr, maMyAddress, 8);
      FLib_MemCpy(mpPacket->msgData.dataReq.dstPanId, mCoordInfo.coordPanId, 2);
      FLib_MemCpy(mpPacket->msgData.dataReq.srcPanId, mCoordInfo.coordPanId, 2);
      mpPacket->msgData.dataReq.dstAddrMode = mCoordInfo.coordAddrMode;
      mpPacket->msgData.dataReq.srcAddrMode = mAddrMode;
     
     
     
      mpPacket->msgData.dataReq.msduLength = msduLength;
      /* Request MAC level acknowledgement of the data packet */
      mpPacket->msgData.dataReq.txOptions = gTxOptsAck_c;
      /* Give the data packet a handle. The handle is
         returned in the MCPS-Data Confirm message. */
      mpPacket->msgData.dataReq.msduHandle = mMsduHandle++;
     
      /* Send the Data Request to the MCPS */
      (void)MSG_Send(NWK_MCPS, mpPacket);
      /* Prepare for another data buffer */
      mpPacket = NULL;
      mcPendingPackets++;
    }
  }
}
0 Kudos

395 Views
Spell
Contributor I


AmZig wrote:
mpPacket->msgData.dataReq.pMsdu = (uint8_t*)(&(mpPacket->msgData.dataReq.pMsdu)) + sizeof(uint8_t*);
    /* If we have a buffer, then get data from the UART. */
    msduLength = UartUtil_Poll(mpPacket->msgData.dataReq.pMsdu);

I think this is wrong...
Before poll data from uart and put this data into a buffer, after put this buffer into pMsdu. Like this:

msduLength = UartUtil_PollMessage(dataBuffer);
.
.
.
mpPacket->msgData.dataReq.pMsdu = (uint8_t*)(&(dataBuffer));

regards, Filippo


Message Edited by Spell on 2007-09-24 09:45 AM

Message Edited by Spell on 2007-09-24 09:45 AM
0 Kudos

395 Views
AmZig
Contributor I
Hej Spell,
Thank you very much , its working now. You are really very helping .
 
Regards
 
Amzig
0 Kudos