AnsweredAssumed Answered

JN5169: MCPS  Synchronous Data Confirm

Question asked by Alberto Gallegos on Jul 8, 2020
Latest reply on Jul 15, 2020 by Alberto Gallegos

According to the 2.6 User Guide, it is possible to have Synchronous Data Confirm (i.e. Return the results immediately, rather than the results being posted as a deferred confirm sometime later).

 

See Section 3.8.3.  (User Guide 2.6) or page 18 (stack API v1.7).

 

Regardless of this description, no explanation is given on how to achieve this. The example JN-AN-1174 only uses deferred confirms.

 

Here is what I tried, please check what is after vAppApiMcpsRequest.

PRIVATE void vTransmitDataPacket(uint8 *pu8Data, uint8 u8Len, uint16 u16DestAdr)
{
MAC_McpsReqRsp_s sMcpsReqRsp;
MAC_McpsSyncCfm_s sMcpsSyncCfm;
uint8 *pu8Payload, i = 0;
/* Create frame transmission request */
sMcpsReqRsp.u8Type = MAC_MCPS_REQ_DATA;
sMcpsReqRsp.u8ParamLength = sizeof(MAC_McpsReqData_s);
/* Set handle so we can match confirmation to request */
sMcpsReqRsp.uParam.sReqData.u8Handle = 0;
/* Use short address for source */
sMcpsReqRsp.uParam.sReqData.sFrame.sSrcAddr.u8AddrMode = 2;
sMcpsReqRsp.uParam.sReqData.sFrame.sSrcAddr.u16PanId = PAN_ID;
sMcpsReqRsp.uParam.sReqData.sFrame.sSrcAddr.uAddr.u16Short = sEndDeviceData.u16Address;
/* Use short address for destination */
sMcpsReqRsp.uParam.sReqData.sFrame.sDstAddr.u8AddrMode = 2;
sMcpsReqRsp.uParam.sReqData.sFrame.sDstAddr.u16PanId = PAN_ID;
sMcpsReqRsp.uParam.sReqData.sFrame.sDstAddr.uAddr.u16Short = u16DestAdr;
/* Transmit without ack req */
sMcpsReqRsp.uParam.sReqData.sFrame.u8TxOptions = 0; // for ack req : MAC_TX_OPTION_ACK;
pu8Payload = sMcpsReqRsp.uParam.sReqData.sFrame.au8Sdu;
pu8Payload [0] = 0x00;
pu8Payload [1] = 0x01;
pu8Payload [2] = 0x02;
pu8Payload [3] = 0x03;
/* Set frame length */
sMcpsReqRsp.uParam.sReqData.sFrame.u8SduLength = 4;
/* Request transmit */
uint32 currentTime = vGetMicroSeconds();
DBG_vPrintf(TRUE,"%d MicroSec | Transmit Request with size %d \n",currentTime,sMcpsReqRsp.uParam.sReqData.sFrame.u8SduLength);
vAppApiMcpsRequest(&sMcpsReqRsp, &sMcpsSyncCfm);

DBG_vPrintf(TRUE,"syncfmstatus %d \n",sMcpsSyncCfm.u8Status);
//Status  here should be != deferred if we want a sync mcps confirm
if (sMcpsSyncCfm.u8Status != MAC_MCPS_CFM_DEFERRED){
if (sMcpsSyncCfm.uParam.sCfmData.u8Status == MAC_ENUM_SUCCESS)
{
uint32 time1 = vGetMicroSeconds();
DBG_vPrintf(TRUE,"%d MicroSec | Sync Data transmit confirm \n",time1);
}
}


}

 

Any way to achieve this synchronous  MCPS-DATA.request - confirm?

Any help is much appreciated.

 

Regards,

 

Al

Outcomes