Part Number:CC2652P
目前按照SW/LIGHT的例程可以进行数据自动上报。现在想请问一下如果运行过程中,我想调整上报的周期等参数的话,本地设备和远端设备分别可以通过哪些函数进行操作?
Kevin Qiu1:
使用Zstackapi_bdbRepAddAttrCfgRecordDefaultToListReq()配置
看下:
https://www.ti2k.com/wp-content/uploads/2022/03/DeyiSupport_Zigbee_z-stack-overview.html
https://www.ti2k.com/wp-content/uploads/2022/03/DeyiSupport_Zigbee_3247878
,
Weijin Yuan:
你好,我在初始化的时候使用
bdb_RepAddAttrCfgRecordDefaultToList(SAMPLETEMPERATURESENSOR_ENDPOINT, ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT, ATTRID_TEMPERATURE_MEASUREMENT_MEASURED_VALUE, 5, 5, reportableChange);
进行初始化,report可以以5S为周期正常上报。然后我在按键事件那里增加一个按键事件
bdb_RepAddAttrCfgRecordDefaultToList(SAMPLETEMPERATURESENSOR_ENDPOINT, ZCL_CLUSTER_ID_MS_TEMPERATURE_MEASUREMENT, ATTRID_TEMPERATURE_MEASUREMENT_MEASURED_VALUE, 10, 10, reportableChange);
Zstackapi_bdbRepChangedAttrValueReq(appServiceTaskId, &dreq);
但是上报周期还是5S,并没有变成10S,请问如何操作才可以使上报周期变为10S?
,
Kevin Qiu1:
有没有将对应的预编译指令添加到工程中?
To enable BDB report sending functionality on a device, include the BDB_REPORTING compile option.To enable BDB report receiving/processing functionality, include the ZCL_REPORT_DESTINATION_DEVICE compile option.To enable configuring reporting parameters of remote devices, include the ZCL_REPORT_CONFIGURING_DEVICE compile option.
,
Weijin Yuan:
有的,这三个预编译指令我都加进去了。目前我这边上报的配置和上报周期的修改都是在ZED_TEMPERATURESENSOR例程中进行添加的。
,
Kevin Qiu1:
按键事件事件是在哪里调用的,必须在BDB Commissioning之前调用,否则可能不会起作用
参考:https://www.136.la/tech/show-422418.html
,
Weijin Yuan:
我是在BDB Commissioning之后调用的,如果我想在组网之后动态调整report属性,请问应该怎么操作呢?我试着在ZC端使用zcl_SendConfigReportCmd函数对ZED进行操作,但是发现没有效果。而且我发现report好像使用了NVS,因为第二次我重新编译的时候我注释掉了report配置的内容,但是ZC端依然可以收到report信息
,
Kevin Qiu1:
AddAttrCfgRecordDefaultToList在stack中没有办法在BDB Commissioning后调用,
zed_temperaturesensor示例展示了bdb_RepAddAttrCfgRecordDefaultToList的用法
如果是终端设置则可以设置一个定期的事件来报告
Weijin Yuan 说:而且我发现report好像使用了NVS
是的,这在我发的第一个链接中有说明:
When the BDB state machine starts commissioning, the Attribute Reporting module either loads the previously saved Attribute Reporting Configuration records from NV, or finds the application’s reportable attributes (from the attribute list) and constructs the necessary Attribute Reporting Configuration records. Then the module will consolidate the reportable attributes in each cluster of every endpoint, in order to trigger the periodic sending of the Report Attributes command messages using the Maximum Reporting Interval values.