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++;
}
}
}