一个设备的Attribute使能了ACCESS_REPORTABLE,怎样让它在改变值后上报给已绑定设备?是否需要使用bdb_RepChangedAttrValue函数?为什么SampleLight中没有看到使用bdb_RepChangedAttrValue函数
Alvin Chen:
建议你参考lock这个demo:#ifdef BDB_REPORTING//Adds the default configuration values for the temperature attribute of the ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK cluster, for endpoint SAMPLETEMPERATURESENSOR_ENDPOINT//Default maxReportingInterval value is 10 seconds//Default minReportingInterval value is 3 seconds//Default reportChange value is 0x01 ()bdb_RepAddAttrCfgRecordDefaultToList(SAMPLEDOORLOCK_ENDPOINT, ZCL_CLUSTER_ID_CLOSURES_DOOR_LOCK, ATTRID_CLOSURES_LOCK_STATE, 0, 10, reportableChange); #endif
Aries Lord:
ZCL协议中会存在一些Attribute,可以用profile cmd来修改。同时这些Attribute在设备收到specific cmd并执行命令时,对应的Attribute也要随之发生变化,与执行命令的结果同步。
chao lv:
回复 Alvin Chen:
不是很明确,父节点在哪接收这个属性的更改值呢?
YiKai Chen:
回复 chao lv:
你可以用bdb_RepAddAttrCfgRecordDefaultToList這個api來設置report時間跟什麼樣的變化要report
/********************************************************************** @fnbdb_RepAddAttrCfgRecordDefaultToList** @briefAdds default configuration values for a Reportable Attribute Record** @paramendpoint* @paramcluster* @paramattrID – Reporable attribute ID* @paramminReportInt – Default value for minimum reportable interval* @parammaxReportInt – Default value for maximum reportable interval* @paramreportableChange – buffer containing attribute value that is the *delta change to trigger a report** @returnZInvalidParameter – No endpoint, cluster, attribute ID found in simple desc*ZFailure – No memory to allocate entry*ZSuccess**/
ZStatus_t bdb_RepAddAttrCfgRecordDefaultToList( uint8 endpoint, uint16 cluster, uint16 attrID, uint16 minReportInt, uint16 maxReportInt, uint8* reportableChange )