This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ZCL Report怎么配置和使用?

一个设备的Attribute使能了ACCESS_REPORTABLE,怎样让它在改变值后上报给已绑定设备?是否需要使用bdb_RepChangedAttrValue函数?为什么SampleLight中没有看到使用bdb_RepChangedAttrValue函数

  • 建议你参考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

  • ZCL协议中会存在一些Attribute,可以用profile cmd来修改。同时这些Attribute在设备收到specific cmd并执行命令时,对应的Attribute也要随之发生变化,与执行命令的结果同步。

  • 不是很明确,父节点在哪接收这个属性的更改值呢?

  • 你可以用bdb_RepAddAttrCfgRecordDefaultToList這個api來設置report時間跟什麼樣的變化要report

    /*********************************************************************
    * @fn bdb_RepAddAttrCfgRecordDefaultToList
    *
    * @brief Adds default configuration values for a Reportable Attribute Record
    *
    * @param endpoint
    * @param cluster
    * @param attrID - Reporable attribute ID
    * @param minReportInt - Default value for minimum reportable interval
    * @param maxReportInt - Default value for maximum reportable interval
    * @param reportableChange - buffer containing attribute value that is the
    * delta change to trigger a report
    *
    * @return ZInvalidParameter - 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 )