Problem with JN5168 when Continuous sending datas

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Problem with JN5168 when Continuous sending datas

1,659 次查看
terrysi
Contributor I

I start my project with JN-AN-1184, the hardware consist with an coordinator which is used to receive datas and an enddevice which is used to send datas periodically. I use ZPS_eAplAfUnicastDataReq() to send data (string), everything seems ok with the first tow datas, but the coordinator can't receive any data after that while the debug message from the enddevice show show the data is sent successfully.And when enddevice sends the 8th data, the debug message show "No free MCPS request descriptor" error. Has anyone ever encountered this problem?

Here is my data-sending fuction:

PRIVATE void vStr_Send(uint8* content,uint8 lenth)
{
lenth--;
uint8 u8TransactionSequenceNumber;

PDUM_thAPduInstance hAPduInst = PDUM_hAPduAllocateAPduInstance(apduMyData);
uint16 u16Offset = 0;
uint16 i;

// Fill hAPDU payload
int _PDUM_STATE = PDUM_eAPduInstanceSetPayloadSize(hAPduInst, lenth);
if(_PDUM_STATE == 0)DBG_vPrintf(TRUE, "PDUM_OK\n");
else DBG_vPrintf(TRUE, "_PDUM_STATE %d\n",_PDUM_STATE);
for (i = 0; i < lenth; i++) {
u16Offset += PDUM_u16APduInstanceWriteNBO(hAPduInst, u16Offset,"b", *(content + i));
DBG_vPrintf(TRUE, "%c", *(content + i));
}
DBG_vPrintf(TRUE, "Size : %d\n Sending : \n", PDUM_u16APduInstanceGetPayloadSize(hAPduInst));

if (hAPduInst == PDUM_INVALID_HANDLE)
{
DBG_vPrintf(TRUE, "PDUM_INVALID_HANDLE\n");
} else {
ZPS_teStatus eStatus;
ZPS_teAplAfSecurityMode eSecurityMode = (ZPS_E_APL_AF_SECURE_NWK);

eStatus = ZPS_eAplAfUnicastDataReq( hAPduInst,
0x1234,
0x01,
0x01,
0x0000,//address to coordinator
eSecurityMode,
0,
&u8TransactionSequenceNumber
);
if(eStatus != ZPS_E_SUCCESS) DBG_vPrintf(TRUE, "ZPS_E_state %x\n",eStatus);
else if(eStatus == ZPS_E_SUCCESS)DBG_vPrintf(TRUE, "Send success\n");
//PDUM_eAPduFreeAPduInstance(hAPduInst);
}
}

0 项奖励
回复
1 回复

966 次查看
tushar_verma
Contributor I

Hi Sir,

I am also working on Zigbee devices, Zigbee Coordinator and Zigbee Router using FRDM-KWE41Z board, both of the devices are getting in connection but I want to implement data send and receive function at both side can you please help me I am using MCUXpresso SDK example codes, Could you please help me out to implement these both functions and how to implement, any piece of code will be helpfull for me.

warm regards
Tushar Nimesh

0 项奖励
回复