1.终端调用
afAddrType_t DstAddr;
zclReportCmd_t *pReportCmd;
DstAddr.addrMode = (afAddrMode_t)Addr16Bit;
DstAddr.endPoint = 1;
DstAddr.addr.shortAddr = 0;
pReportCmd = osal_mem_alloc( sizeof(zclReportCmd_t) + sizeof(zclReport_t) );
pReportCmd->numAttr = 1;
pReportCmd->attrList[0].attrID = ATTRID_ON_OFF;
pReportCmd->attrList[0].dataType = ZCL_DATATYPE_UINT8;
pReportCmd->attrList[0].attrData = (void *)(&light_OnOff);
zcl_SendReportCmd( 1, &DstAddr,
ZCL_CLUSTER_ID_GEN_ON_OFF,
pReportCmd, ZCL_FRAME_SERVER_CLIENT_DIR, FALSE, seqnum++ );
2.协调器接收处理
static void zclGenericApp_ProcessIncomingMsg( zclIncomingMsg_t *pInMsg )
{
switch ( pInMsg->zclHdr.commandID )
{
case ZCL_CMD_REPORT: zclGenericApp_ProcessInReportRspCmd( pInMsg );
break;
}
}
3. 1发送的数据2无法收到
capture.psd
Viki Shi:
请问你使用的协议栈版本及芯片是什么?
YiKai Chen:
协调器outcluster有沒有加上ZCL_CLUSTER_ID_GEN_ON_OFF?
chentm chentm:
回复 Alvin Chen:
谢谢,我加了ZCL_REPORT_DESTINATION_DEVICE就可以了