1212#define ZB_CMD_TIMEOUT 10000 // 10 seconds
1313#define OTA_UPGRADE_QUERY_INTERVAL (1 * 60 ) // 1 hour = 60 minutes
1414
15+ typedef enum {
16+ ZB_CMD_READ_ATTRIBUTE = 0x00U , /* !< Read attributes command */
17+ ZB_CMD_READ_ATTRIBUTE_RESPONSE = 0x01U , /* !< Read attributes response command */
18+ ZB_CMD_WRITE_ATTRIBUTE = 0x02U , /* !< Write attributes foundation command */
19+ ZB_CMD_WRITE_ATTRIBUTE_UNDIVIDED = 0x03U , /* !< Write attributes undivided command */
20+ ZB_CMD_WRITE_ATTRIBUTE_RESPONSE = 0x04U , /* !< Write attributes response command */
21+ ZB_CMD_WRITE_ATTRIBUTE_NO_RESPONSE = 0x05U , /* !< Write attributes no response command */
22+ ZB_CMD_CONFIGURE_REPORTING = 0x06U , /* !< Configure reporting command */
23+ ZB_CMD_CONFIGURE_REPORTING_RESPONSE = 0x07U , /* !< Configure reporting response command */
24+ ZB_CMD_READ_REPORTING_CONFIG = 0x08U , /* !< Read reporting config command */
25+ ZB_CMD_READ_REPORTING_CONFIG_RESPONSE= 0x09U , /* !< Read reporting config response command */
26+ ZB_CMD_REPORT_ATTRIBUTE = 0x0aU , /* !< Report attribute command */
27+ ZB_CMD_DEFAULT_RESPONSE = 0x0bU , /* !< Default response command */
28+ ZB_CMD_DISCOVER_ATTRIBUTES = 0x0cU , /* !< Discover attributes command */
29+ ZB_CMD_DISCOVER_ATTRIBUTES_RESPONSE = 0x0dU , /* !< Discover attributes response command */
30+ ZB_CMD_READ_ATTRIBUTE_STRUCTURED = 0x0eU , /* !< Read attributes structured */
31+ ZB_CMD_WRITE_ATTRIBUTE_STRUCTURED = 0x0fU , /* !< Write attributes structured */
32+ ZB_CMD_WRITE_ATTRIBUTE_STRUCTURED_RESPONSE = 0x10U , /* !< Write attributes structured response */
33+ ZB_CMD_DISCOVER_COMMANDS_RECEIVED = 0x11U , /* !< Discover Commands Received command */
34+ ZB_CMD_DISCOVER_COMMANDS_RECEIVED_RESPONSE = 0x12U , /* !< Discover Commands Received response command */
35+ ZB_CMD_DISCOVER_COMMANDS_GENERATED = 0x13U , /* !< Discover Commands Generated command */
36+ ZB_CMD_DISCOVER_COMMANDS_GENERATED_RESPONSE = 0x14U , /* !< Discover Commands Generated response command */
37+ ZB_CMD_DISCOVER_ATTRIBUTES_EXTENDED = 0x15U , /* !< Discover attributes extended command */
38+ ZB_CMD_DISCOVER_ATTRIBUTES_EXTENDED_RESPONSE = 0x16U , /* !< Discover attributes extended response command */
39+ } zb_cmd_type_t ;
40+
1541#define ZB_ARRAY_LENGHT (arr ) (sizeof (arr) / sizeof (arr[0 ]))
1642
1743#define RGB_TO_XYZ (r, g, b, X, Y, Z ) \
@@ -138,6 +164,7 @@ class ZigbeeEP {
138164 virtual void zbReadTimeCluster (const esp_zb_zcl_attribute_t *attribute); // already implemented
139165 virtual void zbIASZoneStatusChangeNotification (const esp_zb_zcl_ias_zone_status_change_notification_message_t *message) {};
140166 virtual void zbIASZoneEnrollResponse (const esp_zb_zcl_ias_zone_enroll_response_message_t *message) {};
167+ virtual void zbDefaultResponse (const esp_zb_zcl_cmd_default_resp_message_t *message); // already implemented
141168
142169 virtual void addBoundDevice (zb_device_params_t *device) {
143170 _bound_devices.push_back (device);
@@ -156,16 +183,22 @@ class ZigbeeEP {
156183 _on_identify = callback;
157184 }
158185
186+ void onDefaultResponse (void (*callback)(zb_cmd_type_t resp_to_cmd, esp_zb_zcl_status_t status)) {
187+ _on_default_response = callback;
188+ }
189+
190+ // Convert ZCL status to name
191+ const char *esp_zb_zcl_status_to_name (esp_zb_zcl_status_t status);
192+
159193private:
160194 char *_read_manufacturer;
161195 char *_read_model;
162196 void (*_on_identify)(uint16_t time);
197+ void (*_on_default_response)(zb_cmd_type_t resp_to_cmd, esp_zb_zcl_status_t status);
163198 time_t _read_time;
164199 int32_t _read_timezone;
165200
166201protected:
167- // Convert ZCL status to name
168- const char *esp_zb_zcl_status_to_name (esp_zb_zcl_status_t status);
169202
170203 uint8_t _endpoint;
171204 esp_zb_ha_standard_devices_t _device_id;
0 commit comments