Hi All,
I am developing product using nRF52840 and SDK nRF5_SDK_for_Thread_and_Zigbee_v3.0.0_d310e71.
This product is basically, using the Thermostat cluster and Zigbee protocol to communicate with the Zigbee gateway.
So, I referred light_bulb example and followed steps to enable "Thermostat cluster and attributes".
I have included the respective files also but I am unable to execute the below callback function case statement,
static zb_void_t zcl_device_cb(zb_uint8_t param) { zb_uint8_t cluster_id; zb_uint8_t attr_id; zb_buf_t * p_buffer = ZB_BUF_FROM_REF(param); zb_zcl_device_callback_param_t * p_device_cb_param = ZB_GET_BUF_PARAM(p_buffer, zb_zcl_device_callback_param_t); NRF_LOG_INFO("zcl_device_cb id %hd", p_device_cb_param->device_cb_id); /* Set default response value. */ p_device_cb_param->status = RET_OK; switch (p_device_cb_param->device_cb_id) { case ZB_ZCL_SET_ATTR_VALUE_CB_ID: cluster_id = p_device_cb_param->cb_param.set_attr_value_param.cluster_id; attr_id = p_device_cb_param->cb_param.set_attr_value_param.attr_id; if (cluster_id == ZB_ZCL_CLUSTER_ID_THERMOSTAT) { uint16_t value = p_device_cb_param->cb_param.set_attr_value_param.values.data16; NRF_LOG_INFO("thermostat local temperature: %d", value); if (attr_id == ZB_ZCL_ATTR_THERMOSTAT_LOCAL_TEMPERATURE_ID) { local_temperature_value(value); } } else { /* Other clusters can be processed here */ NRF_LOG_INFO("Unhandled cluster attribute id: %d", cluster_id); } break; default: p_device_cb_param->status = RET_ERROR; break; } NRF_LOG_INFO("zcl_device_cb status: %hd", p_device_cb_param->status); }
Also, I am attaching code for reference please let me know what else I forgot to enable the functions. It is urgent for me to solve this issue.
And, with these attributes, for some of the commands, I need to implement custom attributes so if you share how to add custom attributes to this cluster.
Thanks in advance.
Regards,
Rohit R