终端点播发送数据,但是协调器接收不到,通过调试知道协调器(接收端)代码并未跑到AF_INCOMING_MSG_CMD事件中,发送数据的抓包截图显示数据已经发出去了,所以麻烦大佬帮我看一下咋回事吧,谢谢啦。
初始化部分代码:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
| SimpleDescriptionFormat_t zclGenericApp_SimpleDesc =
{
GENERICAPP_ENDPOINT, // int Endpoint;
ZCL_HA_PROFILE_ID, // uint16 AppProfId;
// GENERICAPP_TODO: Replace ZCL_HA_DEVICEID_ON_OFF_LIGHT with application specific device ID
ZCL_HA_DEVICEID_ON_OFF_LIGHT, // uint16 AppDeviceId;
GENERICAPP_DEVICE_VERSION, // int AppDevVer:4;
GENERICAPP_FLAGS, // int AppFlags:4;
ZCLGENERICAPP_MAX_INCLUSTERS, // byte AppNumInClusters;
(cId_t *)zclGenericApp_InClusterList, // byte *pAppInClusterList;
ZCLGENERICAPP_MAX_OUTCLUSTERS, // byte AppNumInClusters;
(cId_t *)zclGenericApp_OutClusterList // byte *pAppInClusterList;
};
|
?
1
2
3
4
5
6
7
8
| static endPointDesc_t zclGenericApp_TestEp =
{
GENERICAPP_ENDPOINT, // endpoint
0,
&zclGenericApp_TaskID,
(SimpleDescriptionFormat_t *)&zclGenericApp_SimpleDesc,
noLatencyReqs
};
|
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| const cId_t zclGenericApp_InClusterList[] =
{
ZCL_CLUSTER_ID_GEN_BASIC,
ZCL_CLUSTER_ID_GEN_IDENTIFY,
ZCL_CLUSTER_CLUSTERID,
};
*****************************************************************************************
const cId_t zclGenericApp_OutClusterList[] =
{
ZCL_CLUSTER_ID_GEN_BASIC,
ZCL_CLUSTER_CLUSTERID,
};
|
发送部分代码:
?
1
2
3
4
5
6
7
8
9
10
11
| my_DstAddr.addrMode = (afAddrMode_t)Addr16Bit;//设置发送模式
my_DstAddr.endPoint = GENERICAPP_ENDPOINT;//初始化端口号
my_DstAddr.addr.shortAddr=0x0000;
AF_DataRequest(&my_DstAddr,
&zclGenericApp_TestEp,
ZCL_CLUSTER_CLUSTERID,
uart_rdlen-1,
&uart_rdata[1],
&zclGenericApp_TaskID,
AF_DISCV_ROUTE,
AF_DEFAULT_RADIUS);
|
接收部分代码:
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| case AF_INCOMING_MSG_CMD:
HalUARTWrite(0,"msg00\n",6);
GenericApp_MessageMSGCB( MSGpkt );
break;
********************************************************************
void GenericApp_MessageMSGCB(afIncomingMSGPacket_t *pkt){
uint8 buffer[10];
switch ( pkt->clusterId )
{
case ZCL_CLUSTER_CLUSTERID:
osal_memcpy(buffer,pkt->cmd.Data,pkt->cmd.DataLength);
Uart_Write(SEND_DATA,0,buffer,pkt->cmd.DataLength);
break;
}
}
|
发送数据时抓包如下:
- # Zigbee,zstack3.0.2, 2530
|