Skip to content

Commit a108a1a

Browse files
committed
fix(zigbee): Make sure Indentify callback in not null
1 parent c2e04f8 commit a108a1a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/Zigbee/src/ZigbeeEP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ ZigbeeEP::ZigbeeEP(uint8_t endpoint) {
1616
_endpoint = endpoint;
1717
_ep_config.endpoint = 0;
1818
_cluster_list = nullptr;
19+
_on_identify = nullptr;
1920
#if !CONFIG_DISABLE_HAL_LOCKS
2021
if (!lock) {
2122
lock = xSemaphoreCreateBinary();
@@ -193,7 +194,9 @@ void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute) {
193194

194195
void ZigbeeEP::zbIdentify(const esp_zb_zcl_set_attr_value_message_t *message) {
195196
if (message->attribute.id == ESP_ZB_ZCL_CMD_IDENTIFY_IDENTIFY_ID && message->attribute.data.type == ESP_ZB_ZCL_ATTR_TYPE_U16) {
196-
_on_identify(*(uint16_t *)message->attribute.data.value);
197+
if(_on_identify != NULL) {
198+
_on_identify(*(uint16_t *)message->attribute.data.value);
199+
}
197200
} else {
198201
log_w("Other identify commands are not implemented yet.");
199202
}

0 commit comments

Comments
 (0)