#include""#include""#include""#include""#include""#include""#include""#include""/*HAL*/#include""#include""#include""#include""#include""//#include""#include""#include""#include""#include""#include""constcId_tSampleApp_ClusterList[SAMPLEAPP_MAX_CLUSTERS]={SAMPLEAPP_PERIODIC_CLUSTERID,SAMPLEAPP_FLASH_CLUSTERID};constSimpleDescriptionFormat_tSampleApp_SimpleDesc={SAMPLEAPP_ENDPOINT,//intEndpoint;SAMPLEAPP_PROFID,//uint16AppProfId[2];SAMPLEAPP_DEVICEID,//uint16AppDeviceId[2];SAMPLEAPP_DEVICE_VERSION,//intAppDevVer:4;SAMPLEAPP_FLAGS,//intAppFlags:4;SAMPLEAPP_MAX_CLUSTERS,//uint8AppNumInClusters;(cId_t*)SampleApp_ClusterList,//uint8*pAppInClusterList;SAMPLEAPP_MAX_CLUSTERS,//uint8AppNumInClusters;(cId_t*)SampleApp_ClusterList//uint8*pAppInClusterList;};endPointDesc_tSampleApp_epDesc;uint8SampleApp_TaskID;devStates_tSampleApp_NwkState;uint8SampleApp_TransID;uint8changeline[2]={0x0a,0x0d};unionh{uint8RxBuf[70];Union_DATARXDATA;}UartRxBuf;//串口接收缓冲区unione{uint8TxBuf[70];Union_DATATXDATA;}UartTxBuf;//串口发送缓冲区unionf{uint8RxBuf[70];Union_DATARXDATA;}RfRx;//无线接收缓冲区uniong{uint8TxBuf[70];Union_DATATXDATA;}RfTx;//无线接收缓冲区voidSampleApp_MessageMSGCB(ingMSGPacket_t*pckt);voidSampleApp_SendData(unsignedcharbuff[],uint8length);staticvoidrxCB(uint8port,uint8event);voidSampleApp_Init(uint8task_id){halUARTCfg_tuartConfig;SampleApp_TaskID=task_id;SampleApp_NwkState=DEV_INIT;SampleApp_TransID=0;=SAMPLEAPP_ENDPOINT;=&SampleApp_TaskID;=(SimpleDescriptionFormat_t*)&SampleApp_SimpleDesc;=noLatencyReqs;afRegister(&SampleApp_epDesc);RegisterForKeys(SampleApp_TaskID);MT_UartRegisterTaskID(SampleApp_TaskID);LCDInit();ClearScreen();Print(0,10,"COORDINATOR",1);Print(2,5,"ZhangHang",1);Print(4,5,"FengGuangWen",1);Print(6,5
Zigbee组网程序 来自淘豆网m.daumloan.com转载请标明出处.