Developing with ZBOSS for Zigbee
ZCL On/Off switch configuration cluster

Macros

#define ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST(attr_list, switch_type, switch_actions)
 Declare attribute list for ON/OFF Switch configuration cluster. More...
 

On/off switch configuration cluster attributes

enum  zb_zcl_on_off_switch_configuration_attr_e { ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_ID = 0x0000, ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_ID = 0x0010 }
 On/off switch configuration cluster attribute identifiers. More...
 
enum  zb_zcl_on_off_switch_configuration_switch_type_e { ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_TOGGLE = 0, ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MOMENTARY = 1, ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MULTIFUNCTION = 2 }
 Permissible values for switch type attribute. More...
 
enum  zb_zcl_on_off_switch_configuration_switch_actions_e { ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TYPE1 = 0, ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TYPE2 = 1, ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TOGGLE = 2 }
 Permissible values for switch actions attribute. More...
 
#define ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MAX_VALUE   (ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MULTIFUNCTION)
 Maximal value for switch type attribute.
 
#define ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_MAX_VALUE   (ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TOGGLE)
 Maximal value for switch actions attribute.
 
#define ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_DEFAULT_VALUE   (ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TYPE1)
 Default value for Switch actions attribute.
 

Detailed Description

On/Off Switch Configuration cluster has no cluster-specific command support. Cluster attributes can be queried with common commands.

Sample switch config cluster attributes data

For more information see devices_generic sample

Macro Definition Documentation

◆ ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST

#define ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST (   attr_list,
  switch_type,
  switch_actions 
)
Value:
ZB_ZCL_START_DECLARE_ATTRIB_LIST(attr_list) \
ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_ID, (switch_type)) \
ZB_ZCL_SET_ATTR_DESC(ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_ID, (switch_actions)) \
ZB_ZCL_FINISH_DECLARE_ATTRIB_LIST

Declare attribute list for ON/OFF Switch configuration cluster.

Parameters
attr_list- attribute list name
switch_type- pointer to variable to store switch type attribute value
switch_actions- pointer to variable to store switch action attribute value

Enumeration Type Documentation

◆ zb_zcl_on_off_switch_configuration_attr_e

On/off switch configuration cluster attribute identifiers.

See also
ZCL spec, subclause 3.9.2.2
Enumerator
ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_ID 

Switch type attribute identifier (switch information)

ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_ID 

Switch actions attribute identifier (switch settings)

◆ zb_zcl_on_off_switch_configuration_switch_actions_e

Permissible values for switch actions attribute.

See also
ZCL spec, subclause 3.9.2.2.3.1
Enumerator
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TYPE1 

First type command pattern.

  • Send "On" on arriving to State2 from State1;
  • Send "Off" on arriving to State1 from State2.
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TYPE2 

Second type command pattern.

  • Send "On" on arriving to State1 from State2;
  • Send "Off" on arriving to State2 from State1.
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_TOGGLE 

Toggle command pattern.

Send "Toggle" on state change

◆ zb_zcl_on_off_switch_configuration_switch_type_e

Permissible values for switch type attribute.

See also
ZCL spec, subclause 3.9.2.2.2
Enumerator
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_TOGGLE 

Toggle switch

ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MOMENTARY 

Momentary switch

ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_MULTIFUNCTION 

Multifunction switch

ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_ID
@ ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_ID
Definition: zb_zcl_on_off_switch_conf.h:61
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_DEFAULT_VALUE
#define ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_DEFAULT_VALUE
Default value for Switch actions attribute.
Definition: zb_zcl_on_off_switch_conf.h:114
zb_uint8_t
unsigned char zb_uint8_t
Project-local 1-byte unsigned int type.
Definition: zb_types.h:145
ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST
#define ZB_ZCL_DECLARE_ON_OFF_SWITCH_CONFIGURATION_ATTRIB_LIST(attr_list, switch_type, switch_actions)
Declare attribute list for ON/OFF Switch configuration cluster.
Definition: zb_zcl_on_off_switch_conf.h:152
ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_ID
@ ZB_ZCL_ATTR_ON_OFF_SWITCH_CONFIGURATION_SWITCH_ACTIONS_ID
Definition: zb_zcl_on_off_switch_conf.h:63
ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_TOGGLE
@ ZB_ZCL_ON_OFF_SWITCH_CONFIGURATION_SWITCH_TYPE_TOGGLE
Definition: zb_zcl_on_off_switch_conf.h:72