Skip to content

Commit

Permalink
Merge branch 'fix/priv_data_in_override_cb' into 'main'
Browse files Browse the repository at this point in the history
fixed the override callback to pass priv data

See merge request app-frameworks/esp-matter!611
  • Loading branch information
dhrishi committed Jan 23, 2024
2 parents d947231 + 30bfa5e commit c11e9a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions components/esp_matter/esp_matter_attribute_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1012,12 +1012,14 @@ static esp_err_t execute_override_callback(attribute_t *attribute, callback_type
uint32_t cluster_id, uint32_t attribute_id, esp_matter_attr_val_t *val)
{
callback_t override_callback = attribute::get_override_callback(attribute);
void *priv_data = endpoint::get_priv_data(endpoint_id);
if (override_callback) {
return override_callback(type, endpoint_id, cluster_id, attribute_id, val, NULL);
return override_callback(type, endpoint_id, cluster_id, attribute_id, val, priv_data);
} else {
ESP_LOGI(TAG, "Attribute override callback not set for Endpoint 0x%04" PRIX16 "'s Cluster 0x%08" PRIX32 "'s Attribute 0x%08" PRIX32 ", calling the common callback",
endpoint_id, cluster_id, attribute_id);
return execute_callback(type, endpoint_id, cluster_id, attribute_id, val);
if (attribute_callback)
return attribute_callback(type, endpoint_id, cluster_id, attribute_id, val, priv_data);
}
return ESP_OK;
}
Expand Down

0 comments on commit c11e9a1

Please sign in to comment.