- UID
- 184328
- 性别
- 男
|
我用飞思卡尔的beekit中的wireless uart做了个信息互传的系统,其中协调器设为广播,终端设为单播。单播发送没有问题,但是广播时问题很大,现象也很怪,发送3个packet后就不再响应,大约5秒后才可以继续发送3个packet,如此往复。如果终端设备改为广播,也会出现这个现象。 程序没有多大改变,只是将原来程序绑定发送数据改为根据16位地址发送数据,所以问题应该处在广播上。
afAddrInfo.aClusterId[0] = (mDataClusterId_c & 0xFF); afAddrInfo.aClusterId[1] = (mDataClusterId_c >> 8); afAddrInfo.srcEndPoint = appEndPoint; //afAddrInfo.dstAddrMode = gZbAddrMode64Bit_c; //Copy8Bytes(afAddrInfo.dstAddr.aIeeeAddr, deviceid); afAddrInfo.dstAddrMode = gZbAddrMode16Bit_c; Copy2Bytes(afAddrInfo.dstAddr.aNwkAddr, aBroadcast); //gaBroadcastAddress); afAddrInfo.dstEndPoint = gZbBroadcastEndPoint_c; //Set2Bytes(addrInfo.aClusterId, gZclClusterIdentify_c); //addrInfo.srcEndPoint = srcEndPoint; /* Turn on security and leave it on. Harmless In a non-secure network. */ afAddrInfo.txOptions = 0; afAddrInfo.radiusCounter = afDefaultRadius_c;
以上就寻址模式和源程序有所区别,我设置为广播模式。
以下网址体现了一个和我类似的问题。 http://group.ednchina.com/673/11288.aspx 另一个问题是:我想用64位地址发送数据,但是采用64bitmode时,实际上zigbee还是采用了16位网络地址发送,前提是实现调用了 void ASL_NWK_addr_req ( zbCounter_t *pSequenceNumber, /* IN: The sequence number used to send the request. */ zbNwkAddr_t aDestAddress, /* IN: The destination address where to send the request. */ zbIeeeAddr_t aIeeeAddr, /* IN: The IEEE address to be matched by the Remote Device */ uint8_t requestType, /* IN: Request type for this command: 0x00 ?Single device response 0x01 ?Extended response 0x02-0xFF ?reserved */ index_t startIndex /* IN: If the Request type for this command is Extended response, the StartIndex provides the starting index for the requested elements of the associated devices list */ ) 这个函数,通过64位IEEE地址来获取16位地址,但是这个函数在实际应用中怎么调用,主要是不知道psequencenumber、requesttype和startindex怎么用! |
|