From d4c8b657726112c21226773d47db5d4ea2c7e76f Mon Sep 17 00:00:00 2001 From: PSONALl Date: Fri, 25 Aug 2023 17:23:59 +0530 Subject: [PATCH] Matter v1.2 TE-2 optional features and submodule update --- .gitlab-ci.yml | 2 + components/esp_matter/CMakeLists.txt | 2 +- .../esp_matter/esp_matter_attribute.cpp | 176 +++--------------- components/esp_matter/esp_matter_attribute.h | 38 +--- components/esp_matter/esp_matter_cluster.cpp | 19 +- components/esp_matter/esp_matter_feature.cpp | 90 ++++++++- components/esp_matter/esp_matter_feature.h | 33 ++++ components/esp_matter/idf_component.yml | 11 -- .../zap_common/zap-generated/gen_config.h | 2 + connectedhomeip/connectedhomeip | 2 +- examples/all_device_types_app/CMakeLists.txt | 2 +- .../all_device_types_app/main/CMakeLists.txt | 2 +- examples/blemesh_bridge/CMakeLists.txt | 2 +- examples/blemesh_bridge/main/CMakeLists.txt | 2 +- examples/controller/CMakeLists.txt | 2 +- examples/controller/main/CMakeLists.txt | 2 +- examples/esp-now_bridge_light/CMakeLists.txt | 2 +- .../esp-now_bridge_light/main/CMakeLists.txt | 2 +- examples/generic_switch/CMakeLists.txt | 2 +- examples/generic_switch/main/CMakeLists.txt | 2 +- examples/light/CMakeLists.txt | 2 +- examples/light/main/CMakeLists.txt | 2 +- examples/light_switch/CMakeLists.txt | 2 +- examples/light_switch/main/CMakeLists.txt | 2 +- examples/mfg_test_app/CMakeLists.txt | 2 +- examples/mfg_test_app/main/CMakeLists.txt | 2 +- examples/refrigerator/CMakeLists.txt | 2 +- examples/refrigerator/main/CMakeLists.txt | 2 +- examples/room_air_conditioner/CMakeLists.txt | 2 +- .../room_air_conditioner/main/CMakeLists.txt | 2 +- examples/zap_light/CMakeLists.txt | 2 +- examples/zap_light/main/CMakeLists.txt | 2 +- examples/zigbee_bridge/CMakeLists.txt | 2 +- examples/zigbee_bridge/main/CMakeLists.txt | 2 +- 34 files changed, 195 insertions(+), 228 deletions(-) delete mode 100644 components/esp_matter/idf_component.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0f14b8879..35c054279 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -255,6 +255,8 @@ build_esp_matter_examples_pytest_C3_idf_v4_4: variables: IDF_VERSION: "v4.4.3" script: + - cd ${IDF_PATH} + - rm -rf components/cbor - cd ${ESP_MATTER_PATH} - pip install -r tools/ci/requirements-build.txt - python tools/ci/build_apps.py ./examples --pytest_c3 diff --git a/components/esp_matter/CMakeLists.txt b/components/esp_matter/CMakeLists.txt index d267bb495..5c21bd7c5 100644 --- a/components/esp_matter/CMakeLists.txt +++ b/components/esp_matter/CMakeLists.txt @@ -19,7 +19,7 @@ endforeach() set(INCLUDE_DIRS_LIST "." "${MATTER_SDK_PATH}/zzz_generated/app-common" - "${MATTER_SDK_PATH}/third_party/nlfaultinjection/repo/include" + "${MATTER_SDK_PATH}/third_party/nlfaultinjection/include" "${MATTER_SDK_PATH}/src") if (CONFIG_ESP_MATTER_ENABLE_DATA_MODEL) diff --git a/components/esp_matter/esp_matter_attribute.cpp b/components/esp_matter/esp_matter_attribute.cpp index 99b5b769a..1e97b4f76 100644 --- a/components/esp_matter/esp_matter_attribute.cpp +++ b/components/esp_matter/esp_matter_attribute.cpp @@ -147,10 +147,6 @@ attribute_t *create_data_model_revision(cluster_t *cluster, uint16_t value) attribute_t *create_vendor_name(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_vendor_name_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::VendorName::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -163,10 +159,6 @@ attribute_t *create_vendor_id(cluster_t *cluster, uint16_t value) attribute_t *create_product_name(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_name_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::ProductName::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -190,10 +182,6 @@ attribute_t *create_node_label(cluster_t *cluster, char *value, uint16_t length) attribute_t *create_location(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_location_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::Location::Id, ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_char_str(value, length)); @@ -207,10 +195,6 @@ attribute_t *create_hardware_version(cluster_t *cluster, uint16_t value) attribute_t *create_hardware_version_string(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_version_string_length || length > k_max_version_string_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::HardwareVersionString::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -223,10 +207,6 @@ attribute_t *create_software_version(cluster_t *cluster, uint32_t value) attribute_t *create_software_version_string(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_version_string_length || length > k_max_version_string_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::SoftwareVersionString::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -239,50 +219,30 @@ attribute_t *create_capability_minima(cluster_t *cluster, uint8_t *value, uint16 attribute_t *create_manufacturing_date(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_manufacturing_date_length || length > k_max_manufacturing_date_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::ManufacturingDate::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_part_number(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_part_number_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::PartNumber::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_product_url(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_url_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::ProductURL::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_product_label(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_label_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::ProductLabel::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_serial_number(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_serial_number_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::SerialNumber::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -301,10 +261,6 @@ attribute_t *create_reachable(cluster_t *cluster, bool value) attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_unique_id_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BasicInformation::Attributes::UniqueID::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -784,10 +740,6 @@ namespace attribute { attribute_t *create_vendor_name(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_vendor_name_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::VendorName::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -800,10 +752,6 @@ attribute_t *create_vendor_id(cluster_t *cluster, uint16_t value) attribute_t *create_product_name(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_name_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::ProductName::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -827,10 +775,6 @@ attribute_t *create_hardware_version(cluster_t *cluster, uint16_t value) attribute_t *create_hardware_version_string(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_version_string_length || length > k_max_version_string_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::HardwareVersionString::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -843,60 +787,36 @@ attribute_t *create_software_version(cluster_t *cluster, uint32_t value) attribute_t *create_software_version_string(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_version_string_length || length > k_max_version_string_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::SoftwareVersionString::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_manufacturing_date(cluster_t *cluster, char *value, uint16_t length) { - if (length < k_min_manufacturing_date_length || length > k_max_manufacturing_date_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::ManufacturingDate::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_part_number(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_part_number_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::PartNumber::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_product_url(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_url_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::ProductURL::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_product_label(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_product_label_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::ProductLabel::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } attribute_t *create_serial_number(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_serial_number_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::SerialNumber::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -909,10 +829,6 @@ attribute_t *create_reachable(cluster_t *cluster, bool value) attribute_t *create_unique_id(cluster_t *cluster, char *value, uint16_t length) { - if (length > k_max_unique_id_length) { - ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); - return NULL; - } return esp_matter::attribute::create(cluster, BridgedDeviceBasicInformation::Attributes::UniqueID::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str(value, length)); } @@ -1199,30 +1115,16 @@ attribute_t *create_current_saturation(cluster_t *cluster, uint8_t value, uint8_ return attribute; } -attribute_t *create_remaining_time(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max) +attribute_t *create_remaining_time(cluster_t *cluster, uint16_t value) { - attribute_t *attribute = - esp_matter::attribute::create(cluster, ColorControl::Attributes::RemainingTime::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::RemainingTime::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_uint16(min), esp_matter_uint16(max)); - return attribute; } -attribute_t *create_color_mode(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max) +attribute_t *create_color_mode(cluster_t *cluster, uint8_t value) { - attribute_t *attribute = - esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorMode::Id, ATTRIBUTE_FLAG_NONVOLATILE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::ColorMode::Id, ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_enum8(value)); - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_enum8(min), esp_matter_enum8(max)); - return attribute; } attribute_t *create_color_control_options(cluster_t *cluster, uint8_t value) @@ -1309,18 +1211,11 @@ attribute_t *create_couple_color_temp_to_level_min_mireds(cluster_t *cluster, ui return attribute; } -attribute_t *create_startup_color_temperature_mireds(cluster_t *cluster, nullable value, uint16_t min, uint16_t max) +attribute_t *create_startup_color_temperature_mireds(cluster_t *cluster, nullable value) { - attribute_t *attribute = - esp_matter::attribute::create(cluster, ColorControl::Attributes::StartUpColorTemperatureMireds::Id, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::StartUpColorTemperatureMireds::Id, ATTRIBUTE_FLAG_NULLABLE | ATTRIBUTE_FLAG_WRITABLE | ATTRIBUTE_FLAG_NONVOLATILE, esp_matter_nullable_uint16(value)); - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_uint16(min), esp_matter_uint16(max)); - return attribute; } attribute_t *create_current_x(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max) @@ -1408,96 +1303,77 @@ attribute_t *create_color_loop_stored_enhanced_hue(cluster_t *cluster, uint16_t ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); } -attribute_t *create_number_of_primaries(cluster_t *cluster, nullable value, uint8_t min, uint8_t max) +attribute_t *create_number_of_primaries(cluster_t *cluster, nullable value) { - attribute_t *attribute = - esp_matter::attribute::create(cluster, ColorControl::Attributes::NumberOfPrimaries::Id, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::NumberOfPrimaries::Id, ATTRIBUTE_FLAG_NULLABLE, esp_matter_nullable_uint8(value)); - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_uint8(min), esp_matter_uint8(max)); - return attribute; } -attribute_t *create_primary_n_x(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max, uint8_t index) +attribute_t *create_primary_n_x(cluster_t *cluster, uint16_t value, uint8_t index) { - attribute_t *attribute = NULL; switch (index) { case 1: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary1X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary1X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 2: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary2X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary2X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 3: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary3X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary3X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 4: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary4X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary4X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 5: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary5X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary5X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 6: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary6X::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary6X::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; default: break; } + return NULL; - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_uint16(min), esp_matter_uint16(max)); - return attribute; } -attribute_t *create_primary_n_y(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max, uint8_t index) +attribute_t *create_primary_n_y(cluster_t *cluster, uint16_t value, uint8_t index) { - attribute_t *attribute = NULL; switch (index) { case 1: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary1Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary1Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 2: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary2Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary2Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 3: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary3Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary3Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 4: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary4Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary4Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 5: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary5Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary5Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; case 6: - attribute = esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary6Y::Id, ATTRIBUTE_FLAG_NONE, + return esp_matter::attribute::create(cluster, ColorControl::Attributes::Primary6Y::Id, ATTRIBUTE_FLAG_NONE, esp_matter_uint16(value)); break; default: break; } - if (!attribute) { - ESP_LOGE(TAG, "Could not create attribute"); - return NULL; - } - esp_matter::attribute::add_bounds(attribute, esp_matter_uint16(min), esp_matter_uint16(max)); - return attribute; + return NULL; } attribute_t *create_primary_n_intensity(cluster_t *cluster, nullable value, uint8_t index) @@ -2589,6 +2465,10 @@ namespace attribute { attribute_t *create_mode_select_description(cluster_t *cluster, const char * value, uint16_t length) { + if (length > k_max_mode_select_description_length) { + ESP_LOGE(TAG, "Could not create attribute, string length out of bound"); + return NULL; + } return esp_matter::attribute::create(cluster, ModeSelect::Attributes::Description::Id, ATTRIBUTE_FLAG_NONE, esp_matter_char_str((char *)value, length)); } diff --git a/components/esp_matter/esp_matter_attribute.h b/components/esp_matter/esp_matter_attribute.h index ed8571bdf..a0583466c 100644 --- a/components/esp_matter/esp_matter_attribute.h +++ b/components/esp_matter/esp_matter_attribute.h @@ -62,19 +62,7 @@ attribute_t *create_access_control_entries_per_fabric(cluster_t *cluster, uint16 } /* access_control */ namespace basic_information { -constexpr uint8_t k_max_vendor_name_length = 32; -constexpr uint8_t k_max_product_name_length = 32; constexpr uint8_t k_max_node_label_length = 32; -constexpr uint8_t k_max_location_length = 2; -constexpr uint8_t k_min_version_string_length = 1; -constexpr uint8_t k_max_version_string_length = 64; -constexpr uint8_t k_min_manufacturing_date_length = 8; -constexpr uint8_t k_max_manufacturing_date_length = 16; -constexpr uint8_t k_max_part_number_length = 32; -constexpr uint8_t k_max_product_url_length = 32; -constexpr uint8_t k_max_product_label_length = 32; -constexpr uint8_t k_max_serial_number_length = 32; -constexpr uint8_t k_max_unique_id_length = 32; namespace attribute { attribute_t *create_data_model_revision(cluster_t *cluster, uint16_t value); @@ -230,19 +218,7 @@ attribute_t *create_active_network_faults(cluster_t *cluster, uint8_t *value, ui } /* diagnostics_network_thread */ namespace bridged_device_basic_information { -constexpr uint8_t k_max_vendor_name_length = 32; -constexpr uint8_t k_max_product_name_length = 32; constexpr uint8_t k_max_node_label_length = 32; -constexpr uint8_t k_max_location_length = 2; -constexpr uint8_t k_min_version_string_length = 1; -constexpr uint8_t k_max_version_string_length = 64; -constexpr uint8_t k_min_manufacturing_date_length = 8; -constexpr uint8_t k_max_manufacturing_date_length = 16; -constexpr uint8_t k_max_part_number_length = 32; -constexpr uint8_t k_max_product_url_length = 32; -constexpr uint8_t k_max_product_label_length = 32; -constexpr uint8_t k_max_serial_number_length = 32; -constexpr uint8_t k_max_unique_id_length = 32; namespace attribute { attribute_t *create_vendor_name(cluster_t *cluster, char *value, uint16_t length); @@ -339,8 +315,8 @@ constexpr uint8_t k_max_compensation_text_length = 254; namespace attribute { attribute_t *create_current_hue(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max); attribute_t *create_current_saturation(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max); -attribute_t *create_remaining_time(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); -attribute_t *create_color_mode(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max); +attribute_t *create_remaining_time(cluster_t *cluster, uint16_t value); +attribute_t *create_color_mode(cluster_t *cluster, uint8_t value); attribute_t *create_color_control_options(cluster_t *cluster, uint8_t value); attribute_t *create_enhanced_color_mode(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max); attribute_t *create_color_capabilities(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); @@ -348,7 +324,7 @@ attribute_t *create_color_temperature_mireds(cluster_t *cluster, uint16_t value, attribute_t *create_color_temp_physical_min_mireds(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); attribute_t *create_color_temp_physical_max_mireds(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); attribute_t *create_couple_color_temp_to_level_min_mireds(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); -attribute_t *create_startup_color_temperature_mireds(cluster_t *cluster, nullable value, uint16_t min, uint16_t max); +attribute_t *create_startup_color_temperature_mireds(cluster_t *cluster, nullable value); attribute_t *create_current_x(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); attribute_t *create_current_y(cluster_t *cluster, uint16_t value, uint16_t min, uint16_t max); attribute_t *create_drift_compensation(cluster_t *cluster, uint8_t value, uint8_t min, uint8_t max); @@ -359,9 +335,9 @@ attribute_t *create_color_loop_direction(cluster_t *cluster, uint8_t value); attribute_t *create_color_loop_time(cluster_t *cluster, uint16_t value); attribute_t *create_color_loop_start_enhanced_hue(cluster_t *cluster, uint16_t value); attribute_t *create_color_loop_stored_enhanced_hue(cluster_t *cluster, uint16_t value); -attribute_t *create_number_of_primaries(cluster_t *cluster, nullable value, uint8_t min, uint8_t max); -attribute_t *create_primary_n_x(cluster_t * cluster, uint16_t value, uint16_t min, uint16_t max, uint8_t index); -attribute_t *create_primary_n_y(cluster_t * cluster, uint16_t value, uint16_t min, uint16_t max, uint8_t index); +attribute_t *create_number_of_primaries(cluster_t *cluster, nullable value); +attribute_t *create_primary_n_x(cluster_t * cluster, uint16_t value, uint8_t index); +attribute_t *create_primary_n_y(cluster_t * cluster, uint16_t value, uint8_t index); attribute_t *create_primary_n_intensity(cluster_t * cluster, nullable value, uint8_t index); } /* attribute */ } /* color_control */ @@ -591,6 +567,8 @@ attribute_t *create_control_mode(cluster_t *cluster, uint8_t value); } /* pump_configuration_and_control */ namespace mode_select { +constexpr uint8_t k_max_mode_select_description_length = 64; + namespace attribute { attribute_t *create_mode_select_description(cluster_t *cluster, const char * value, uint16_t length); attribute_t *create_standard_namespace(cluster_t *cluster, const nullable value); diff --git a/components/esp_matter/esp_matter_cluster.cpp b/components/esp_matter/esp_matter_cluster.cpp index 312e71cdb..a18eadfdf 100644 --- a/components/esp_matter/esp_matter_cluster.cpp +++ b/components/esp_matter/esp_matter_cluster.cpp @@ -83,7 +83,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ - global::attribute::create_cluster_revision(cluster, 0); attribute::create_device_list(cluster, NULL, 0, 0); attribute::create_server_list(cluster, NULL, 0, 0); attribute::create_client_list(cluster, NULL, 0, 0); @@ -164,7 +163,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ - global::attribute::create_cluster_revision(cluster, 0); attribute::create_acl(cluster, NULL, 0, 0); attribute::create_subjects_per_access_control_entry(cluster, 0); attribute::create_access_control_entries_per_fabric(cluster, 0); @@ -382,7 +380,6 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags) if (flags & CLUSTER_FLAG_SERVER) { /* Attributes managed internally */ global::attribute::create_feature_map(cluster, 0); - attribute::create_breadcrumb(cluster, 0); global::attribute::create_event_list(cluster, NULL, 0, 0); attribute::create_regulatory_config(cluster, 0); attribute::create_location_capability(cluster, 0); @@ -1210,24 +1207,28 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_ /* Attributes not managed internally */ if (config) { global::attribute::create_cluster_revision(cluster, config->cluster_revision); - attribute::create_color_mode(cluster, config->color_mode, 0, 2); + attribute::create_color_mode(cluster, config->color_mode); attribute::create_color_control_options(cluster, config->color_control_options); attribute::create_enhanced_color_mode(cluster, config->enhanced_color_mode, 0, 3); attribute::create_color_capabilities(cluster, config->color_capabilities, 0, 0x001f); - attribute::create_number_of_primaries(cluster, config->number_of_primaries, 0, 6); + attribute::create_number_of_primaries(cluster, config->number_of_primaries); } else { ESP_LOGE(TAG, "Config is NULL. Cannot add some attributes."); } /* Attributes managed internally */ - attribute::create_remaining_time(cluster, 0, 0, 65534); - uint16_t max_primary_value = static_cast(0xfeff); + attribute::create_remaining_time(cluster, 0); for (uint8_t idx = 1; idx <= config->number_of_primaries.value_or(0); ++idx) { - attribute::create_primary_n_x(cluster, 0, idx, 0, max_primary_value); - attribute::create_primary_n_y(cluster, 0, idx, 0, max_primary_value); + attribute::create_primary_n_x(cluster, 0, idx); + attribute::create_primary_n_y(cluster, 0, idx); attribute::create_primary_n_intensity(cluster, nullable(), idx); } } + + /* Commands */ + if (features & feature::hue_saturation::get_id() || features & feature::color_temperature::get_id() || features & feature::xy::get_id()) { + command::create_stop_move_step(cluster); + } /* Features */ if (features & feature::hue_saturation::get_id()) { diff --git a/components/esp_matter/esp_matter_feature.cpp b/components/esp_matter/esp_matter_feature.cpp index c2eebfc8c..0f1a1820c 100644 --- a/components/esp_matter/esp_matter_feature.cpp +++ b/components/esp_matter/esp_matter_feature.cpp @@ -179,6 +179,91 @@ esp_err_t add(cluster_t *cluster, config_t *config) } /* feature */ } /* power_source */ +namespace scenes { +namespace feature { +namespace scene_names { + +uint32_t get_id() +{ + return (uint32_t)Scenes::Feature::kSceneNames; +} + +esp_err_t add(cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + update_feature_map(cluster, get_id()); + + return ESP_OK; +} + +} /* scene_names */ + +namespace explicit_feature { + +uint32_t get_id() +{ + return (uint32_t)Scenes::Feature::kExplicit; +} + +esp_err_t add(cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + update_feature_map(cluster, get_id()); + + return ESP_OK; +} + +} /* explicit_feature */ + +namespace table_size { + +uint32_t get_id() +{ + return (uint32_t)Scenes::Feature::kTableSize; +} + +esp_err_t add(cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + update_feature_map(cluster, get_id()); + + return ESP_OK; +} + +} /* table_size */ + +namespace fabric_scenes { + +uint32_t get_id() +{ + return (uint32_t)Scenes::Feature::kFabricScenes; +} + +esp_err_t add(cluster_t *cluster) +{ + if (!cluster) { + ESP_LOGE(TAG, "Cluster cannot be NULL"); + return ESP_ERR_INVALID_ARG; + } + update_feature_map(cluster, get_id()); + + return ESP_OK; +} + +} /* fabric_scenes*/ + +} /* feature */ +} /* scenes */ + namespace on_off { namespace feature { namespace lighting { @@ -367,7 +452,6 @@ esp_err_t add(cluster_t *cluster, config_t *config) command::create_move_saturation(cluster); command::create_step_saturation(cluster); command::create_move_to_hue_and_saturation(cluster); - command::create_stop_move_step(cluster); return ESP_OK; } @@ -395,11 +479,10 @@ esp_err_t add(cluster_t *cluster, config_t *config) attribute::create_color_temp_physical_min_mireds(cluster, config->color_temp_physical_min_mireds, 0, 0xfeff); attribute::create_color_temp_physical_max_mireds(cluster, config->color_temp_physical_max_mireds, 0, 0xfeff); attribute::create_couple_color_temp_to_level_min_mireds(cluster, config->couple_color_temp_to_level_min_mireds, config->color_temp_physical_min_mireds, config->color_temperature_mireds); - attribute::create_startup_color_temperature_mireds(cluster, config->startup_color_temperature_mireds, 0, 0xfeff); + attribute::create_startup_color_temperature_mireds(cluster, config->startup_color_temperature_mireds); /* Commands */ command::create_move_to_color_temperature(cluster); - command::create_stop_move_step(cluster); command::create_move_color_temperature(cluster); command::create_step_color_temperature(cluster); @@ -430,7 +513,6 @@ esp_err_t add(cluster_t *cluster, config_t *config) /* Commands */ command::create_move_to_color(cluster); - command::create_stop_move_step(cluster); command::create_move_color(cluster); command::create_step_color(cluster); diff --git a/components/esp_matter/esp_matter_feature.h b/components/esp_matter/esp_matter_feature.h index f16fff358..4a1a10161 100644 --- a/components/esp_matter/esp_matter_feature.h +++ b/components/esp_matter/esp_matter_feature.h @@ -88,6 +88,39 @@ esp_err_t add(cluster_t *cluster, config_t *config); } /* feature */ } /* power_source */ +namespace scenes { +namespace feature { +namespace scene_names { + +uint32_t get_id(); +esp_err_t add(cluster_t *cluster); + +} /* scene_names */ + +namespace explicit_feature { + +uint32_t get_id(); +esp_err_t add(cluster_t *cluster); + +} /* explicit_feature */ + +namespace table_size { + +uint32_t get_id(); +esp_err_t add(cluster_t *cluster); + +} /* table_size */ + +namespace fabric_scenes { + +uint32_t get_id(); +esp_err_t add(cluster_t *cluster); + +} /* fabric_scenes*/ + +} /* feature */ +} /* scenes */ + namespace on_off { namespace feature { namespace lighting { diff --git a/components/esp_matter/idf_component.yml b/components/esp_matter/idf_component.yml deleted file mode 100644 index 09ffa1415..000000000 --- a/components/esp_matter/idf_component.yml +++ /dev/null @@ -1,11 +0,0 @@ -## IDF Component Manager Manifest File -dependencies: - espressif/esp_secure_cert_mgr: "^2.2.1" - ## Required IDF version - idf: - version: ">=4.4.2" - - espressif/esp_encrypted_img: - version: "2.0.3" - rules: - - if: "idf_version >=4.4" diff --git a/components/esp_matter/zap_common/zap-generated/gen_config.h b/components/esp_matter/zap_common/zap-generated/gen_config.h index 215afd6cd..5f3787aa7 100644 --- a/components/esp_matter/zap_common/zap-generated/gen_config.h +++ b/components/esp_matter/zap_common/zap-generated/gen_config.h @@ -186,6 +186,8 @@ #define EMBER_AF_MEDIA_PLAYBACK_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in media playback #define EMBER_AF_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in on off #define EMBER_AF_OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in ota +#define EMBER_AF_POWER_SOURCE_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT + // used in power source #define EMBER_AF_TARGET_NAVIGATOR_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in target navigator #define EMBER_AF_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in wake on lan #define EMBER_AF_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT FIXED_ENDPOINT_COUNT // used in window covering diff --git a/connectedhomeip/connectedhomeip b/connectedhomeip/connectedhomeip index 5b4f80046..ecc0d63cf 160000 --- a/connectedhomeip/connectedhomeip +++ b/connectedhomeip/connectedhomeip @@ -1 +1 @@ -Subproject commit 5b4f8004662d00bdb111367fec7d3ea978c23372 +Subproject commit ecc0d63cf7eb91f4017bf8c264b53cf690420eb5 diff --git a/examples/all_device_types_app/CMakeLists.txt b/examples/all_device_types_app/CMakeLists.txt index dc87fbe2c..c8d9b375c 100644 --- a/examples/all_device_types_app/CMakeLists.txt +++ b/examples/all_device_types_app/CMakeLists.txt @@ -37,7 +37,7 @@ set(EXTRA_COMPONENT_DIRS project(all_device_types_app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/all_device_types_app/main/CMakeLists.txt b/examples/all_device_types_app/main/CMakeLists.txt index a6f105bed..30caf463c 100644 --- a/examples/all_device_types_app/main/CMakeLists.txt +++ b/examples/all_device_types_app/main/CMakeLists.txt @@ -4,5 +4,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." PRIV_REQUIRES ${PRIV_REQUIRES_LIST}) -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/blemesh_bridge/CMakeLists.txt b/examples/blemesh_bridge/CMakeLists.txt index 351dd30dc..b79c59f1e 100644 --- a/examples/blemesh_bridge/CMakeLists.txt +++ b/examples/blemesh_bridge/CMakeLists.txt @@ -37,7 +37,7 @@ set(EXTRA_COMPONENT_DIRS project(blemesh_bridge) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H;-fpermissive" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-fpermissive" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/blemesh_bridge/main/CMakeLists.txt b/examples/blemesh_bridge/main/CMakeLists.txt index ad75e6b67..2c2211557 100644 --- a/examples/blemesh_bridge/main/CMakeLists.txt +++ b/examples/blemesh_bridge/main/CMakeLists.txt @@ -2,5 +2,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS "." "${ESP_MATTER_PATH}/examples/common/blemesh_platform") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/controller/CMakeLists.txt b/examples/controller/CMakeLists.txt index cf478566f..b56089d1d 100644 --- a/examples/controller/CMakeLists.txt +++ b/examples/controller/CMakeLists.txt @@ -34,7 +34,7 @@ set(EXTRA_COMPONENT_DIRS project(controller) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) if (CONFIG_ESP_MATTER_COMMISSIONER_ENABLE) diff --git a/examples/controller/main/CMakeLists.txt b/examples/controller/main/CMakeLists.txt index a181d0f54..1103ba7ad 100644 --- a/examples/controller/main/CMakeLists.txt +++ b/examples/controller/main/CMakeLists.txt @@ -3,5 +3,5 @@ idf_component_register(SRC_DIRS ".") spiffs_create_partition_image(paa_cert ${CMAKE_SOURCE_DIR}/paa_cert FLASH_IN_PROJECT) -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/esp-now_bridge_light/CMakeLists.txt b/examples/esp-now_bridge_light/CMakeLists.txt index d71206efc..ff4abb240 100644 --- a/examples/esp-now_bridge_light/CMakeLists.txt +++ b/examples/esp-now_bridge_light/CMakeLists.txt @@ -37,7 +37,7 @@ set(EXTRA_COMPONENT_DIRS project(espnow_light) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/esp-now_bridge_light/main/CMakeLists.txt b/examples/esp-now_bridge_light/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/esp-now_bridge_light/main/CMakeLists.txt +++ b/examples/esp-now_bridge_light/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/generic_switch/CMakeLists.txt b/examples/generic_switch/CMakeLists.txt index 9f6b296b9..98946f8dd 100644 --- a/examples/generic_switch/CMakeLists.txt +++ b/examples/generic_switch/CMakeLists.txt @@ -46,7 +46,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/generic_switch/main/CMakeLists.txt b/examples/generic_switch/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/generic_switch/main/CMakeLists.txt +++ b/examples/generic_switch/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/light/CMakeLists.txt b/examples/light/CMakeLists.txt index f614a753f..ebf9bf2f9 100644 --- a/examples/light/CMakeLists.txt +++ b/examples/light/CMakeLists.txt @@ -53,7 +53,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/light/main/CMakeLists.txt b/examples/light/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/light/main/CMakeLists.txt +++ b/examples/light/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/light_switch/CMakeLists.txt b/examples/light_switch/CMakeLists.txt index 56dc7bc0c..0fab4effe 100644 --- a/examples/light_switch/CMakeLists.txt +++ b/examples/light_switch/CMakeLists.txt @@ -46,7 +46,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/light_switch/main/CMakeLists.txt b/examples/light_switch/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/light_switch/main/CMakeLists.txt +++ b/examples/light_switch/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/mfg_test_app/CMakeLists.txt b/examples/mfg_test_app/CMakeLists.txt index b87d2a271..43762e561 100644 --- a/examples/mfg_test_app/CMakeLists.txt +++ b/examples/mfg_test_app/CMakeLists.txt @@ -21,7 +21,7 @@ set(EXTRA_COMPONENT_DIRS project(mfg_test_app) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/mfg_test_app/main/CMakeLists.txt b/examples/mfg_test_app/main/CMakeLists.txt index f82b3fe97..b87352694 100644 --- a/examples/mfg_test_app/main/CMakeLists.txt +++ b/examples/mfg_test_app/main/CMakeLists.txt @@ -5,5 +5,5 @@ idf_component_register(SRC_DIRS "." PRIV_REQUIRES ${PRIV_REQUIRES_LIST} EMBED_FILES "paa_cert.der") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/refrigerator/CMakeLists.txt b/examples/refrigerator/CMakeLists.txt index fbe861248..a83eed68e 100644 --- a/examples/refrigerator/CMakeLists.txt +++ b/examples/refrigerator/CMakeLists.txt @@ -47,7 +47,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/refrigerator/main/CMakeLists.txt b/examples/refrigerator/main/CMakeLists.txt index 6694b7133..a2096b89c 100644 --- a/examples/refrigerator/main/CMakeLists.txt +++ b/examples/refrigerator/main/CMakeLists.txt @@ -19,5 +19,5 @@ idf_component_register(SRC_DIRS ${SRC_DIRS_LIST} INCLUDE_DIRS ${INCLUDE_DIRS_LIST} PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/room_air_conditioner/CMakeLists.txt b/examples/room_air_conditioner/CMakeLists.txt index 7230f42e7..af31b9bed 100644 --- a/examples/room_air_conditioner/CMakeLists.txt +++ b/examples/room_air_conditioner/CMakeLists.txt @@ -53,7 +53,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/room_air_conditioner/main/CMakeLists.txt b/examples/room_air_conditioner/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/room_air_conditioner/main/CMakeLists.txt +++ b/examples/room_air_conditioner/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/zap_light/CMakeLists.txt b/examples/zap_light/CMakeLists.txt index d910b0b75..61ba76e0f 100644 --- a/examples/zap_light/CMakeLists.txt +++ b/examples/zap_light/CMakeLists.txt @@ -46,7 +46,7 @@ if(CONFIG_IDF_TARGET_ESP32C2) include(relinker) endif() -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/zap_light/main/CMakeLists.txt b/examples/zap_light/main/CMakeLists.txt index a8efe8189..50cb2f7c0 100644 --- a/examples/zap_light/main/CMakeLists.txt +++ b/examples/zap_light/main/CMakeLists.txt @@ -7,5 +7,5 @@ include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") chip_app_component_codegen("${CHIP_ROOT}/examples/lighting-app/lighting-common/lighting-app.matter") chip_app_component_zapgen("${CHIP_ROOT}/examples/lighting-app/lighting-common/lighting-app.zap") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") diff --git a/examples/zigbee_bridge/CMakeLists.txt b/examples/zigbee_bridge/CMakeLists.txt index 76f3d9b53..312c79dbb 100644 --- a/examples/zigbee_bridge/CMakeLists.txt +++ b/examples/zigbee_bridge/CMakeLists.txt @@ -36,7 +36,7 @@ set(EXTRA_COMPONENT_DIRS project(zigbee_bridge) -idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++14;-Os;-DCHIP_HAVE_CONFIG_H;-fpermissive" APPEND) +idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H;-fpermissive" APPEND) idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND) # For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various # flags that depend on -Wformat diff --git a/examples/zigbee_bridge/main/CMakeLists.txt b/examples/zigbee_bridge/main/CMakeLists.txt index 28da3b587..f48a36750 100644 --- a/examples/zigbee_bridge/main/CMakeLists.txt +++ b/examples/zigbee_bridge/main/CMakeLists.txt @@ -1,5 +1,5 @@ idf_component_register(SRC_DIRS "." PRIV_INCLUDE_DIRS ".") -set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 14) +set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H")