Skip to content

Commit

Permalink
Merge branch 'fix_generic_switch_feature_check_for_1_4' into 'release…
Browse files Browse the repository at this point in the history
…/v1.4'

[v1.4]backport: components/esp-matter: fix generic switch feature check error

See merge request app-frameworks/esp-matter!1006
  • Loading branch information
chshu committed Jan 8, 2025
2 parents 21913af + d456ac1 commit 22e612f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/esp_matter/esp_matter_feature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2805,7 +2805,7 @@ esp_err_t add(cluster_t *cluster)
uint32_t as_feature_map = feature::action_switch::get_id();
uint32_t ms_feature_map = feature::momentary_switch::get_id();
uint32_t feature_map = get_feature_map_value(cluster);
VerifyOrReturnError(((feature_map & ms_feature_map) != ms_feature_map) || ((feature_map & as_feature_map) == as_feature_map), ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch release is not supported."));
VerifyOrReturnError(((feature_map & ms_feature_map) == ms_feature_map) && ((feature_map & as_feature_map) != as_feature_map), ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch release is not supported."));
update_feature_map(cluster, get_id());

event::create_short_release(cluster);
Expand All @@ -2827,8 +2827,8 @@ esp_err_t add(cluster_t *cluster)
uint32_t as_feature_map = feature::action_switch::get_id();
uint32_t ms_feature_map = feature::momentary_switch::get_id();
uint32_t feature_map = get_feature_map_value(cluster);
VerifyOrReturnError((feature_map & ms_feature_map) != ms_feature_map, ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch long press is not supported."));
VerifyOrReturnError(((feature_map & msr_feature_map) != msr_feature_map) && ((feature_map & as_feature_map) != as_feature_map), ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch long press is not supported."));
VerifyOrReturnError((feature_map & ms_feature_map) == ms_feature_map, ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch long press is not supported."));
VerifyOrReturnError(((feature_map & msr_feature_map) == msr_feature_map) || ((feature_map & as_feature_map) == as_feature_map), ESP_ERR_NOT_SUPPORTED, ESP_LOGE(TAG, "Momentary switch long press is not supported."));
update_feature_map(cluster, get_id());

event::create_long_press(cluster);
Expand Down

0 comments on commit 22e612f

Please sign in to comment.