刚学ZIGBEE 今天用两个cc2530模块 用协议栈 发送一串数字到上位机,节点发送 协调器接收发给上位机,好奇的将节点的串口连接上电脑发现电脑也能收到同样的数据 。 不知道该传什么上来说明这个问题,希望大神进来浏览一下,在线等。。。。。。
switch ( MSGpkt->hdr.event )
{
// Received when a messages is received (OTA) for this endpoint
case AF_INCOMING_MSG_CMD:
SampleApp_MessageMSGCB( MSGpkt );
break;
}
else
{
// Device is no longer in the network
}
break;
default:
break;
}
事件函数很简单就是串口发送get data 提示和接收到的数组而已。。。。
void SampleApp_MessageMSGCB( afIncomingMSGPacket_t *pkt )
{
uint16 flashTime;
uint8 d=12;
static uint8 i;
switch ( pkt->clusterId )
{
case SAMPLEAPP_PERIODIC_CLUSTERID:
HalUARTWrite(0,"I GET DATA\n",11);
HalUARTWrite(0,"12",2); HalUARTWrite(0," ",2);
// HalUARTWrite(0,&pkt->cmd.DataLength,1); HalUARTWrite(0," ",2);
HalUARTWrite(0,&pkt->cmd.Data[0],10);
HalUARTWrite(0,"\n",1);
break;
case SAMPLEAPP_FLASH_CLUSTERID:
flashTime = BUILD_UINT16(pkt->cmd.Data[1], pkt->cmd.Data[2] );
break;
}
}
VV:
你看下空中的交互,协调器是否有回复数据给节点。