Skip to content

Commit

Permalink
Merge branch 'fix-device-add' into 'main'
Browse files Browse the repository at this point in the history
components/esp-matter: code size optimization when adding device types

See merge request app-frameworks/esp-matter!1011
  • Loading branch information
dhrishi committed Feb 11, 2025
2 parents 6aa71da + b4651a1 commit bcca1f1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 319 deletions.
3 changes: 2 additions & 1 deletion components/esp_matter/esp_matter_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1876,7 +1876,8 @@ esp_err_t add_device_type(endpoint_t *endpoint, uint32_t device_type_id, uint8_t
{
VerifyOrReturnError(endpoint, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Endpoint cannot be NULL"));
_endpoint_t *current_endpoint = (_endpoint_t *)endpoint;
VerifyOrReturnError(current_endpoint->device_type_count < ESP_MATTER_MAX_DEVICE_TYPE_COUNT, ESP_FAIL, ESP_LOGE(TAG, "Could not add a new device type to the endpoint"));
VerifyOrReturnError(current_endpoint->device_type_count < ESP_MATTER_MAX_DEVICE_TYPE_COUNT, ESP_FAIL,
ESP_LOGE(TAG, "Could not add a new device-type:%" PRIu32 " to the endpoint", device_type_id));
current_endpoint->device_type_ids[current_endpoint->device_type_count] = device_type_id;
current_endpoint->device_type_versions[current_endpoint->device_type_count] = device_type_version;
current_endpoint->device_type_count++;
Expand Down
Loading

0 comments on commit bcca1f1

Please sign in to comment.