/*协调器广播
uint8 flen=pBuf[0];
afAddrType_t GenericApp_resAddr ;
GenericApp_resAddr.addrMode=(afAddrMode_t)AddrBroadcast;
GenericApp_resAddr.endPoint=GENERICAPP_ENDPOINT;
GenericApp_resAddr.addr.shortAddr=0xFFFF;
AF_DataRequest( &GenericApp_resAddr, &GenericApp_epDesc,
RESPONSE_CLUSTERID,
flen,
pBuf,
&GenericApp_TransID,
AF_DISCV_ROUTE,
uint8 flen=pBuf[0];
afAddrType_t GenericApp_resAddr ;
GenericApp_resAddr.addrMode=(afAddrMode_t)AddrBroadcast;
GenericApp_resAddr.endPoint=GENERICAPP_ENDPOINT;
GenericApp_resAddr.addr.shortAddr=0xFFFF;
AF_DataRequest( &GenericApp_resAddr, &GenericApp_epDesc,
RESPONSE_CLUSTERID,
flen,
pBuf,
&GenericApp_TransID,
AF_DISCV_ROUTE,
AF_DEFAULT_RADIUS); */
2、发送和接收函数长度
sendatalen=BUILD_UINT16(pBuf[FRAME_DATALEN_OFFSET+1], pBuf[FRAME_DATALEN_OFFSET])+30; //数据格式0x0001
//返回燃气报警数据
rfrx.Datalen=BUILD_UINT16(pkt->cmd.Data[FRAME_DATALEN_OFFSET+1], pkt->cmd.Data[FRAME_DATALEN_OFFSET]);
HalUARTWrite(0,pkt->cmd.Data,rfrx.Datalen+30);
3、zigbee引脚或按键配置
hal_board_config.h
/* 3 - Yellow status_light */
#define LED3_BV BV(3)
#define LED3_SBIT P1_3
/* S1 switch1 */
#define PUSH1_BV BV(2)
#define PUSH1_SBIT P0_2