nRF5 SDK for Thread and Zigbee v1.0.0
Combined interface

Combined Interface device has 3 clusters (see spec 7.4.8):

Combined Interface device sample

Example
Declaring clusters
/******************* Declare attributes ************************/
/* Basic cluster attributes data */
zb_uint8_t g_attr_zcl_version = ZB_ZCL_VERSION;
ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST(basic_attr_list, &g_attr_zcl_version, &g_attr_power_source);
/* Identify cluster attributes data */
zb_uint16_t g_attr_identify_time = 0;
ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &g_attr_identify_time);
/* On/Off switch configuration attribute variables */
ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST(on_off_switch_config_attr_list, &g_switch_type, &g_switch_actions);
/********************* Declare device **************************/
ZB_HA_DECLARE_COMBINED_INTERFACE_CLUSTER_LIST(combined_interface_clusters, basic_attr_list, identify_attr_list);
ZB_HA_DECLARE_COMBINED_INTERFACE_EP(combined_interface_ep, HA_COMBINED_INTERFACE_ENDPOINT, combined_interface_clusters);
ZB_HA_DECLARE_COMBINED_INTERFACE_CTX(combined_interface_ctx, combined_interface_ep);
Registering device list
ZB_AF_REGISTER_DEVICE_CTX(&combined_interface_ctx);
ZB_AF_SET_ENDPOINT_HANDLER(HA_COMBINED_INTERFACE_ENDPOINT, zcl_specific_cluster_cmd_handler);
Example of command handler
zb_uint8_t zcl_specific_cluster_cmd_handler(zb_uint8_t param)
{
zb_buf_t *zcl_cmd_buf = (zb_buf_t *)ZB_BUF_FROM_REF(param);
zb_bool_t cmd_processed = ZB_FALSE;
if (cmd_info->is_common_command)
{
switch (cmd_info->cmd_id)
{
TRACE_MSG(TRACE_ZCL3, "Got response in cluster 0x%04x",
( FMT__D, cmd_info->cluster_id));
/* Process default response */
cmd_processed = ZB_TRUE;
break;
default:
TRACE_MSG(TRACE_ZCL2, "Skip general command %hd", (FMT__H, cmd_info->cmd_id));
break;
}
}

See ha/devices_generic sample


Documentation feedback | Developer Zone | Subscribe | Updated