Z-Stack 3.0.1怎样在App层收取ZCL_CMD_WRITE的信息?抓包显示底层已经响应了ZCL_CMD_WRITE命令,但是App层收不到信息。
YiKai Chen:
你要到 zclProcessInWriteCmd 去處理
one Man:
回复 YiKai Chen:
就是到不到这里:case ZCL_INCOMING_MSG:// Incoming ZCL Foundation command/response messageszclNewbitFan_ProcessIncomingMsg( (zclIncomingMsg_t *)MSGpkt );break;
YiKai Chen:
回复 one Man:
ZCL_CMD_WRITE在zclProcessInWriteCmd 就被處理走了,不會傳給"case ZCL_INCOMING_MSG:"
one Man:
回复 YiKai Chen:
那要去更改zcl.c的代码啊,就没有什么回调函数去通知应用层吗?没有的话怎么去实现其他动作?例如开灯之类的。
Alvin Chen:
回复 one Man:
cmd命令会过滤到callback 不会进入ZCL_INCOMING_MSG
one Man:
回复 YiKai Chen:
这个CallBack只针对Command命令吧?有些Cluster并没有Cmd,例如Fan Control,要对它的FanMode属性进行读写要怎么操作呢?
Alvin Chen:
回复 one Man:
static uint8 zclSampleThermostat_ProcessIncomingMsg( zclIncoming_t *pInMsg)
{uint8 handled = FALSE;switch ( pInMsg->hdr.commandID ){
#ifdef ZCL_READcase ZCL_CMD_READ_RSP:zclSampleThermostat_ProcessInReadRspCmd( pInMsg );handled = TRUE;break;
#endif
#ifdef ZCL_WRITEcase ZCL_CMD_WRITE_RSP:zclSampleThermostat_ProcessInWriteRspCmd( pInMsg );handled = TRUE;break;
#endif
#ifdef ZCL_REPORTcase ZCL_CMD_CONFIG_REPORT://zclSampleThermostat_ProcessInConfigReportCmd( pInMsg );break;
case ZCL_CMD_CONFIG_REPORT_RSP://zclSampleThermostat_ProcessInConfigReportRspCmd( pInMsg );break;
case ZCL_CMD_READ_REPORT_CFG://zclSampleThermostat_ProcessInReadReportCfgCmd( pInMsg );break;
case ZCL_CMD_READ_REPORT_CFG_RSP://zclSampleThermostat_ProcessInReadReportCfgRspCmd( pInMsg );break;
#endif
#ifdef ZCL_REPORT_DESTINATION_DEVICEcase ZCL_CMD_REPORT:zclSampleThermostat_ProcessInReportCmd( pInMsg );handled = TRUE;break;
#endifcase ZCL_CMD_DEFAULT_RSP:zclSampleThermostat_ProcessInDefaultRspCmd( pInMsg );handled = TRUE;break;
default:break;}
return handled;
}
one Man:
回复 Alvin Chen:
我是用#define zcl_SendWrite(a,b,c,d,e,f,g) (zcl_SendWriteRequest( (a), (b), (c), (d), ZCL_CMD_WRITE, (e), (f), (g) ))
这个函数发送写属性操作的,但是在接收方并没有进入zclSampleThermostat_ProcessIncomingMsg( zclIncoming_t *pInMsg)这个函数