环境条件:
1.终端节点为PM2模式,能够接受数据
2.协调器用TI提供的ZNP代码
3.网络中有路由器
现象:
当终端节点直接挂在协调器下时或者挂在路由器下都出现接收不到数据的情况:协调器发送给终端节点的数据包大小为98bytes,测试过程中有时候ZNP会回复ZMemError,此时终端节点接收不到数据,用CC2531DK_Dongle抓包,发现协调器没有把数据发送出来
调试结果:
接收数据失败时,ZNP会回复数据:fe 01 64 01 10 74 其中在ZNP代码中找到宏定义#define afStatus_MEM_FAIL ZMemError /* 0x10 */,经过调试发现是在该函数中返回 0x10
afStatus_t AF_DataRequest( afAddrType_t *dstAddr, endPointDesc_t *srcEP,
uint16 cID, uint16 len, uint8 *buf, uint8 *transID,
uint8 options, uint8 radius )
{
……
{
if (len > afDataReqMTU( &mtu ) )
{
if (apsfSendFragmented)
{
stat = (*apsfSendFragmented)( &req ); //此处返回了0x10
}
else
{
stat = afStatus_INVALID_PARAMETER;
}
}
else
{
stat = APSDE_DataReq( &req );
}
}
……
}