Merge branch 'fix/1.5/remove-provisional-features' into 'release/v1.5'

Remove Provisional Features from esp-matter as per Matter Spec 1.5

See merge request app-frameworks/esp-matter!1308
This commit is contained in:
Shu Chen
2025-12-26 02:39:02 +00:00
8 changed files with 6 additions and 294 deletions
@@ -304,13 +304,6 @@ attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value)
esp_matter_uint16(value));
}
attribute_t *create_configuration_version(cluster_t *cluster, uint32_t value)
{
return esp_matter::attribute::create(cluster, BasicInformation::Attributes::ConfigurationVersion::Id,
ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint32(value));
}
} /* attribute */
} /* basic_information */
@@ -946,26 +939,6 @@ attribute_t *create_active_network_faults_list(cluster_t *cluster, uint8_t *valu
ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_array(value, length, count));
}
attribute_t *create_ext_address(cluster_t *cluster, nullable<uint64_t> value)
{
// Current CHIP submodule don't have this attribute
// TODO: https://jira.espressif.com:8443/browse/CON-1438
// return esp_matter::attribute::create(cluster,
// ThreadNetworkDiagnostics::Attributes::ExtAddress::Id,
// ATTRIBUTE_FLAG_NULLABLE | ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_nullable_uint64(value));
return NULL;
}
attribute_t *create_rloc16(cluster_t *cluster, nullable<uint16_t> value)
{
// Current CHIP submodule don't have this attribute
// TODO: https://jira.espressif.com:8443/browse/CON-1438
// return esp_matter::attribute::create(cluster,
// ThreadNetworkDiagnostics::Attributes::Rloc16::Id,
// ATTRIBUTE_FLAG_NULLABLE | ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_nullable_uint16(value));
return NULL;
}
attribute_t *create_overrun_count(cluster_t *cluster, uint64_t value)
{
return esp_matter::attribute::create(cluster, ThreadNetworkDiagnostics::Attributes::OverrunCount::Id,
@@ -1414,12 +1387,6 @@ attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint1
ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_array(value, length, count));
}
attribute_t *create_configuration_version(cluster_t *cluster, uint32_t value)
{
return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::ConfigurationVersion::Id,
ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint32(value));
}
} /* attribute */
} /* bridged_device_basic_information */
@@ -1575,24 +1542,6 @@ attribute_t *create_max_level(cluster_t *cluster, uint8_t value)
esp_matter_uint8(value));
}
attribute_t *create_current_frequency(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, LevelControl::Attributes::CurrentFrequency::Id, ATTRIBUTE_FLAG_NONE,
esp_matter_uint16(value));
}
attribute_t *create_min_frequency(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, LevelControl::Attributes::MinFrequency::Id, ATTRIBUTE_FLAG_NONE,
esp_matter_uint16(value));
}
attribute_t *create_max_frequency(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, LevelControl::Attributes::MaxFrequency::Id, ATTRIBUTE_FLAG_NONE,
esp_matter_uint16(value));
}
attribute_t *create_on_off_transition_time(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, LevelControl::Attributes::OnOffTransitionTime::Id,
@@ -4238,16 +4187,6 @@ attribute_t *create_power_step(cluster_t *cluster, uint8_t value)
return esp_matter::attribute::create(cluster, MicrowaveOvenControl::Attributes::PowerStep::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint8(value));
}
attribute_t *create_supported_watts(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count)
{
return esp_matter::attribute::create(cluster, MicrowaveOvenControl::Attributes::SupportedWatts::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_array(value, length, count));
}
attribute_t *create_selected_watt_index(cluster_t *cluster, uint8_t value)
{
return esp_matter::attribute::create(cluster, MicrowaveOvenControl::Attributes::SelectedWattIndex::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint8(value));
}
attribute_t *create_watt_rating(cluster_t *cluster, uint16_t value)
{
return esp_matter::attribute::create(cluster, MicrowaveOvenControl::Attributes::WattRating::Id, ATTRIBUTE_FLAG_MANAGED_INTERNALLY, esp_matter_uint16(value));
@@ -87,7 +87,6 @@ attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length);
attribute_t *create_capability_minima(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_specification_version(cluster_t *cluster, uint32_t value);
attribute_t *create_max_paths_per_invoke(cluster_t *cluster, uint16_t value);
attribute_t *create_configuration_version(cluster_t *cluster, uint32_t value);
/** These attributes are optional for the cluster, but when added to this cluster, the value is maintained internally.
* If the attributes are added in some other cluster, then the value is not maintained internally.
@@ -258,8 +257,6 @@ attribute_t *create_security_policy(cluster_t *cluster, uint8_t *value, uint16_t
attribute_t *create_channel_page0_mask(cluster_t *cluster, uint8_t *value, uint16_t length);
attribute_t *create_operational_dataset_components(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_active_network_faults_list(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_ext_address(cluster_t *cluster, nullable<uint64_t> value);
attribute_t *create_rloc16(cluster_t *cluster, nullable<uint16_t> value);
attribute_t *create_overrun_count(cluster_t *cluster, uint64_t value);
attribute_t *create_detached_role_count(cluster_t *cluster, uint16_t value);
attribute_t *create_child_role_count(cluster_t *cluster, uint16_t value);
@@ -358,7 +355,6 @@ attribute_t *create_serial_number(cluster_t *cluster, char *value, uint16_t leng
attribute_t *create_reachable(cluster_t *cluster, bool value);
attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length);
attribute_t *create_product_appearance(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_configuration_version(cluster_t *cluster, uint32_t *value);
} /* attribute */
} /* bridged_device_basic_information */
@@ -413,9 +409,6 @@ attribute_t *create_options(cluster_t *cluster, uint8_t value);
attribute_t *create_remaining_time(cluster_t *cluster, uint16_t value);
attribute_t *create_min_level(cluster_t *cluster, uint8_t value);
attribute_t *create_max_level(cluster_t *cluster, uint8_t value);
attribute_t *create_current_frequency(cluster_t *cluster, uint16_t value);
attribute_t *create_min_frequency(cluster_t *cluster, uint16_t value);
attribute_t *create_max_frequency(cluster_t *cluster, uint16_t value);
attribute_t *create_on_off_transition_time(cluster_t *cluster, uint16_t value);
attribute_t *create_on_transition_time(cluster_t* cluster, nullable<uint16_t> value);
attribute_t *create_off_transition_time(cluster_t* cluster, nullable<uint16_t> value);
@@ -1069,8 +1062,6 @@ attribute_t *create_power_setting(cluster_t *cluster, uint8_t value);
attribute_t *create_min_power(cluster_t *cluster, uint8_t value);
attribute_t *create_max_power(cluster_t *cluster, uint8_t value);
attribute_t *create_power_step(cluster_t *cluster, uint8_t value);
attribute_t *create_supported_watts(cluster_t *cluster, uint8_t *value, uint16_t length, uint16_t count);
attribute_t *create_selected_watt_index(cluster_t *cluster, uint8_t value);
attribute_t *create_watt_rating(cluster_t *cluster, uint16_t value);
} /* attribute */
} /* microwave_oven_control */
@@ -121,45 +121,6 @@ void add_bounds_cb(cluster_t *cluster)
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint8(min), esp_matter_uint8(max));
break;
}
case LevelControl::Attributes::CurrentFrequency::Id: {
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
uint16_t min = 0, max = UINT16_MAX;
if(cluster::get_attribute_value(cluster, LevelControl::Attributes::MinFrequency::Id,
&min_val) == ESP_OK)
{
min = min_val.val.u16;
}
if(cluster::get_attribute_value(cluster, LevelControl::Attributes::MaxFrequency::Id,
&max_val) == ESP_OK)
{
max = max_val.val.u16;
}
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint16(min), esp_matter_uint16(max));
break;
}
case LevelControl::Attributes::MinFrequency::Id: {
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
uint16_t min = 0, max = UINT16_MAX;
if(cluster::get_attribute_value(cluster, LevelControl::Attributes::MaxFrequency::Id,
&max_val) == ESP_OK)
{
max = max_val.val.u16;
}
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint16(min), esp_matter_uint16(max));
break;
}
case LevelControl::Attributes::MaxFrequency::Id: {
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
uint16_t min = 0, max = UINT16_MAX;
if(cluster::get_attribute_value(cluster, LevelControl::Attributes::MinFrequency::Id,
&min_val) == ESP_OK)
{
min = min_val.val.u16;
}
esp_matter::attribute::add_bounds(current_attribute, esp_matter_uint16(min), esp_matter_uint16(max));
break;
}
case LevelControl::Attributes::OnLevel::Id: {
esp_matter_attr_val_t min_val = esp_matter_invalid(NULL);
esp_matter_attr_val_t max_val = esp_matter_invalid(NULL);
@@ -322,7 +322,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
attribute::create_capability_minima(cluster, NULL, 0, 0);
attribute::create_specification_version(cluster, 0);
attribute::create_max_paths_per_invoke(cluster, 0);
attribute::create_configuration_version(cluster, 0);
/* Attributes not managed internally */
global::attribute::create_cluster_revision(cluster, cluster_revision);
@@ -2991,8 +2990,8 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
global::attribute::create_feature_map(cluster, config->feature_flags);
// check against O.a feature conformance for microwave oven control
VALIDATE_FEATURES_EXACT_ONE("PowerAsNumber,PowerInWatts",
feature::power_as_number::get_id(), feature::power_in_watts::get_id());
VALIDATE_FEATURES_EXACT_ONE("PowerAsNumber",
feature::power_as_number::get_id());
if (has(feature::power_as_number::get_id())) {
feature::power_as_number::add(cluster);
@@ -3002,9 +3001,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
feature::power_number_limits::add(cluster);
}
}
if (has(feature::power_in_watts::get_id())) {
feature::power_in_watts::add(cluster);
}
} // if (flags & CLUSTER_FLAG_SERVER)
/* Commands */
@@ -2035,13 +2035,6 @@ command_t *create_stop_with_on_off(cluster_t *cluster)
esp_matter_command_callback_stop_with_on_off);
}
command_t *create_move_to_closest_frequency(cluster_t *cluster)
{
return esp_matter::command::create(cluster, LevelControl::Commands::MoveToClosestFrequency::Id, COMMAND_FLAG_ACCEPTED,
// Command callback not implemented in connectedhomeip.
NULL);
}
} /* command */
} /* level_control */
@@ -251,7 +251,6 @@ command_t *create_move_to_level_with_on_off(cluster_t *cluster);
command_t *create_move_with_on_off(cluster_t *cluster);
command_t *create_step_with_on_off(cluster_t *cluster);
command_t *create_stop_with_on_off(cluster_t *cluster);
command_t *create_move_to_closest_frequency(cluster_t *cluster);
} /* command */
} /* level_control */
@@ -564,29 +564,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
} /* lighting */
namespace frequency {
uint32_t get_id()
{
return (uint32_t)LevelControl::Feature::kFrequency;
}
esp_err_t add(cluster_t *cluster, config_t *config)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
update_feature_map(cluster, get_id());
/* Attributes not managed internally */
attribute::create_current_frequency(cluster, config->current_frequency);
attribute::create_min_frequency(cluster, config->min_frequency);
attribute::create_max_frequency(cluster, config->max_frequency);
/* Commands */
command::create_move_to_closest_frequency(cluster);
return ESP_OK;
}
} /* frequency */
} /* feature */
} /* level_control */
@@ -2608,55 +2585,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
} /* rfid_credential */
namespace finger_credentials {
uint32_t get_id()
{
return (uint32_t)DoorLock::Feature::kFingerCredentials;
}
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
update_feature_map(cluster, get_id());
uint32_t usr_feature_map = feature::user::get_id();
if (!(get_feature_map_value(cluster) & usr_feature_map)) {
/* todo: some commands for !USR & FGP feature not define in the
connectedhomeip/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
will update when added*/
}
return ESP_OK;
}
} /* finger_credentials */
namespace logging {
uint32_t get_id()
{
return (uint32_t)DoorLock::Feature::kLogging;
}
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
update_feature_map(cluster, get_id());
/* todo: all attributes for LOG feature not define in the
connectedhomeip/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h
will update when added*/
/* todo: all commands for LOG feature not define in the
connectedhomeip/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
will update when added*/
return ESP_OK;
}
} /* logging */
namespace weekday_access_schedules {
uint32_t get_id()
@@ -2705,22 +2633,6 @@ esp_err_t add(cluster_t *cluster)
} /* door_position_sensor */
namespace face_credentials {
uint32_t get_id()
{
return (uint32_t)DoorLock::Feature::kFaceCredentials;
}
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
update_feature_map(cluster, get_id());
return ESP_OK;
}
} /* face_credentials */
namespace credential_over_the_air_access {
@@ -2757,10 +2669,8 @@ esp_err_t add(cluster_t *cluster, config_t *config)
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
uint32_t pin = feature::pin_credential::get_id();
uint32_t rid = feature::rfid_credential::get_id();
uint32_t fgp = feature::finger_credentials::get_id();
uint32_t face = feature::face_credentials::get_id();
uint32_t feature = get_feature_map_value(cluster);
VerifyOrReturnError((feature & (pin | rid | fgp | face)) != 0, ESP_FAIL, ESP_LOGE(TAG, "Should add at least one of PIN, RID, FGP and FACE feature before add USR feature"));
VerifyOrReturnError((feature & (pin | rid)) != 0, ESP_FAIL, ESP_LOGE(TAG, "Should add at least one of PIN, RID feature before add USR feature"));
update_feature_map(cluster, get_id());
@@ -2788,22 +2698,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
} /* user */
namespace notification {
uint32_t get_id()
{
return (uint32_t)DoorLock::Feature::kNotification;
}
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
update_feature_map(cluster, get_id());
return ESP_OK;
}
} /* notification */
namespace year_day_access_schedules {
@@ -3063,45 +2957,14 @@ uint32_t get_id()
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
uint32_t power_in_watts_feature_map = feature::power_in_watts::get_id();
if ((get_feature_map_value(cluster) & power_in_watts_feature_map) != power_in_watts_feature_map) {
update_feature_map(cluster, get_id());
/* Attributes managed internally */
attribute::create_power_setting(cluster, 0);
} else {
ESP_LOGE(TAG, "Cluster shall support either PowerAsNumber or PowerInWatts feature");
return ESP_ERR_NOT_SUPPORTED;
}
update_feature_map(cluster, get_id());
/* Attributes managed internally */
attribute::create_power_setting(cluster, 0);
return ESP_OK;
}
} /* power_as_number */
namespace power_in_watts {
uint32_t get_id()
{
return (uint32_t)MicrowaveOvenControl::Feature::kPowerInWatts;
}
esp_err_t add(cluster_t *cluster)
{
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
uint32_t power_as_number_feature_map = feature::power_as_number::get_id();
if ((get_feature_map_value(cluster) & power_as_number_feature_map) != power_as_number_feature_map) {
update_feature_map(cluster, get_id());
/* Attributes managed internally */
attribute::create_supported_watts(cluster, NULL, 0, 0);
attribute::create_selected_watt_index(cluster, 0);
} else {
ESP_LOGE(TAG, "Cluster shall support either PowerInWatts or PowerAsNumber feature");
return ESP_ERR_NOT_SUPPORTED;
}
return ESP_OK;
}
} /* power_in_watts */
namespace power_number_limits {
uint32_t get_id()
@@ -262,18 +262,6 @@ esp_err_t add(cluster_t *cluster, config_t *config);
} /* lighting */
namespace frequency {
typedef struct config {
uint16_t current_frequency;
uint16_t min_frequency;
uint16_t max_frequency;
config() : current_frequency(0), min_frequency(0), max_frequency(0) {}
} config_t;
uint32_t get_id();
esp_err_t add(cluster_t *cluster, config_t *config);
} /* frequency */
} /* feature */
} /* level_control */
@@ -1290,12 +1278,6 @@ uint32_t get_id();
esp_err_t add(cluster_t *cluster, config_t *config);
} /* rfid_credential */
namespace finger_credentials {
uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* finger_credentials */
namespace weekday_access_schedules {
uint32_t get_id();
@@ -1308,12 +1290,6 @@ uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* door_position_sensor */
namespace face_credentials {
uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* face_credentials */
namespace credential_over_the_air_access {
typedef struct config {
bool require_pin_for_remote_operation;
@@ -1428,12 +1404,6 @@ uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* power_as_number */
namespace power_in_watts {
uint32_t get_id();
esp_err_t add(cluster_t *cluster);
} /* power_in_watts */
namespace power_number_limits {
uint32_t get_id();