Zigbee - Custom cluster attribute reporting only on connect
Hey,
I working on a project with the following goal: setup one central coordinator and let multiple sleepy end devices send sensor data periodically. For development I am trying to alter the code of the Zigbee_TempMeas_Client_Router/Zigbee_TempMeas_Server_Coord example projects, such that sending long strings is possible.
The setup is the following:
- custom cluster with one reportable long string attribute
static const struct ZbZclAttrT ZclTemp_AttrList[] = {
{
MY_ZCL_DEV_LS, ZCL_DATATYPE_STRING_LONG_CHARACTER,
ZCL_ATTR_FLAG_REPORTABLE|ZCL_ATTR_FLAG_WRITABLE,
512, // custom size
NULL, // callback
{0, 0}, //no value range
{1, 10}
}
}; - sleepy end devices run the server
- coordinator runs the client and sends APP_ZIGBEE_Read_Temp_Attribute() request to the sleepy end devices
- The custom attribute is changed between each call of APP_ZIGBEE_Temp_Meas_Read_cb(). APP_ZIGBEE_Temp_Meas_Read_cb() is unchanged with exeption of the attribute and readReq.dst.nwkAddr = 0xFFFF;
- I configure the reporting similarily to the example
static void APP_ZIGBEE_ReportConfig(void)
{
uint16_t rep_change = (uint16_t) ZCL_REPORT_CHANGE;
struct ZbZclAttrReportConfigT report;
report.dst.endpoint = SW1_ENDPOINT;
report.dst.mode = ZB_APSDE_ADDRMODE_SHORT;
report.dst.nwkAddr = 0x0000;
report.num_records = 1;
report.record_list[0].direction = ZCL_REPORT_DIRECTION_NORMAL;
report.record_list[0].min = ZCL_MIN_REPORT; //10s
report.record_list[0].max = ZCL_MAX_REPORT; //10s
report.record_list[0].change = 0;
report.record_list[0].attr_id = MY_ZCL_DEV_LS;
report.record_list[0].attr_type = ZCL_DATATYPE_STRING_LONG_CHARACTER;
ZbZclAttrReportConfigReq(zigbee_app_info.custom_ls_server,&report,&APP_ZIGBEE_Report_cb,(void*)&rep_change);
}/*APP_ZIGBEE_ReportConfig*/
The problem:
- The callback function APP_ZIGBEE_Temp_Meas_Read_cb() only reads the custom long string attribute succesfully once (when the sleepy end device joins the network) instead of each time, APP_ZIGBEE_Read_Temp_Attribute() is called. In all other cases, readRsp->count equals 0.
I would appreciate any help.
Best regards!
