diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index a6b25999d23..30b34f3255a 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -105,7 +105,7 @@ jobs: run: rm -rf out/esp32-m5stack-all-clusters-minimal examples/all-clusters-minimal-app/esp32/managed_components - name: Check for changed paths - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changed_paths with: filters: | diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index 5428d5e2f6a..d2be2073355 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -53,7 +53,7 @@ jobs: with: platform: nrfconnect - name: Detect changed paths - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changed_paths with: filters: | diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 20182b94639..39ba696b7a1 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -56,7 +56,7 @@ jobs: extra-submodule-parameters: --recursive - name: Detect changed paths - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changed_paths with: filters: | @@ -163,7 +163,7 @@ jobs: with: platform: nxp - name: Detect changed paths - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changed_paths with: filters: | diff --git a/.github/workflows/examples-realtek.yaml b/.github/workflows/examples-realtek.yaml index 6d1be2559a8..79ecc9572d9 100644 --- a/.github/workflows/examples-realtek.yaml +++ b/.github/workflows/examples-realtek.yaml @@ -53,7 +53,7 @@ jobs: extra-submodule-parameters: --recursive - name: Detect changed paths - uses: dorny/paths-filter@v3 + uses: dorny/paths-filter@v4 id: changed_paths with: filters: | diff --git a/.github/workflows/spell.yml b/.github/workflows/spell.yml index 6ad8103bb91..a26c4f2b38b 100644 --- a/.github/workflows/spell.yml +++ b/.github/workflows/spell.yml @@ -34,4 +34,4 @@ jobs: steps: - name: Checkout uses: actions/checkout@v6 - - uses: rojopolis/spellcheck-github-actions@0.59.0 + - uses: rojopolis/spellcheck-github-actions@0.60.0 diff --git a/build/config/linux/pkg-config.py b/build/config/linux/pkg-config.py index da11fbb1a92..5f6208ded0f 100755 --- a/build/config/linux/pkg-config.py +++ b/build/config/linux/pkg-config.py @@ -107,10 +107,7 @@ def GetPkgConfigPrefixToStrip(options, args): def MatchesAnyRegexp(flag, list_of_regexps): """Returns true if the first argument matches any regular expression in the given list.""" - for regexp in list_of_regexps: - if regexp.search(flag) is not None: - return True - return False + return any(regexp.search(flag) is not None for regexp in list_of_regexps) def RewritePath(path, strip_prefix, sysroot): diff --git a/credentials/generate_revocation_set.py b/credentials/generate_revocation_set.py index 9e3a91fd3b4..ad7406ff705 100755 --- a/credentials/generate_revocation_set.py +++ b/credentials/generate_revocation_set.py @@ -358,7 +358,7 @@ def fetch_crl_from_url(url: str, timeout: int) -> x509.CertificateRevocationList log.debug(f"Fetched CRL: {r.content}") return x509.load_der_x509_crl(r.content) except Exception as e: - log.error('Failed to fetch a valid CRL', e) + log.error("Failed to fetch a valid CRL: %s", e) class DclClientInterface: @@ -439,7 +439,7 @@ def get_paa_cert(self, initial_cert: x509.Certificate) -> Optional[x509.Certific break except Exception as e: - log.error('Failed to get PAA certificate', e) + log.error("Failed to get PAA certificate: %s", e) return None log.debug(f"issuer_name: {issuer_certificate.subject.rfc4514_string()}") issuer_name = issuer_certificate.issuer diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index 7f06973c4fc..c0a8626a373 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter index c30fda114b5..778c1f340a0 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/icd-lit-air-quality-sensor-app.matter b/examples/air-quality-sensor-app/air-quality-sensor-common/icd-lit-air-quality-sensor-app.matter index 04799744c77..ffab3a6ab39 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/icd-lit-air-quality-sensor-app.matter +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/icd-lit-air-quality-sensor-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 99bb94ca120..8d9559f8acd 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -1204,6 +1204,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/all-clusters-app/realtek/data_model/all-clusters-app.matter b/examples/all-clusters-app/realtek/data_model/all-clusters-app.matter index fce74c8a91e..97e9ab2abb8 100644 --- a/examples/all-clusters-app/realtek/data_model/all-clusters-app.matter +++ b/examples/all-clusters-app/realtek/data_model/all-clusters-app.matter @@ -1204,6 +1204,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index 508a145756e..c155e0fbf15 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -1133,6 +1133,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/base-platform-app/silabs/data_model/platform-thread-app.matter b/examples/base-platform-app/silabs/data_model/platform-thread-app.matter index c2db592fd8f..6bec3506703 100644 --- a/examples/base-platform-app/silabs/data_model/platform-thread-app.matter +++ b/examples/base-platform-app/silabs/data_model/platform-thread-app.matter @@ -694,6 +694,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/base-platform-app/silabs/data_model/platform-thread-icd-app.matter b/examples/base-platform-app/silabs/data_model/platform-thread-icd-app.matter index af38453662c..daf43339284 100644 --- a/examples/base-platform-app/silabs/data_model/platform-thread-icd-app.matter +++ b/examples/base-platform-app/silabs/data_model/platform-thread-icd-app.matter @@ -694,6 +694,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/base-platform-app/silabs/data_model/platform-wifi-app.matter b/examples/base-platform-app/silabs/data_model/platform-wifi-app.matter index 93074eb300c..747e924da03 100644 --- a/examples/base-platform-app/silabs/data_model/platform-wifi-app.matter +++ b/examples/base-platform-app/silabs/data_model/platform-wifi-app.matter @@ -694,6 +694,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/base-platform-app/silabs/data_model/platform-wifi-icd-app.matter b/examples/base-platform-app/silabs/data_model/platform-wifi-icd-app.matter index d8de970ad96..17499684557 100644 --- a/examples/base-platform-app/silabs/data_model/platform-wifi-icd-app.matter +++ b/examples/base-platform-app/silabs/data_model/platform-wifi-icd-app.matter @@ -694,6 +694,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/bridge-app/bridge-common/bridge-app.matter b/examples/bridge-app/bridge-common/bridge-app.matter index 26269e79dcd..52dde8dddae 100644 --- a/examples/bridge-app/bridge-common/bridge-app.matter +++ b/examples/bridge-app/bridge-common/bridge-app.matter @@ -1037,6 +1037,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/camera-app/camera-common/camera-app.matter b/examples/camera-app/camera-common/camera-app.matter index d0a31269889..8a04182b783 100644 --- a/examples/camera-app/camera-common/camera-app.matter +++ b/examples/camera-app/camera-common/camera-app.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/common/FakeAttributeAccess.cpp b/examples/chef/common/FakeAttributeAccess.cpp index 6a03fbd2aa1..01162c03940 100644 --- a/examples/chef/common/FakeAttributeAccess.cpp +++ b/examples/chef/common/FakeAttributeAccess.cpp @@ -35,6 +35,14 @@ #include #endif +#if MATTER_DM_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT > 0 +#include +#endif + +#if MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT > 0 +#include +#endif + namespace chip { namespace app { namespace Clusters { @@ -83,7 +91,46 @@ class AttributeAccessor : public chip::rpc::PigweedDebugAccessInterceptor } return ::pw::OkStatus(); } + case TemperatureMeasurement::Attributes::MinMeasuredValue::Id: + case TemperatureMeasurement::Attributes::MaxMeasuredValue::Id: { + auto temperatureMeasurement = TemperatureMeasurement::FindClusterOnEndpoint(path.mEndpointId); + if (temperatureMeasurement == nullptr) + { + return ::pw::Status::Internal(); + } + + DataModel::Nullable value; + CHIP_ERROR err = decoder.Decode(value); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to decode measured value: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + + DataModel::Nullable min; + DataModel::Nullable max; + + if (path.mAttributeId == TemperatureMeasurement::Attributes::MinMeasuredValue::Id) + { + min = value; + max = temperatureMeasurement->GetMaxMeasuredValue(); + } + else + { + min = temperatureMeasurement->GetMinMeasuredValue(); + max = value; + } + + err = TemperatureMeasurement::SetMeasuredValueRange(path.mEndpointId, min, max); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to set measured value range: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + return ::pw::OkStatus(); + } } + break; #endif // MATTER_DM_TEMPERATURE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT > 0 #if MATTER_DM_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT > 0 case ValveConfigurationAndControl::Id: @@ -106,7 +153,106 @@ class AttributeAccessor : public chip::rpc::PigweedDebugAccessInterceptor ChipLogProgress(Zcl, "[Pw] Successfully set current level to " ChipLogFormatMEI ".", ChipLogValueMEI(level)); return ::pw::OkStatus(); } -#endif + break; +#endif // MATTER_DM_VALVE_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT > 0 +#if MATTER_DM_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT > 0 + case IlluminanceMeasurement::Id: + switch (path.mAttributeId) + { + case IlluminanceMeasurement::Attributes::MeasuredValue::Id: { + DataModel::Nullable measuredValue; + CHIP_ERROR err = decoder.Decode(measuredValue); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to decode measuredValue: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + + err = IlluminanceMeasurement::SetMeasuredValue(path.mEndpointId, measuredValue); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to set measuredValue: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + + if (measuredValue.IsNull()) + { + ChipLogProgress(Zcl, "[Pw] Successfully set measuredValue to null."); + } + else + { + ChipLogProgress(Zcl, "[Pw] Successfully set measuredValue to %u.", measuredValue.Value()); + } + return ::pw::OkStatus(); + } + case IlluminanceMeasurement::Attributes::MinMeasuredValue::Id: + case IlluminanceMeasurement::Attributes::MaxMeasuredValue::Id: { + auto illuminanceMeasurement = IlluminanceMeasurement::FindClusterOnEndpoint(path.mEndpointId); + if (illuminanceMeasurement == nullptr) + { + return ::pw::Status::Internal(); + } + + DataModel::Nullable value; + CHIP_ERROR err = decoder.Decode(value); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to decode measured value: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + + DataModel::Nullable min; + DataModel::Nullable max; + + if (path.mAttributeId == IlluminanceMeasurement::Attributes::MinMeasuredValue::Id) + { + min = value; + max = illuminanceMeasurement->GetMaxMeasuredValue(); + } + else + { + min = illuminanceMeasurement->GetMinMeasuredValue(); + max = value; + } + + err = IlluminanceMeasurement::SetMeasuredValueRange(path.mEndpointId, min, max); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to set measured value range: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + return ::pw::OkStatus(); + } + } + break; +#endif // MATTER_DM_ILLUMINANCE_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT > 0 +#if MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT > 0 + case OccupancySensing::Id: + switch (path.mAttributeId) + { + case OccupancySensing::Attributes::Occupancy::Id: { + BitMask occupancy; + CHIP_ERROR err = decoder.Decode(occupancy); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "[Pw] Failed to decode occupancy: %" CHIP_ERROR_FORMAT, err.Format()); + return ::pw::Status::Internal(); + } + + auto occupancySensing = OccupancySensing::FindClusterOnEndpoint(path.mEndpointId); + if (occupancySensing == nullptr) + { + return ::pw::Status::Internal(); + } + + occupancySensing->SetOccupancy(occupancy.Has(OccupancySensing::OccupancyBitmap::kOccupied)); + ChipLogProgress(Zcl, "[Pw] Successfully set occupancy to %d.", + occupancy.Has(OccupancySensing::OccupancyBitmap::kOccupied)); + return ::pw::OkStatus(); + } + } + break; +#endif // MATTER_DM_OCCUPANCY_SENSING_CLUSTER_SERVER_ENDPOINT_COUNT > 0 } return std::nullopt; } diff --git a/examples/chef/devices/icd_rootnode_contactsensor_ed3b19ec55.matter b/examples/chef/devices/icd_rootnode_contactsensor_ed3b19ec55.matter index 87e3f4d5f70..6b5d5e6f173 100644 --- a/examples/chef/devices/icd_rootnode_contactsensor_ed3b19ec55.matter +++ b/examples/chef/devices/icd_rootnode_contactsensor_ed3b19ec55.matter @@ -687,6 +687,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter index 4f25c5b4408..0acc99bb488 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter index e04392cec1d..d631cb8c288 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index ae01f2eda5d..5f3630ab0a7 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter index ecc52024d04..278111c499c 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter index b9fa08b8750..3964cda9960 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.matter @@ -861,6 +861,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_castingvideoplayer_contentapp_34699714e7.matter b/examples/chef/devices/rootnode_castingvideoplayer_contentapp_34699714e7.matter index 19959e63be4..254c1dc229f 100644 --- a/examples/chef/devices/rootnode_castingvideoplayer_contentapp_34699714e7.matter +++ b/examples/chef/devices/rootnode_castingvideoplayer_contentapp_34699714e7.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter index fde6637efb2..e210b422392 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter index c7fcb40477e..1d9dd23c1df 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter index 27e8e436515..4b9bdad06ea 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter b/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter index 741996b8bf5..d339c8f2c7e 100644 --- a/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter +++ b/examples/chef/devices/rootnode_contactsensor_lightsensor_occupancysensor_temperaturesensor_pressuresensor_flowsensor_humiditysensor_airqualitysensor_powersource_367e7cea91.matter @@ -687,6 +687,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_cooktop_cooksurface_d3c174cc88.matter b/examples/chef/devices/rootnode_cooktop_cooksurface_d3c174cc88.matter index 5794413e516..ad624ec0165 100644 --- a/examples/chef/devices/rootnode_cooktop_cooksurface_d3c174cc88.matter +++ b/examples/chef/devices/rootnode_cooktop_cooksurface_d3c174cc88.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter index 4adcdb0d670..3285f446aea 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter index 654258599ed..778fc29ad6e 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index cbfd698c96a..d98e8b79d86 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter index a5a8f77c684..b464393f8ed 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter index 2592752b388..2679997b751 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_extractorhood_0359bf807d.matter b/examples/chef/devices/rootnode_extractorhood_0359bf807d.matter index 7c6b8931079..8d4de328bf2 100644 --- a/examples/chef/devices/rootnode_extractorhood_0359bf807d.matter +++ b/examples/chef/devices/rootnode_extractorhood_0359bf807d.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter index eccfea60390..0e64fe1a276 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.matter @@ -814,6 +814,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter index 547f959aafb..617a5b91985 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter index 0342e8f8a15..fbf2068c14f 100644 --- a/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter +++ b/examples/chef/devices/rootnode_genericswitch_2dfff6e516.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter index a83e36c207c..500210e5d2b 100644 --- a/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter +++ b/examples/chef/devices/rootnode_genericswitch_9866e35d0b.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter index df504207b17..e61cd30868b 100644 --- a/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter +++ b/examples/chef/devices/rootnode_heatpump_87ivjRAECh.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter index ce929e5f6b8..b8951ccacc6 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter index b584b3c5223..f903c1c8c14 100644 --- a/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter +++ b/examples/chef/devices/rootnode_laundrydryer_01796fe396.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter index 969fdf7675e..6c5002850ef 100644 --- a/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter +++ b/examples/chef/devices/rootnode_laundrywasher_fb10d238c8.matter @@ -689,6 +689,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter index f0cb1b2cedd..27a78cc72c2 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_microwaveoven_37420684d3.matter b/examples/chef/devices/rootnode_microwaveoven_37420684d3.matter index 38292f63c04..76dc1ae7616 100644 --- a/examples/chef/devices/rootnode_microwaveoven_37420684d3.matter +++ b/examples/chef/devices/rootnode_microwaveoven_37420684d3.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_mounteddimmableloadcontrol_a9a1a87f2d.matter b/examples/chef/devices/rootnode_mounteddimmableloadcontrol_a9a1a87f2d.matter index 903433f90b8..e4503217086 100644 --- a/examples/chef/devices/rootnode_mounteddimmableloadcontrol_a9a1a87f2d.matter +++ b/examples/chef/devices/rootnode_mounteddimmableloadcontrol_a9a1a87f2d.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_mountedonoffcontrol_ec30c757a6.matter b/examples/chef/devices/rootnode_mountedonoffcontrol_ec30c757a6.matter index c281ded05a3..c348bd69c34 100644 --- a/examples/chef/devices/rootnode_mountedonoffcontrol_ec30c757a6.matter +++ b/examples/chef/devices/rootnode_mountedonoffcontrol_ec30c757a6.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter index 8b58159ade1..a719cf01af7 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter index fbe914147e2..c9f92861a24 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.matter b/examples/chef/devices/rootnode_onofflight_samplemei.matter index 27ab1c37c10..3a7bda71792 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.matter +++ b/examples/chef/devices/rootnode_onofflight_samplemei.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter index 4dfc591bf55..5081ac2390b 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.matter @@ -834,6 +834,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter index 8587c04060c..58155f4c27d 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.matter @@ -957,6 +957,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_oven_temperaturecontrolledcabinet_cooktop_cooksurface_738dd18832.matter b/examples/chef/devices/rootnode_oven_temperaturecontrolledcabinet_cooktop_cooksurface_738dd18832.matter index a5e62bc40c2..055d7357ef5 100644 --- a/examples/chef/devices/rootnode_oven_temperaturecontrolledcabinet_cooktop_cooksurface_738dd18832.matter +++ b/examples/chef/devices/rootnode_oven_temperaturecontrolledcabinet_cooktop_cooksurface_738dd18832.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter index c086e22245e..9420143cc99 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_pump_5f904818cc.matter b/examples/chef/devices/rootnode_pump_5f904818cc.matter index a1edbfbc435..6efbf9677f9 100644 --- a/examples/chef/devices/rootnode_pump_5f904818cc.matter +++ b/examples/chef/devices/rootnode_pump_5f904818cc.matter @@ -861,6 +861,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter b/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter index b3948960b53..5e0025f2484 100644 --- a/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter +++ b/examples/chef/devices/rootnode_rainsensor_a7aa5d7738.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter index a60302a56b1..2118a2a910f 100644 --- a/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter +++ b/examples/chef/devices/rootnode_refrigerator_temperaturecontrolledcabinet_temperaturecontrolledcabinet_ffdb696680.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter index 921291dbef4..1698320cae4 100644 --- a/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter +++ b/examples/chef/devices/rootnode_roboticvacuumcleaner_1807ff0c49.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 9bf61441f26..489cb005421 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -814,6 +814,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter index 4c2a67407b5..ce43b57cab3 100644 --- a/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter +++ b/examples/chef/devices/rootnode_smokecoalarm_686fe0dcb8.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter index d2f700df26c..e9a288e68d5 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.matter @@ -881,6 +881,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter index 0c24ec398f8..c21176c661f 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index f9c58ff0b34..d4874318de1 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter b/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter index e02ea0fbee3..728234e4a1d 100644 --- a/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter +++ b/examples/chef/devices/rootnode_waterfreezedetector_dd94a13a16.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter index 0cfaa9265ce..bc5b56e9e74 100644 --- a/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter +++ b/examples/chef/devices/rootnode_waterleakdetector_0b067acfa3.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter index 788e2ac8d61..72ac5dffcb0 100644 --- a/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter +++ b/examples/chef/devices/rootnode_watervalve_6bb39f1f67.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter index 33d72565af6..6d66fc8ff87 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/closure-app/closure-common/closure-app.matter b/examples/closure-app/closure-common/closure-app.matter index 9feee1d8381..91ae9f7aed3 100644 --- a/examples/closure-app/closure-common/closure-app.matter +++ b/examples/closure-app/closure-common/closure-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/closure-app/silabs/data_model/closure-thread-app.matter b/examples/closure-app/silabs/data_model/closure-thread-app.matter index f3a8ee7f040..174eb19ecb4 100644 --- a/examples/closure-app/silabs/data_model/closure-thread-app.matter +++ b/examples/closure-app/silabs/data_model/closure-thread-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/closure-app/silabs/data_model/closure-wifi-app.matter b/examples/closure-app/silabs/data_model/closure-wifi-app.matter index 42c44e2f865..cb350e6d1f2 100644 --- a/examples/closure-app/silabs/data_model/closure-wifi-app.matter +++ b/examples/closure-app/silabs/data_model/closure-wifi-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter b/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter index 8c6807ef80f..bef0573693d 100644 --- a/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter +++ b/examples/contact-sensor-app/bouffalolab/data_model/contact-sensor-app.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter index 18337263058..b14f11c2c7e 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter index e53dbc286f6..bd3266576d5 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter index b7ade85db31..5f4bd502dd4 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter index b7713a1c66c..70ee990a98b 100644 --- a/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter +++ b/examples/dishwasher-app/dishwasher-common/dishwasher-app.matter @@ -763,6 +763,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter index 5e81ebbd382..8b85deb7d84 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-thread-app.matter @@ -687,6 +687,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter index d2136db113b..028f4cad0ce 100644 --- a/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter +++ b/examples/dishwasher-app/silabs/data_model/dishwasher-wifi-app.matter @@ -687,6 +687,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/energy-gateway-app/energy-gateway-common/energy-gateway-app.matter b/examples/energy-gateway-app/energy-gateway-common/energy-gateway-app.matter index 86f649b3bc7..1926a30c957 100644 --- a/examples/energy-gateway-app/energy-gateway-common/energy-gateway-app.matter +++ b/examples/energy-gateway-app/energy-gateway-common/energy-gateway-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/evse-app/evse-common/evse-app.matter b/examples/evse-app/evse-common/evse-app.matter index 25b282be08e..203e15069e4 100644 --- a/examples/evse-app/evse-common/evse-app.matter +++ b/examples/evse-app/evse-common/evse-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter index 3ddcf6334e2..89331908512 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.matter @@ -804,6 +804,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/fan-control-app/silabs/data_model/fan-control-thread-app.matter b/examples/fan-control-app/silabs/data_model/fan-control-thread-app.matter index 83d1207edcb..0365c59b12c 100644 --- a/examples/fan-control-app/silabs/data_model/fan-control-thread-app.matter +++ b/examples/fan-control-app/silabs/data_model/fan-control-thread-app.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/fan-control-app/silabs/data_model/fan-control-wifi-app.matter b/examples/fan-control-app/silabs/data_model/fan-control-wifi-app.matter index 920ed83714b..add85d13f1f 100644 --- a/examples/fan-control-app/silabs/data_model/fan-control-wifi-app.matter +++ b/examples/fan-control-app/silabs/data_model/fan-control-wifi-app.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/jf-admin-app/jfa-common/jfa-app.matter b/examples/jf-admin-app/jfa-common/jfa-app.matter index 73657c87767..127b4a1174c 100644 --- a/examples/jf-admin-app/jfa-common/jfa-app.matter +++ b/examples/jf-admin-app/jfa-common/jfa-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter index a94bb834fad..3ece6ac1a0c 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.matter @@ -834,6 +834,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter index 2a195d54491..cdce2fbf9b5 100644 --- a/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/icd-lit-light-switch-app.matter @@ -883,6 +883,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.matter b/examples/light-switch-app/light-switch-common/light-switch-app.matter index af884a02015..1ac1ec1af93 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.matter +++ b/examples/light-switch-app/light-switch-common/light-switch-app.matter @@ -1006,6 +1006,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/qpg/zap/switch.matter b/examples/light-switch-app/qpg/zap/switch.matter index f7ed895950a..1c9cdfe3f46 100644 --- a/examples/light-switch-app/qpg/zap/switch.matter +++ b/examples/light-switch-app/qpg/zap/switch.matter @@ -1006,6 +1006,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/realtek/data_model/icd-lit-light-switch-app.matter b/examples/light-switch-app/realtek/data_model/icd-lit-light-switch-app.matter index 0e97d5ba8eb..05a32b1fca3 100644 --- a/examples/light-switch-app/realtek/data_model/icd-lit-light-switch-app.matter +++ b/examples/light-switch-app/realtek/data_model/icd-lit-light-switch-app.matter @@ -883,6 +883,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_11.matter b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_11.matter index a439e0e0e91..2e727ddb96c 100644 --- a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_11.matter +++ b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_11.matter @@ -807,6 +807,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_2.matter b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_2.matter index a58c1b6f5a6..1db0fc377d5 100644 --- a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_2.matter +++ b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_2.matter @@ -807,6 +807,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_8.matter b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_8.matter index df073753895..d9110cc0c72 100644 --- a/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_8.matter +++ b/examples/light-switch-app/realtek/data_model/light-switch-app-1_to_8.matter @@ -807,6 +807,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/light-switch-app/realtek/data_model/light-switch-app.matter b/examples/light-switch-app/realtek/data_model/light-switch-app.matter index db18a946e67..442d6795bb3 100644 --- a/examples/light-switch-app/realtek/data_model/light-switch-app.matter +++ b/examples/light-switch-app/realtek/data_model/light-switch-app.matter @@ -930,6 +930,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter index 145963e2083..a0157b407c9 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter index 0dbaf554704..e41640f06ac 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter index 88dcfb4020a..caa50fafee6 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter index 94516faf302..c2a482b4fad 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/esp32/data_model/lighting-app.matter b/examples/lighting-app/esp32/data_model/lighting-app.matter index 1cb5a2efe39..8a9a8158826 100644 --- a/examples/lighting-app/esp32/data_model/lighting-app.matter +++ b/examples/lighting-app/esp32/data_model/lighting-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/lighting-common/lighting-app.matter b/examples/lighting-app/lighting-common/lighting-app.matter index 2295ac0febd..ee920e567db 100644 --- a/examples/lighting-app/lighting-common/lighting-app.matter +++ b/examples/lighting-app/lighting-common/lighting-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.matter b/examples/lighting-app/nxp/zap/lighting-on-off.matter index 98257398078..c461c5bd262 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.matter +++ b/examples/lighting-app/nxp/zap/lighting-on-off.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/qpg/zap/light.matter b/examples/lighting-app/qpg/zap/light.matter index d70c39aa0a7..e795f3702b6 100644 --- a/examples/lighting-app/qpg/zap/light.matter +++ b/examples/lighting-app/qpg/zap/light.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/realtek/data_model/lighting-app.matter b/examples/lighting-app/realtek/data_model/lighting-app.matter index db5d89c8403..84537825ef3 100644 --- a/examples/lighting-app/realtek/data_model/lighting-app.matter +++ b/examples/lighting-app/realtek/data_model/lighting-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter index 9cc5f4866bb..27dca079b2a 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter index df6e5036e85..7d6258546a7 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter index 8b98f32a5e7..7c99d80c12b 100644 --- a/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter +++ b/examples/lit-icd-app/lit-icd-common/lit-icd-server-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/lock-common/lock-app.matter b/examples/lock-app/lock-common/lock-app.matter index 6af4eff8512..0e8789306d6 100644 --- a/examples/lock-app/lock-common/lock-app.matter +++ b/examples/lock-app/lock-common/lock-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/nxp/zap/lock-app.matter b/examples/lock-app/nxp/zap/lock-app.matter index 8d9dd642fed..13a4bee1739 100644 --- a/examples/lock-app/nxp/zap/lock-app.matter +++ b/examples/lock-app/nxp/zap/lock-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/qpg/zap/lock.matter b/examples/lock-app/qpg/zap/lock.matter index 1e00cf91a39..511d5bdaee8 100644 --- a/examples/lock-app/qpg/zap/lock.matter +++ b/examples/lock-app/qpg/zap/lock.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/realtek/data_model/lock-app.matter b/examples/lock-app/realtek/data_model/lock-app.matter index 3b8dc2e739b..3a8c5bcc6ca 100644 --- a/examples/lock-app/realtek/data_model/lock-app.matter +++ b/examples/lock-app/realtek/data_model/lock-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/lock-app/silabs/data_model/lock-app.matter b/examples/lock-app/silabs/data_model/lock-app.matter index c3506205c5c..5b8123a5f6f 100644 --- a/examples/lock-app/silabs/data_model/lock-app.matter +++ b/examples/lock-app/silabs/data_model/lock-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter index 9a7556437e9..8f98ea61fa3 100644 --- a/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter +++ b/examples/microwave-oven-app/microwave-oven-common/microwave-oven-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/multi-sensor-app/silabs/data_model/multi-sensor-thread-app.matter b/examples/multi-sensor-app/silabs/data_model/multi-sensor-thread-app.matter index 0845f05c4c2..7ed0479801f 100644 --- a/examples/multi-sensor-app/silabs/data_model/multi-sensor-thread-app.matter +++ b/examples/multi-sensor-app/silabs/data_model/multi-sensor-thread-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/multi-sensor-app/silabs/data_model/multi-sensor-wifi-app.matter b/examples/multi-sensor-app/silabs/data_model/multi-sensor-wifi-app.matter index 6f4c10cdd46..c8e4a9967e9 100644 --- a/examples/multi-sensor-app/silabs/data_model/multi-sensor-wifi-app.matter +++ b/examples/multi-sensor-app/silabs/data_model/multi-sensor-wifi-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 826314b31b5..d3d575edd23 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -618,6 +618,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/onoff-plug-app/silabs/data_model/onoff-plug-app.matter b/examples/onoff-plug-app/silabs/data_model/onoff-plug-app.matter index 4a2c9f1c902..be27cb4b97a 100644 --- a/examples/onoff-plug-app/silabs/data_model/onoff-plug-app.matter +++ b/examples/onoff-plug-app/silabs/data_model/onoff-plug-app.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter index 69a00e3b555..bbbe1ea00c6 100644 --- a/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter +++ b/examples/ota-provider-app/ota-provider-common/ota-provider-app.matter @@ -755,6 +755,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter index 8682503513c..fcf16d16917 100644 --- a/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter +++ b/examples/ota-requestor-app/ota-requestor-common/ota-requestor-app.matter @@ -814,6 +814,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/oven-app/oven-app-common/oven-app.matter b/examples/oven-app/oven-app-common/oven-app.matter index 52da957d52d..ce2903f833b 100644 --- a/examples/oven-app/oven-app-common/oven-app.matter +++ b/examples/oven-app/oven-app-common/oven-app.matter @@ -780,6 +780,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/oven-app/silabs/data_model/oven-wifi-app.matter b/examples/oven-app/silabs/data_model/oven-wifi-app.matter index d04ec5a40ee..a656577f288 100644 --- a/examples/oven-app/silabs/data_model/oven-wifi-app.matter +++ b/examples/oven-app/silabs/data_model/oven-wifi-app.matter @@ -780,6 +780,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 74e2283d4fb..523278acd08 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -1356,6 +1356,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 02bae06e18e..48e0636885d 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -1356,6 +1356,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/pump-common/pump-app.matter b/examples/pump-app/pump-common/pump-app.matter index efbf7add43a..bb8ce37635a 100644 --- a/examples/pump-app/pump-common/pump-app.matter +++ b/examples/pump-app/pump-common/pump-app.matter @@ -881,6 +881,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.matter b/examples/pump-app/silabs/data_model/pump-thread-app.matter index 59c2eba0af4..05e7bc27c7c 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.matter +++ b/examples/pump-app/silabs/data_model/pump-thread-app.matter @@ -881,6 +881,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.matter b/examples/pump-app/silabs/data_model/pump-wifi-app.matter index 59c2eba0af4..05e7bc27c7c 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.matter +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.matter @@ -881,6 +881,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter index 517aa923341..89227369088 100644 --- a/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter +++ b/examples/pump-controller-app/pump-controller-common/pump-controller-app.matter @@ -758,6 +758,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/rangehood-app/silabs/data_model/rangehood-wifi-app.matter b/examples/rangehood-app/silabs/data_model/rangehood-wifi-app.matter index 768ae2c72fb..396bcccecea 100644 --- a/examples/rangehood-app/silabs/data_model/rangehood-wifi-app.matter +++ b/examples/rangehood-app/silabs/data_model/rangehood-wifi-app.matter @@ -814,6 +814,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter index 6903fccd2cb..25175b4b977 100644 --- a/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter +++ b/examples/refrigerator-app/refrigerator-common/refrigerator-app.matter @@ -618,6 +618,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter index 90c6ca9513a..1842d9aabda 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-thread-app.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter index 521253a962f..9511cf2e1cf 100644 --- a/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter +++ b/examples/refrigerator-app/silabs/data_model/refrigerator-wifi-app.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/rvc-app/rvc-common/rvc-app.matter b/examples/rvc-app/rvc-common/rvc-app.matter index b52f834078d..c9d79bc1f18 100644 --- a/examples/rvc-app/rvc-common/rvc-app.matter +++ b/examples/rvc-app/rvc-common/rvc-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter index 83c741dd9d2..fad798a2b3c 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter index eaba5a5c227..f75fb1c7744 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.matter @@ -618,6 +618,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/template/silabs/template_DataModel_config/sl_template.matter b/examples/template/silabs/template_DataModel_config/sl_template.matter index bd44a9f1e01..5d277c69a37 100644 --- a/examples/template/silabs/template_DataModel_config/sl_template.matter +++ b/examples/template/silabs/template_DataModel_config/sl_template.matter @@ -937,6 +937,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter b/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter index 7c11a2fdad3..e31021ba1f3 100644 --- a/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter +++ b/examples/terms-and-conditions-app/terms-and-conditions-common/terms-and-conditions-app.matter @@ -814,6 +814,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_br.matter b/examples/thermostat/nxp/zap/thermostat_matter_br.matter index 7f41ae85acd..e631d410a30 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_br.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_br.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_eth.matter b/examples/thermostat/nxp/zap/thermostat_matter_eth.matter index 7f2a4410c28..7247a17080d 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_eth.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_eth.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index e5257918e9f..da3659be9b0 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index 1261b1a3e82..bd4b41160a9 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index c0f28addb1a..a9fb1ec287c 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/silabs/data_model/thermostat-thread-app.matter b/examples/thermostat/silabs/data_model/thermostat-thread-app.matter index d395e2c38aa..ca3c72b1030 100644 --- a/examples/thermostat/silabs/data_model/thermostat-thread-app.matter +++ b/examples/thermostat/silabs/data_model/thermostat-thread-app.matter @@ -812,6 +812,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index 667f459687b..b2b112ad888 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -812,6 +812,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/thread-br-app/thread-br-common/thread-br-app.matter b/examples/thread-br-app/thread-br-common/thread-br-app.matter index 0c84d3131dd..e0f5616d8d3 100644 --- a/examples/thread-br-app/thread-br-common/thread-br-app.matter +++ b/examples/thread-br-app/thread-br-common/thread-br-app.matter @@ -618,6 +618,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/tv-app/tv-common/tv-app.matter b/examples/tv-app/tv-common/tv-app.matter index a0721f1980f..6f3c272e995 100644 --- a/examples/tv-app/tv-common/tv-app.matter +++ b/examples/tv-app/tv-common/tv-app.matter @@ -852,6 +852,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 4cba2a99caf..81d63b3c787 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -983,6 +983,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter index 277177856a3..a5690077eb9 100644 --- a/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter +++ b/examples/virtual-device-app/virtual-device-common/virtual-device-app.matter @@ -834,6 +834,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/water-heater-app/water-heater-common/water-heater-app.matter b/examples/water-heater-app/water-heater-common/water-heater-app.matter index e63e7a11990..9e665d121b3 100644 --- a/examples/water-heater-app/water-heater-common/water-heater-app.matter +++ b/examples/water-heater-app/water-heater-common/water-heater-app.matter @@ -738,6 +738,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter index 0abc4398ed3..cc208b4ae81 100644 --- a/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter +++ b/examples/water-leak-detector-app/water-leak-detector-common/water-leak-detector-app.matter @@ -667,6 +667,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/examples/window-app/common/window-app.matter b/examples/window-app/common/window-app.matter index e87391c25b6..c0e9d64386f 100644 --- a/examples/window-app/common/window-app.matter +++ b/examples/window-app/common/window-app.matter @@ -743,6 +743,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/pyproject.toml b/pyproject.toml index ba4908823be..757f0295e8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,14 +12,16 @@ known_first_party = "matter" line-length = 132 target-version = "py311" exclude = [ - ".environment", - ".git", - ".github", ".*", - "build", "out", + "scripts/py_matter_yamltests/build", + "scripts/py_matter_idl/build", + "src/python_testing/matter_testing_infrastructure/build", + # Exclude submodules since we do not maintain them + # TODO: Use exact paths once we will have a way to sync and validate them in CI + "examples/common/QRCode/repo", + "examples/common/m5stack-tft/repo", "third_party", - "examples/common/QRCode/", # TODO(#37698) "docs/development_controllers/matter-repl/*.ipynb", ] @@ -30,7 +32,7 @@ reportMissingTypeStubs = "warning" [tool.ruff.lint] select = [ # Standard errors and warnings - "E", "W", "F", + "E", "PLE", "W", "F", # Ensure that async is used properly "ASYNC", # Consistent commas @@ -39,6 +41,8 @@ select = [ "C4", "RET", "SIM", # Ensure that scripts are executable "EXE", + # Check for common exception issues + "RSE", # Check for common logging issues "LOG", # Check for common optimization issues diff --git a/scripts/build/build/__init__.py b/scripts/build/build/__init__.py index 1bac31f437a..0d8fd76c1bf 100644 --- a/scripts/build/build/__init__.py +++ b/scripts/build/build/__init__.py @@ -3,12 +3,13 @@ import shutil import time from enum import Enum, auto -from multiprocessing.pool import ThreadPool -from typing import Optional, Sequence +from typing import Sequence from builders.builder import BuilderOptions -from .targets import BUILD_TARGETS, BuildTarget +from .targets import BUILD_TARGETS + +log = logging.getLogger(__name__) class BuildSteps(Enum): @@ -32,10 +33,10 @@ def time_builds(self, builders): def print_timing_report(self): total_time = self._total_end_time - self._total_start_time - logging.info("Build Time Summary:") + log.info("Build Time Summary:") for target, duration in self._build_times.items(): - logging.info(f" - {target}: {self._format_duration(duration)}") - logging.info(f"Total build time: {self._format_duration(total_time)}") + log.info(f" - {target}: {self._format_duration(duration)}") + log.info(f"Total build time: {self._format_duration(total_time)}") def _format_duration(self, seconds): minutes = int(seconds // 60) @@ -81,7 +82,7 @@ def SetupBuilders(self, targets: Sequence[str], options: BuilderOptions): break if found_choice is None: - logging.error(f"Target '{target}' could not be found. Nothing executed for it") + log.error(f"Target '{target}' could not be found. Nothing executed for it") continue parts = found_choice.StringIntoTargetParts(target) @@ -109,7 +110,7 @@ def Generate(self): self.runner.StartCommandExecution() for builder in self.builders: - logging.info('Generating %s', builder.output_dir) + log.info('Generating %s', builder.output_dir) builder.generate() self.completed_steps.add(BuildSteps.GENERATED) @@ -123,7 +124,7 @@ def Build(self): def CleanOutputDirectories(self): for builder in self.builders: - logging.warning('Cleaning %s', builder.output_dir) + log.warning('Cleaning %s', builder.output_dir) if os.path.exists(builder.output_dir): shutil.rmtree(builder.output_dir) @@ -131,7 +132,7 @@ def CleanOutputDirectories(self): self.completed_steps.discard(BuildSteps.GENERATED) def CreateArtifactArchives(self, directory: str): - logging.info('Copying build artifacts to %s', directory) + log.info('Copying build artifacts to %s', directory) if not os.path.exists(directory): os.makedirs(directory) for builder in self.builders: @@ -140,7 +141,7 @@ def CreateArtifactArchives(self, directory: str): directory, f'{builder.identifier}.tar.gz')) def CopyArtifactsTo(self, path: str): - logging.info('Copying build artifacts to %s', path) + log.info('Copying build artifacts to %s', path) if not os.path.exists(path): os.makedirs(path) diff --git a/scripts/build/build/target.py b/scripts/build/build/target.py index 4b1f43a7252..48d1b10836b 100644 --- a/scripts/build/build/target.py +++ b/scripts/build/build/target.py @@ -47,6 +47,8 @@ from builders.builder import BuilderOptions +log = logging.getLogger(__name__) + report_rejected_parts = True @@ -83,14 +85,14 @@ def Accept(self, full_input: str): if self.except_if_re.search(full_input): if report_rejected_parts: # likely nothing will match when we get such an error - logging.error(f"'{self.name}' does not support '{full_input}' due to rule EXCEPT IF '{self.except_if_re.pattern}'") + log.error(f"'{self.name}' does not support '{full_input}' due to rule EXCEPT IF '{self.except_if_re.pattern}'") return False if self.only_if_re: if not self.only_if_re.search(full_input): if report_rejected_parts: # likely nothing will match when we get such an error - logging.error(f"'{self.name}' does not support '{full_input}' due to rule ONLY IF '{self.only_if_re.pattern}'") + log.error(f"'{self.name}' does not support '{full_input}' due to rule ONLY IF '{self.only_if_re.pattern}'") return False return True @@ -140,6 +142,7 @@ def _HasVariantPrefix(value: str, prefix: str): if value.startswith(prefix + '-'): return value[len(prefix)+1:] + return None def _StringIntoParts(full_input: str, remaining_input: str, fixed_targets: List[List[TargetPart]], modifiers: List[TargetPart]): @@ -224,10 +227,7 @@ def __init__(self, name, builder_class, **kwargs): def isUnifiedBuild(self, parts: List[TargetPart]): """Checks if the given parts combine into a unified build.""" - for part in parts: - if part.build_arguments.get('unified', False): - return True - return False + return any(part.build_arguments.get('unified', False) for part in parts) def AppendFixedTargets(self, parts: List[TargetPart]): """Append a list of potential targets/variants. @@ -283,7 +283,7 @@ def HumanString(self): result = self.name for fixed in self.fixed_targets: if len(fixed) > 1: - result += '-{' + ",".join(sorted(map(lambda x: x.name, fixed))) + '}' + result += '-{' + ",".join(sorted(x.name for x in fixed)) + '}' else: result += '-' + fixed[0].name @@ -411,9 +411,7 @@ def AllVariants(self) -> Iterable[str]: while True: - prefix = "-".join(map( - lambda p: self.fixed_targets[p[0]][p[1]].name, enumerate(fixed_indices) - )) + prefix = "-".join(self.fixed_targets[i][n].name for i, n in enumerate(fixed_indices)) for n in range(len(self.modifiers) + 1): for c in itertools.combinations(self.modifiers, n): @@ -462,7 +460,7 @@ def Create(self, name: str, runner, repository_path: str, output_prefix: str, for part in parts: kargs.update(part.build_arguments) - logging.info("Preparing builder '%s'" % (name,)) + log.info("Preparing builder '%s'" % (name,)) builder = self.builder_class(repository_path, runner=runner, **kargs) builder.target = self diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py old mode 100755 new mode 100644 diff --git a/scripts/build/build_darwin_framework.py b/scripts/build/build_darwin_framework.py old mode 100644 new mode 100755 index 439ba4a50ff..476c7d7c370 --- a/scripts/build/build_darwin_framework.py +++ b/scripts/build/build_darwin_framework.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import argparse +import contextlib import glob import os import platform @@ -50,10 +51,8 @@ def run_command(command): if returncode != 0: # command_log is binary, so decoding as utf-8 might technically fail. We don't want # to throw on that. - try: + with contextlib.suppress(Exception): print("Failure log: {}".format(command_log.decode())) - except Exception: - pass return returncode diff --git a/scripts/build/build_examples.py b/scripts/build/build_examples.py index 23acb984428..17871f480db 100755 --- a/scripts/build/build_examples.py +++ b/scripts/build/build_examples.py @@ -19,12 +19,13 @@ import os import sys -import build import click import coloredlogs from builders.builder import BuilderOptions from runner import PrintOnlyRunner, ShellRunner +import build + sys.path.append(os.path.abspath(os.path.dirname(__file__))) @@ -38,10 +39,6 @@ } -def CommaSeparate(items) -> str: - return ', '.join([x for x in items]) - - def ValidateRepoPath(context, parameter, value): """ Validates that the given path looks like a valid chip repository checkout. @@ -170,7 +167,7 @@ def main(context, log_level, verbose, target, enable_link_map_file, repo, ninja_jobs=ninja_jobs, runner=runner ) - requested_targets = set([t.lower() for t in target]) + requested_targets = {t.lower() for t in target} context.obj.SetupBuilders(targets=requested_targets, options=BuilderOptions( enable_link_map_file=enable_link_map_file, enable_flashbundle=enable_flashbundle, diff --git a/scripts/build/builders/android.py b/scripts/build/builders/android.py index 6b33293ca2c..d6c1d0a324c 100644 --- a/scripts/build/builders/android.py +++ b/scripts/build/builders/android.py @@ -19,6 +19,8 @@ from .builder import Builder, BuilderOutput +log = logging.getLogger(__name__) + class AndroidBoard(Enum): ARM = auto() @@ -176,17 +178,17 @@ def _find_sdk_manager(self, for_purpose="validation"): # Test environment - assume the path is valid sdk_manager = path checked_details.append(f"{path} (test environment - assumed valid)") - logging.info(f"Using SDK manager for {for_purpose} from test environment: {sdk_manager}") + log.info(f"Using SDK manager for {for_purpose} from test environment: {sdk_manager}") break # Real environment - check actual file existence exists = os.path.isfile(path) executable = os.access(path, os.X_OK) checked_details.append(f"{path} (exists: {exists}, executable: {executable})") - logging.debug(f"Checking SDK manager path for {for_purpose}: {path} - exists: {exists}, executable: {executable}") + log.debug(f"Checking SDK manager path for {for_purpose}: {path} - exists: {exists}, executable: {executable}") if exists and executable: sdk_manager = path - logging.info(f"Found SDK manager for {for_purpose} at: {sdk_manager}") + log.info(f"Found SDK manager for {for_purpose} at: {sdk_manager}") break return sdk_manager, checked_details @@ -203,16 +205,16 @@ def _handle_sdk_license_acceptance(self): title="Accepting NDK licenses using: %s" % sdk_manager_for_licenses, ) else: - logging.warning("No SDK manager found for license acceptance - licenses may need to be accepted manually") + log.warning("No SDK manager found for license acceptance - licenses may need to be accepted manually") def validate_build_environment(self): # Log Android environment paths for debugging android_ndk_home = os.environ.get("ANDROID_NDK_HOME", "") android_home = os.environ.get("ANDROID_HOME", "") - logging.info("Android environment paths:") - logging.info(f" ANDROID_NDK_HOME: {android_ndk_home}") - logging.info(f" ANDROID_HOME: {android_home}") + log.info("Android environment paths:") + log.info(f" ANDROID_NDK_HOME: {android_ndk_home}") + log.info(f" ANDROID_HOME: {android_home}") for k in ["ANDROID_NDK_HOME", "ANDROID_HOME"]: if k not in os.environ: @@ -225,9 +227,9 @@ def validate_build_environment(self): sdk_manager, checked_details = self._find_sdk_manager("validation") if not sdk_manager: - logging.error("SDK manager not found in any expected location") + log.error("SDK manager not found in any expected location") for detail in checked_details: - logging.error(f" {detail}") + log.error(f" {detail}") android_home = os.environ["ANDROID_HOME"] possible_fixes = [ @@ -314,7 +316,7 @@ def copyToSrcAndroid(self): "CHIPClusterID.jar": "src/controller/java/CHIPClusterID.jar", } - for jarName in jars.keys(): + for jarName in jars: self._Execute( [ "cp", @@ -339,7 +341,7 @@ def copyToExampleApp(self, jnilibs_dir, libs_dir, libs, jars): ] ) - for jarName in jars.keys(): + for jarName in jars: self._Execute( [ "cp", diff --git a/scripts/build/builders/bouffalolab.py b/scripts/build/builders/bouffalolab.py index 66172175853..e65a6fd3470 100644 --- a/scripts/build/builders/bouffalolab.py +++ b/scripts/build/builders/bouffalolab.py @@ -21,6 +21,8 @@ from .builder import BuilderOutput from .gn import GnBuilder +log = logging.getLogger(__name__) + class BouffalolabApp(Enum): LIGHT = auto() @@ -128,7 +130,7 @@ def __init__(self, self.argsOpt.append(f'board="{self.board.GnArgName()}"') self.argsOpt.append(f'baudrate="{baudrate}"') - enable_thread = False if enable_thread_type == BouffalolabThreadType.NONE else True + enable_thread = enable_thread_type != BouffalolabThreadType.NONE if not (enable_wifi or enable_thread or enable_ethernet): # decide default connectivity for each chip @@ -187,10 +189,10 @@ def __init__(self, enable_littlefs = True else: if not enable_easyflash and not enable_littlefs: - logging.fatal('*' * 80) - logging.fatal('littlefs is added to support for flash storage access.') - logging.fatal('Please consider and select one of easyflash and littlefs to use.') - logging.fatal('*' * 80) + log.fatal('*' * 80) + log.fatal('littlefs is added to support for flash storage access.') + log.fatal('Please consider and select one of easyflash and littlefs to use.') + log.fatal('*' * 80) raise Exception("None of easyflash and littlefs select to build.") self.argsOpt.append(f'bouffalo_sdk_component_easyflash_enabled={"false" if enable_littlefs else "true"}') @@ -255,14 +257,14 @@ def __init__(self, raise err def print_enviroment_error(self): - logging.fatal('*' * 80) - logging.error('Flashtool is not installed, or environment variable BOUFFALOLAB_SDK_ROOT is not exported.') - logging.fatal('\tPlease make sure Bouffalo Lab SDK installs as below:') - logging.fatal('\t\t./integrations/docker/images/stage-2/chip-build-bouffalolab/setup.sh') + log.fatal('*' * 80) + log.error('Flashtool is not installed, or environment variable BOUFFALOLAB_SDK_ROOT is not exported.') + log.fatal('\tPlease make sure Bouffalo Lab SDK installs as below:') + log.fatal('\t\t./integrations/docker/images/stage-2/chip-build-bouffalolab/setup.sh') - logging.fatal('\tPlease make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') - logging.fatal('\t\texport BOUFFALOLAB_SDK_ROOT="your install path"') - logging.fatal('*' * 80) + log.fatal('\tPlease make sure BOUFFALOLAB_SDK_ROOT exports before building as below:') + log.fatal('\t\texport BOUFFALOLAB_SDK_ROOT="your install path"') + log.fatal('*' * 80) def extract_sdk_version(self, filepath): pattern = r'PROJECT_SDK_VERSION\s+"([^"]+)"' @@ -278,7 +280,7 @@ def extract_sdk_version(self, filepath): return ver raise Exception('Invalid version format') except Exception as err: - logging.error(f"Failed to extract SDK version: {err}") + log.error(f"Failed to extract SDK version: {err}") return (2, 1, 0) def GnBuildArgs(self): @@ -311,15 +313,15 @@ def PostBuildCommand(self): path_fw = os.path.join(target_dir, self.app.AppNamePrefix(self.chip_name) + ".bin") path_flash_script = os.path.join(target_dir, self.app.AppNamePrefix(self.chip_name) + ".flash.py") - logging.info('*' * 80) - - logging.info("Firmware is built out at: {}".format(path_fw)) - logging.info("Command to generate ota image: ") - logging.info('./{} --build-ota --vendor-id --product-id ' - '--version --version-str ' - '--digest-algorithm '.format(path_flash_script)) - logging.info("Command to generate and sign ota image: ") - logging.info('./{} --build-ota --vendor-id --product-id ' - '--version --version-str ' - '--digest-algorithm --sk '.format(path_flash_script)) - logging.info('*' * 80) + log.info('*' * 80) + + log.info("Firmware is built out at: {}".format(path_fw)) + log.info("Command to generate ota image: ") + log.info('./{} --build-ota --vendor-id --product-id ' + '--version --version-str ' + '--digest-algorithm '.format(path_flash_script)) + log.info("Command to generate and sign ota image: ") + log.info('./{} --build-ota --vendor-id --product-id ' + '--version --version-str ' + '--digest-algorithm --sk '.format(path_flash_script)) + log.info('*' * 80) diff --git a/scripts/build/builders/builder.py b/scripts/build/builders/builder.py index 4ffde00ae34..471ea6c6a9d 100644 --- a/scripts/build/builders/builder.py +++ b/scripts/build/builders/builder.py @@ -19,6 +19,8 @@ from abc import ABC, abstractmethod from dataclasses import dataclass +log = logging.getLogger(__name__) + @dataclass class BuilderOptions: @@ -61,12 +63,12 @@ def __init__(self, root, runner): @abstractmethod def generate(self): """Generate the build files - generally the ninja/makefiles""" - raise NotImplementedError() + raise NotImplementedError @abstractmethod def _build(self): """Perform an actual build""" - raise NotImplementedError() + raise NotImplementedError def _bundle(self): """Perform an actual generating of flashbundle. @@ -84,7 +86,7 @@ def build_outputs(self): May use build output data (e.g. manifests), so this should be invoked only after a build has succeeded. """ - raise NotImplementedError() + raise NotImplementedError def bundle_outputs(self): """Return the BuilderOutput objects in flashbundle. @@ -114,20 +116,20 @@ def _Execute(self, cmdarray, title=None, dedup=False): def CompressArtifacts(self, target_file: str): with tarfile.open(target_file, "w:gz") as tar: for output in self.outputs(): - logging.info('Adding %s into %s(%s)', - output.source, target_file, output.target) + log.info('Adding %s into %s(%s)', + output.source, target_file, output.target) tar.add(output.source, output.target) def CopyArtifacts(self, target_dir: str): for output in self.outputs(): - logging.info(f'Copying {output.source} into {output.target}') + log.info(f'Copying {output.source} into {output.target}') target_full_name = os.path.join(target_dir, output.target) target_dir_full_name = os.path.dirname(target_full_name) if not os.path.exists(target_dir_full_name): - logging.info('Creating subdirectory %s first', - target_dir_full_name) + log.info('Creating subdirectory %s first', + target_dir_full_name) os.makedirs(target_dir_full_name) shutil.copyfile(output.source, target_full_name) diff --git a/scripts/build/builders/efr32.py b/scripts/build/builders/efr32.py index c23e126591e..ed6ce5393ac 100644 --- a/scripts/build/builders/efr32.py +++ b/scripts/build/builders/efr32.py @@ -22,6 +22,8 @@ from .builder import BuilderOutput from .gn import GnBuilder +log = logging.getLogger(__name__) + class Efr32App(Enum): EVSE = auto() @@ -296,7 +298,7 @@ def _bundle(self): # Only unit-test needs to generate the flashbundle here. All other examples will generate a flashbundle via the silabs_executable template. if self.app == Efr32App.UNIT_TEST: flash_bundle_path = os.path.join(self.output_dir, self.app.FlashBundleName()) - logging.info(f'Generating flashbundle {flash_bundle_path}') + log.info(f'Generating flashbundle {flash_bundle_path}') patterns = [ os.path.join(self.output_dir, "tests", "*.flash.py"), diff --git a/scripts/build/builders/esp32.py b/scripts/build/builders/esp32.py index 95adabfb1d9..a72f383a8c8 100644 --- a/scripts/build/builders/esp32.py +++ b/scripts/build/builders/esp32.py @@ -20,6 +20,8 @@ from .builder import Builder, BuilderOutput +log = logging.getLogger(__name__) + class Esp32Board(Enum): DevKitC = auto() @@ -261,7 +263,7 @@ def generate(self): self._IdfEnvExecute(cmd) def _build(self): - logging.info('Compiling Esp32 at %s', self.output_dir) + log.info('Compiling Esp32 at %s', self.output_dir) # Unfortunately sdkconfig is sticky and needs reset on every build self._Execute( diff --git a/scripts/build/builders/genio.py b/scripts/build/builders/genio.py old mode 100755 new mode 100644 diff --git a/scripts/build/builders/nrf.py b/scripts/build/builders/nrf.py index af86600286d..84c4f98b9ec 100644 --- a/scripts/build/builders/nrf.py +++ b/scripts/build/builders/nrf.py @@ -19,6 +19,8 @@ from .builder import Builder, BuilderOutput +log = logging.getLogger(__name__) + class NrfApp(Enum): ALL_CLUSTERS = auto() @@ -148,8 +150,8 @@ def _check_ncs_version(self): self._Execute( ['python3', 'scripts/setup/nrfconnect/update_ncs.py', '--check']) except Exception: - logging.exception('Failed to validate ZEPHYR_BASE status') - logging.error( + log.exception('Failed to validate ZEPHYR_BASE status') + log.error( 'To update $ZEPHYR_BASE run: python3 scripts/setup/nrfconnect/update_ncs.py --update --shallow') raise Exception('ZEPHYR_BASE validation failed') @@ -198,7 +200,7 @@ def generate(self): title='Generating ' + self.identifier) def _build(self): - logging.info('Compiling NrfConnect at %s', self.output_dir) + log.info('Compiling NrfConnect at %s', self.output_dir) cmd = self._prepare_environment() cmd += f'ninja -C {self.output_dir}' @@ -216,7 +218,7 @@ def _build(self): title='Run Tests ' + self.identifier) def _bundle(self): - logging.info(f'Generating flashbundle at {self.output_dir}') + log.info(f'Generating flashbundle at {self.output_dir}') self._Execute(['ninja', '-C', os.path.join(self.output_dir, 'nrfconnect'), 'flashing_script'], title='Generating flashable files of ' + self.identifier) diff --git a/scripts/build/builders/nuttx.py b/scripts/build/builders/nuttx.py index 67c7b7273f9..167ca48aa08 100644 --- a/scripts/build/builders/nuttx.py +++ b/scripts/build/builders/nuttx.py @@ -19,6 +19,8 @@ from .builder import BuilderOutput from .gn import Builder +log = logging.getLogger(__name__) + class NuttXApp(Enum): LIGHT = auto() @@ -77,12 +79,12 @@ def generate(self): title='Configuring ' + self.identifier) def _build(self): - logging.info('Compiling NuttX %s at %s, ', - self.board.board_config, self.output_dir) + log.info('Compiling NuttX %s at %s, ', + self.board.board_config, self.output_dir) self._Execute(['cmake', '--build', self.output_dir]) def build_outputs(self): - logging.info('Compiling outputs NuttX at %s', self.output_dir) + log.info('Compiling outputs NuttX at %s', self.output_dir) extensions = ["out"] if self.options.enable_link_map_file: extensions.append("out.map") diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 82d36c7ac66..d6f3dc33b3e 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -20,6 +20,8 @@ from .builder import BuilderOutput from .gn import GnBuilder +log = logging.getLogger(__name__) + class NxpOsUsed(Enum): FREERTOS = auto() @@ -215,7 +217,7 @@ def __init__(self, self.iw610_transceiver = iw610_transceiver self.se05x_enable = se05x_enable if self.low_power and log_level != NxpLogLevel.NONE: - logging.warning("Switching log level to 'NONE' for low power build") + log.warning("Switching log level to 'NONE' for low power build") log_level = NxpLogLevel.NONE self.log_level = log_level diff --git a/scripts/build/builders/telink.py b/scripts/build/builders/telink.py index 186df23599e..792ae4b4aa3 100644 --- a/scripts/build/builders/telink.py +++ b/scripts/build/builders/telink.py @@ -19,6 +19,8 @@ from .builder import Builder, BuilderOutput +log = logging.getLogger(__name__) + class TelinkLogLevel(Enum): DEFAULT = auto() # default everything @@ -286,7 +288,7 @@ def generate(self): title='Generating ' + self.identifier) def _build(self): - logging.info('Compiling Telink at %s', self.output_dir) + log.info('Compiling Telink at %s', self.output_dir) cmd = self.get_cmd_prefixes() + ("ninja -C %s" % self.output_dir) diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index b20bd415a47..a245b33718a 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import contextlib import logging import os from collections import namedtuple @@ -21,6 +22,8 @@ from .builder import BuilderOutput from .gn import GnBuilder +log = logging.getLogger(__name__) + Board = namedtuple('Board', ['target_cpu']) App = namedtuple('App', ['name', 'source', 'outputs']) Tool = namedtuple('Tool', ['name', 'source', 'outputs']) @@ -102,15 +105,13 @@ def __init__(self, self.extra_gn_options = [] if self.app.is_tpk: - try: + with contextlib.suppress(FileNotFoundError): # Try to load Tizen application XML manifest. We have to use # try/except here, because of TestBuilder test. This test runs # in a fake build root /TEST/BUILD/ROOT which obviously does # not have Tizen manifest file. self.app.parse_manifest( os.path.join(self.root, "tizen-manifest.xml")) - except FileNotFoundError: - pass if app == TizenApp.TESTS: self.extra_gn_options.append('chip_build_tests=true') @@ -222,7 +223,7 @@ def GnBuildArgs(self): def _bundle(self): if self.app.is_tpk: - logging.info('Packaging %s', self.output_dir) + log.info('Packaging %s', self.output_dir) cmd = ['ninja', '-C', self.output_dir, self.app.value.name + ':tpk'] self._Execute(cmd, title='Packaging ' + self.identifier) diff --git a/scripts/build/clang_coverage_wrapper.py b/scripts/build/clang_coverage_wrapper.py old mode 100644 new mode 100755 index 452d827d417..e6d13e671af --- a/scripts/build/clang_coverage_wrapper.py +++ b/scripts/build/clang_coverage_wrapper.py @@ -54,12 +54,14 @@ } gInitLLVMProfilingPaths; """ +log = logging.getLogger(__name__) + @click.command() @click.option( "--log-level", default="INFO", - type=click.Choice([k for k in __LOG_LEVELS__], case_sensitive=False), + type=click.Choice(list(__LOG_LEVELS__), case_sensitive=False), help="Determines the verbosity of script output.", ) @click.option( @@ -82,14 +84,14 @@ def main(log_level, log_timestamps, output, raw_profile_filename): if os.path.exists(output): with open(output) as f: if f.read() == expected_output: - logging.info("File %s is already as expected. Will not re-write", output) + log.info("File %s is already as expected. Will not re-write", output) sys.exit(0) - logging.info("Writing output to %s (profile name: %s)", output, raw_profile_filename) + log.info("Writing output to %s (profile name: %s)", output, raw_profile_filename) with open(output, "wt") as f: f.write(expected_output) - logging.debug("Writing completed") + log.debug("Writing completed") if __name__ == "__main__": diff --git a/scripts/build/runner/shell.py b/scripts/build/runner/shell.py index 67eda1d3352..4a8a3abc739 100644 --- a/scripts/build/runner/shell.py +++ b/scripts/build/runner/shell.py @@ -19,6 +19,8 @@ from .command_dedup import CommandDedup +log = logging.getLogger(__name__) + class LogPipe(threading.Thread): @@ -41,7 +43,7 @@ def fileno(self): def run(self): """Run the thread, logging everything.""" for line in iter(self.pipeReader.readline, ''): - logging.log(self.level, line.strip('\n')) + log.log(self.level, line.strip('\n')) self.pipeReader.close() @@ -63,10 +65,10 @@ def StartCommandExecution(self): def Run(self, cmd, title=None, dedup=False): if title: - logging.info(title) + log.info(title) - if dedup & self.deduplicator.is_duplicate(cmd): - logging.info("Skipping duplicate command...") + if dedup and self.deduplicator.is_duplicate(cmd): + log.info("Skipping duplicate command...") return outpipe = LogPipe(logging.INFO) @@ -79,4 +81,4 @@ def Run(self, cmd, title=None, dedup=False): code = s.wait() if code != 0: raise Exception('Command %r failed: %d' % (cmd, code)) - logging.info('Command %r completed', cmd) + log.info('Command %r completed', cmd) diff --git a/scripts/build/test.py b/scripts/build/test.py old mode 100644 new mode 100755 index a545cba884f..7a8f1931272 --- a/scripts/build/test.py +++ b/scripts/build/test.py @@ -76,10 +76,10 @@ def assertCommandOutput(self, expected_file: str, args: List[str]): ROOT = '/TEST/BUILD/ROOT' OUT = '/OUTPUT/DIR' - expected = [line for line in build_expected_output(expected_file, ROOT, OUT)] - actual = [line for line in build_actual_output(ROOT, OUT, args)] + expected = list(build_expected_output(expected_file, ROOT, OUT)) + actual = list(build_actual_output(ROOT, OUT, args)) - diffs = [line for line in difflib.unified_diff(expected, actual)] + diffs = list(difflib.unified_diff(expected, actual)) if diffs: reference = os.path.basename(expected_file) + '.actual' diff --git a/scripts/build/test_glob_matcher.py b/scripts/build/test_glob_matcher.py old mode 100644 new mode 100755 diff --git a/scripts/flashing/firmware_utils.py b/scripts/flashing/firmware_utils.py index d02e2179a6f..569145d7f4b 100755 --- a/scripts/flashing/firmware_utils.py +++ b/scripts/flashing/firmware_utils.py @@ -180,7 +180,7 @@ def status(self): def actions(self): """Perform actions on the device according to self.option.""" - raise NotImplementedError() + raise NotImplementedError def log(self, level, *args): """Optionally log a message to stderr.""" diff --git a/scripts/flashing/psoc6_firmware_utils.py b/scripts/flashing/psoc6_firmware_utils.py index 0dcf8c59424..064a0f63b3e 100755 --- a/scripts/flashing/psoc6_firmware_utils.py +++ b/scripts/flashing/psoc6_firmware_utils.py @@ -138,10 +138,10 @@ def __init__(self, **options): self.define_options(PSOC6_OPTIONS) def verify(self, image): - raise NotImplementedError() + raise NotImplementedError def reset(self): - raise NotImplementedError() + raise NotImplementedError def erase(self): tools_path = _find_tools_path() diff --git a/scripts/py_matter_idl/matter/idl/generators/storage.py b/scripts/py_matter_idl/matter/idl/generators/storage.py index 589e81da4f6..b490cc94e65 100644 --- a/scripts/py_matter_idl/matter/idl/generators/storage.py +++ b/scripts/py_matter_idl/matter/idl/generators/storage.py @@ -41,11 +41,11 @@ def get_existing_data(self, relative_path: str): """Gets the existing data at the given path. If such data does not exist, will return None. """ - raise NotImplementedError() + raise NotImplementedError def write_new_data(self, relative_path: str, content: str): """Write new data to the given path.""" - raise NotImplementedError() + raise NotImplementedError class FileSystemGeneratorStorage(GeneratorStorage): diff --git a/scripts/py_matter_idl/matter/idl/lint/type_definitions.py b/scripts/py_matter_idl/matter/idl/lint/type_definitions.py index a755828af15..99d4d830da6 100644 --- a/scripts/py_matter_idl/matter/idl/lint/type_definitions.py +++ b/scripts/py_matter_idl/matter/idl/lint/type_definitions.py @@ -156,7 +156,7 @@ def _ClusterCode(self, name: str, location: Optional[LocationInFile]): On error returns None and _lint_errors is updated internlly """ if not self._idl: - raise MissingIdlError() + raise MissingIdlError cluster_definition = [c for c in self._idl.clusters if c.name == name] if not cluster_definition: @@ -173,7 +173,7 @@ def _ClusterCode(self, name: str, location: Optional[LocationInFile]): def _LintImpl(self): if not self._idl: - raise MissingIdlError() + raise MissingIdlError for endpoint in self._idl.endpoints: cluster_codes = set() @@ -238,7 +238,7 @@ def _ServerClusterDefinition(self, name: str, location: Optional[LocationInFile] On error returns None and _lint_errors is updated internlly """ if not self._idl: - raise MissingIdlError() + raise MissingIdlError cluster_definition = [c for c in self._idl.clusters if c.name == name] if not cluster_definition: @@ -255,7 +255,7 @@ def _ServerClusterDefinition(self, name: str, location: Optional[LocationInFile] def _LintImpl(self): if not self._idl: - raise MissingIdlError() + raise MissingIdlError for endpoint in self._idl.endpoints: @@ -358,7 +358,7 @@ def RequireCommand(self, cmd: ClusterCommandRequirement): def _LintImpl(self): if not self._idl: - raise MissingIdlError() + raise MissingIdlError for cluster in self._idl.clusters: if cluster.code not in self._mandatory_commands: diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-server.cpp b/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.cpp similarity index 98% rename from src/app/clusters/closure-dimension-server/closure-dimension-server.cpp rename to src/app/clusters/closure-dimension-server/ClosureDimensionCluster.cpp index 8c0001fb9df..ee21a41015b 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-server.cpp +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.cpp @@ -16,8 +16,8 @@ * */ -#include "closure-dimension-server.h" -#include "closure-dimension-cluster-logic.h" +#include "ClosureDimensionCluster.h" +#include "ClosureDimensionClusterLogic.h" namespace chip { namespace app { diff --git a/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.h b/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.h new file mode 100644 index 00000000000..4648b567fef --- /dev/null +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.h @@ -0,0 +1,71 @@ +/** + * + * Copyright (c) 2025 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ +#pragma once +#include "ClosureDimensionClusterLogic.h" + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ClosureDimension { + +/** + * @brief Class implements the client facing APIs to read, write and process incoming commands + * App should instantiate and init one Interface per endpoint + */ +class Interface : public AttributeAccessInterface, public CommandHandlerInterface +{ +public: + Interface(EndpointId endpoint, ClusterLogic & clusterLogic) : + AttributeAccessInterface(Optional(endpoint), Id), CommandHandlerInterface(Optional(endpoint), Id), + mClusterLogic(clusterLogic) + {} + + // AttributeAccessInterface implementation + + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + + // CommandHandlerInterface implementation + + void InvokeCommand(HandlerContext & handlerContext) override; + + /** + * @brief This function registers attribute access and command handler. + * @return CHIP_NO_ERROR when succesfully initialized. + * Aborts if registration fails. + */ + CHIP_ERROR Init(); + + /** + * @brief This function unregisters attribute access and command handlers. + * @return CHIP_NO_ERROR when succesfully initialized + * Aborts if attribute access unregistration fails. + */ + CHIP_ERROR Shutdown(); + +private: + // This is owned by the caller and passed to the interface for its use. + ClusterLogic & mClusterLogic; +}; + +} // namespace ClosureDimension +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/closure-dimension-server/ClosureDimensionClusterDelegate.h b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterDelegate.h new file mode 100644 index 00000000000..f66071d55d6 --- /dev/null +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterDelegate.h @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2025 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ClosureDimension { + +/** @brief + * Defines methods for implementing application-specific logic for the Closure Dimension Cluster. + */ + +class DelegateBase +{ +public: + DelegateBase(){}; + virtual ~DelegateBase() = default; + + /** + * @brief This function handles SetTarget command implementaion. + * + * @param [in] position TargetState position to be set + * @param [in] latch TargetState Latch to be set + * @param [in] speed TargetState speed to be set + * + * @return Success when succesfully handled. + * Error when handle SetTarget fails. + */ + virtual Protocols::InteractionModel::Status HandleSetTarget(const Optional & position, + const Optional & latch, + const Optional & speed) = 0; + + /** + * @brief This function handles Step command implementaion. + * + * @param [in] direction step direction + * @param [in] numberOfSteps total number of steps + * @param [in] speed speed of each step + * + * @return Success when successfully handled. + * Error when handle Step fails. + */ + virtual Protocols::InteractionModel::Status HandleStep(const StepDirectionEnum & direction, const uint16_t & numberOfSteps, + const Optional & speed) = 0; +}; + +} // namespace ClosureDimension +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.cpp b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.cpp similarity index 99% rename from src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.cpp rename to src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.cpp index 9cbb139d303..5db094dfbd0 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.cpp +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.cpp @@ -18,7 +18,7 @@ * @file Cross-platform API to handle cluster-specific logic for the closure dimension cluster on a single endpoint. */ -#include "closure-dimension-cluster-logic.h" +#include "ClosureDimensionClusterLogic.h" #include #include diff --git a/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.h b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.h new file mode 100644 index 00000000000..66f944f4eff --- /dev/null +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.h @@ -0,0 +1,365 @@ +/** + * + * Copyright (c) 2025 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "ClosureDimensionClusterDelegate.h" +#include "ClosureDimensionClusterMatterContext.h" +#include "GenericDimensionState.h" +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ClosureDimension { + +/** + * @brief Structure is used to configure and validate the Cluster configuration. + * Validates if the feature map, attributes and commands configuration is valid. + */ +struct ClusterConformance +{ + BitFlags & FeatureMap() { return mFeatureMap; } + const BitFlags & FeatureMap() const { return mFeatureMap; } + + inline bool HasFeature(Feature aFeature) const { return mFeatureMap.Has(aFeature); } + + /** + * @brief Function determines if Cluster conformance is valid + * + * The function executes these checks in order to validate the conformance + * 1. Check if either Positioning or MotionLatching is supported. If neither are enabled, returns false. + * 2. If Unit, Limitation or speed is enabled, Positioning must be enabled. Return false otherwise. + * 3. If Translation, Rotation or Modulation is enabled, Positioning must be enabled. Return false otherwise. + * 4. Only one of Translation, Rotation or Modulation must be enabled. Return false otherwise. + * 5. If the Overflow attribute is supported, at least one of Rotation or MotionLatching feature must be supported. + * Return false otherwise. + * 6. If Rotation feature is enabled, then the Overflow attribute must be supported. Return false otherwise. + * + * @return true, the cluster confirmance is valid + * false, otherwise + */ + bool Valid() const + { + // Positioning or Matching must be enabled + VerifyOrReturnValue(HasFeature(Feature::kPositioning) || HasFeature(Feature::kMotionLatching), false, + ChipLogError(AppServer, "Validation failed: Neither Positioning nor MotionLatching is enabled.")); + + // If Unit, Limitation or speed is enabled, Positioning must be enabled + if (HasFeature(Feature::kUnit) || HasFeature(Feature::kLimitation) || HasFeature(Feature::kSpeed)) + { + VerifyOrReturnValue( + HasFeature(Feature::kPositioning), false, + ChipLogError(AppServer, "Validation failed: Unit , Limitation, and speed requires the Positioning feature.")); + } + + // If Translation, Rotation or Modulation is enabled, Positioning must be enabled. + if (HasFeature(Feature::kTranslation) || HasFeature(Feature::kRotation) || HasFeature(Feature::kModulation)) + { + VerifyOrReturnValue( + HasFeature(Feature::kPositioning), false, + ChipLogError(NotSpecified, "Validation failed: Translation, Rotation or Modulation requires Positioning enabled.")); + } + + // Only one of Translation, Rotation or Modulation features must be enabled. Return false otherwise. + if ((HasFeature(Feature::kTranslation) && HasFeature(Feature::kRotation)) || + (HasFeature(Feature::kRotation) && HasFeature(Feature::kModulation)) || + (HasFeature(Feature::kModulation) && HasFeature(Feature::kTranslation))) + { + ChipLogError(AppServer, "Validation failed: Only one of Translation, Rotation or Modulation feature can be enabled."); + return false; + } + return true; + } + +private: + BitFlags mFeatureMap; +}; + +/** + * @brief Struct to store the cluster Initilization parameters + */ +struct ClusterInitParameters +{ + TranslationDirectionEnum translationDirection = TranslationDirectionEnum::kUnknownEnumValue; + RotationAxisEnum rotationAxis = RotationAxisEnum::kUnknownEnumValue; + ModulationTypeEnum modulationType = ModulationTypeEnum::kUnknownEnumValue; +}; + +/** + * @brief Struct to store the current cluster state + */ +struct ClusterState +{ + DataModel::Nullable currentState{ DataModel::NullNullable }; + DataModel::Nullable targetState{ DataModel::NullNullable }; + Percent100ths resolution = 1; + Percent100ths stepValue = 1; + ClosureUnitEnum unit = ClosureUnitEnum::kUnknownEnumValue; + DataModel::Nullable unitRange = DataModel::Nullable(); + Structs::RangePercent100thsStruct::Type limitRange{}; + TranslationDirectionEnum translationDirection = TranslationDirectionEnum::kUnknownEnumValue; + RotationAxisEnum rotationAxis = RotationAxisEnum::kUnknownEnumValue; + OverflowEnum overflow = OverflowEnum::kUnknownEnumValue; + ModulationTypeEnum modulationType = ModulationTypeEnum::kUnknownEnumValue; + BitFlags latchControlModes; +}; + +class ClusterLogic +{ +public: + /** + * @brief Instantiates a ClusterLogic class. The caller maintains ownership of the driver and the context, + * but provides them for use by the ClusterLogic class. + */ + ClusterLogic(DelegateBase & delegate, MatterContext & matterContext) : mDelegate(delegate), mMatterContext(matterContext) {} + + const ClusterState & GetState() { return mState; } + const ClusterConformance & GetConformance() { return mConformance; } + + /** + * @brief Validates the conformance and performs initialisation and sets up the ClusterInitParameters into Attributes. + * + * @param [in] conformance cluster conformance + * @param [in] clusterInitParameters cluster Init Parameters + * + * @return CHIP_ERROR_INCORRECT_STATE if the cluster has already been initialized, + * CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR if the conformance is incorrect. + * Set function errors if setting the attributes with the provided ClusterInitParameters fails. + * CHIP_NO_ERROR on succesful initialisation. + */ + CHIP_ERROR Init(const ClusterConformance & conformance, const ClusterInitParameters & clusterInitParameters); + + /** + * @brief Set Current State. + * + * @param[in] currentState Current State Position, Latch and Speed. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + */ + CHIP_ERROR SetCurrentState(const DataModel::Nullable & currentState); + + /** + * @brief Set TargetState. + * + * @param[in] targetState TargetState Position, Latch and Speed. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + */ + CHIP_ERROR SetTargetState(const DataModel::Nullable & targetState); + + /** + * @brief Set Resolution. + * + * @param[in] resolution Minimal acceptable change of Position fields of attributes. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetResolution(const Percent100ths resolution); + + /** + * @brief Set StepValue. + * + * @param[in] stepValue One step value for Step command + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetStepValue(const Percent100ths stepValue); + + /** + * @brief Set Unit. + * + * @param[in] unit Unit related to the Positioning. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetUnit(const ClosureUnitEnum unit); + + /** + * @brief Set UnitRange. + * + * @param[in] unitRange Minimum and Maximum values expressed by positioning following the unit. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetUnitRange(const DataModel::Nullable & unitRange); + + /** + * @brief Set LimitRange. + * + * @param[in] limitRange Range of possible values for the position field in Current attribute. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetLimitRange(const Structs::RangePercent100thsStruct::Type & limitRange); + + /** + * @brief Set Overflow. + * + * @param[in] overflow Overflow related to Rotation. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + */ + CHIP_ERROR SetOverflow(const OverflowEnum overflow); + + /** + * @brief Sets the latch control modes for the closure dimension cluster. + * + * This method updates the latch control modes using the provided bit flags. + * + * @param latchControlModes BitFlags representing the desired latch control modes. + * @return CHIP_ERROR Returns CHIP_NO_ERROR on success, or an appropriate error code on failure. + */ + CHIP_ERROR SetLatchControlModes(const BitFlags & latchControlModes); + + // All Get functions: + // Return CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. + // Return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if the attribute is not supported. + // Otherwise return CHIP_NO_ERROR and set the input parameter value to the current cluster state value + CHIP_ERROR GetCurrentState(DataModel::Nullable & currentState); + CHIP_ERROR GetTargetState(DataModel::Nullable & targetState); + CHIP_ERROR GetResolution(Percent100ths & resolution); + CHIP_ERROR GetStepValue(Percent100ths & stepValue); + CHIP_ERROR GetUnit(ClosureUnitEnum & unit); + CHIP_ERROR GetUnitRange(DataModel::Nullable & unitRange); + CHIP_ERROR GetLimitRange(Structs::RangePercent100thsStruct::Type & limitRange); + CHIP_ERROR GetTranslationDirection(TranslationDirectionEnum & translationDirection); + CHIP_ERROR GetRotationAxis(RotationAxisEnum & rotationAxis); + CHIP_ERROR GetOverflow(OverflowEnum & overflow); + CHIP_ERROR GetModulationType(ModulationTypeEnum & modulationType); + CHIP_ERROR GetLatchControlModes(BitFlags & latchControlModes); + CHIP_ERROR GetFeatureMap(BitFlags & featureMap); + CHIP_ERROR GetClusterRevision(Attributes::ClusterRevision::TypeInfo::Type & clusterRevision); + + /** + * @brief Calls delegate HandleSetTarget function after validating the parameters and conformance. + * + * @param [in] position TargetState position + * @param [in] latch TargetState latch + * @param [in] speed TargetState speed + * + * @return Exits if the cluster is not initialized. + * InvalidCommand if none of the input parameters are present. + * ConstraintError if the input values are out is out of range. + * InvalidInState if the current position of closure is not known. + * Success on succesful handling. + */ + Protocols::InteractionModel::Status HandleSetTargetCommand(Optional position, Optional latch, + Optional speed); + + /** + * @brief Calls delegate HandleStep function after validating the parameters and conformance. + * + * @param [in] direction step direction + * @param [in] numberOfSteps Number of steps + * @param [in] speed step speed + * + * @return Exits if the cluster is not initialized. + * UnsupportedCommand if Positioning feature is not supported. + * ConstraintError if the input values are out is out of range. + * InvalidInState if the current position of closure is not known. + * Success on successful handling. + */ + Protocols::InteractionModel::Status HandleStepCommand(StepDirectionEnum direction, uint16_t numberOfSteps, + Optional speed); + +private: + /** + * @brief Set TranslationDirection. + * This attribute is not supposed to change once the installation is finalized. + * SetTranslationDirection should only be called from Init() + * + * @param[in] translationDirection Direction of the translation. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported + * + */ + CHIP_ERROR SetTranslationDirection(const TranslationDirectionEnum translationDirection); + + /** + * @brief Set RotationAxis. + * This attribute is not supposed to change once the installation is finalized. + * so SetRotationAxis should only be called from Init(). + * + * @param[in] rotationAxis Axis of the rotation. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported + * + */ + CHIP_ERROR SetRotationAxis(const RotationAxisEnum rotationAxis); + + /** + * @brief Set ModulationType. + * This attribute is not supposed to change once the installation is finalized. + * so SetModulationType should only be called from Init(). + * + * @param[in] modulationType Modulation type. + * + * @return CHIP_NO_ERROR if set was successful. + * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid + * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized + * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. + * + */ + CHIP_ERROR SetModulationType(const ModulationTypeEnum modulationType); + + bool mInitialized = false; + ClusterState mState; + ClusterConformance mConformance; + DelegateBase & mDelegate; + MatterContext & mMatterContext; + + // At Present, QuieterReportingAttribute doesnt support Structs. + // So, this variable will be used for Quietreporting of current state position. + // TODO: Refactor CurrentState Atrribute to use QuieterReportingAttribute once Issue#39801 is resolved + QuieterReportingAttribute quietReportableCurrentStatePosition{ DataModel::NullNullable }; +}; + +} // namespace ClosureDimension +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.cpp b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.cpp similarity index 96% rename from src/app/clusters/closure-dimension-server/closure-dimension-matter-context.cpp rename to src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.cpp index 8ccdfe3f5d8..c579eb42fca 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.cpp +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.cpp @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "closure-dimension-matter-context.h" +#include "ClosureDimensionClusterMatterContext.h" #include #include #include diff --git a/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.h b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.h new file mode 100644 index 00000000000..b047cd3720c --- /dev/null +++ b/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.h @@ -0,0 +1,54 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ClosureDimension { + +/** @brief + * Interface to allow interaction with interaction model and ember layers. Can be faked for unit testing. + */ +class MatterContext +{ +public: + MatterContext(EndpointId endpoint) : mEndpoint(endpoint) {} + + /** + * @brief calls the attribute change callback + * @param[in] attributeId Attribute ID whose value needs to be marked dirty. + */ + virtual void MarkDirty(AttributeId attributeId); + + virtual ~MatterContext() = default; + + EndpointId GetEndpointId() const { return mEndpoint; } + +private: + EndpointId mEndpoint; +}; + +} // namespace ClosureDimension +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/closure-dimension-server/CodegenIntegration.h b/src/app/clusters/closure-dimension-server/CodegenIntegration.h new file mode 100644 index 00000000000..a1b0c072a9d --- /dev/null +++ b/src/app/clusters/closure-dimension-server/CodegenIntegration.h @@ -0,0 +1,20 @@ +/** + * + * Copyright (c) 2026 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include diff --git a/src/app/clusters/closure-dimension-server/GenericDimensionState.h b/src/app/clusters/closure-dimension-server/GenericDimensionState.h new file mode 100644 index 00000000000..72bb22eeb9b --- /dev/null +++ b/src/app/clusters/closure-dimension-server/GenericDimensionState.h @@ -0,0 +1,70 @@ +/* + * + * Copyright (c) 2025 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ClosureDimension { + +/** + * Structure represents the current state struct of a closure dimension cluster derivation instance. + */ +struct GenericDimensionStateStruct : public Structs::DimensionStateStruct::Type +{ + GenericDimensionStateStruct(Optional> positionValue = NullOptional, + Optional> latchValue = NullOptional, + Optional speedValue = NullOptional) + { + Set(positionValue, latchValue, speedValue); + } + + GenericDimensionStateStruct(const GenericDimensionStateStruct & currentState) { *this = currentState; } + + GenericDimensionStateStruct & operator=(const GenericDimensionStateStruct & current) + { + Set(current.position, current.latch, current.speed); + return *this; + } + + void Set(Optional> positionValue = NullOptional, + Optional> latchValue = NullOptional, + Optional speedValue = NullOptional) + { + position = positionValue; + latch = latchValue; + speed = speedValue; + } + + bool operator==(const GenericDimensionStateStruct & rhs) const + { + return position == rhs.position && latch == rhs.latch && speed == rhs.speed; + } + + bool operator!=(const GenericDimensionStateStruct & rhs) const + { + return position != rhs.position || latch != rhs.latch || speed != rhs.speed; + } +}; +} // namespace ClosureDimension +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/closure-dimension-server/app_config_dependent_sources.cmake b/src/app/clusters/closure-dimension-server/app_config_dependent_sources.cmake index d4378d502bd..0cb5fcaa496 100644 --- a/src/app/clusters/closure-dimension-server/app_config_dependent_sources.cmake +++ b/src/app/clusters/closure-dimension-server/app_config_dependent_sources.cmake @@ -16,12 +16,12 @@ TARGET_SOURCES( ${APP_TARGET} PRIVATE - "${CLUSTER_DIR}/closure-dimension-cluster-logic.cpp" + "${CLUSTER_DIR}/ClosureDimensionClusterLogic.cpp" "${CLUSTER_DIR}/closure-dimension-cluster-logic.h" "${CLUSTER_DIR}/closure-dimension-cluster-objects.h" "${CLUSTER_DIR}/closure-dimension-delegate.h" - "${CLUSTER_DIR}/closure-dimension-matter-context.cpp" + "${CLUSTER_DIR}/ClosureDimensionClusterMatterContext.cpp" "${CLUSTER_DIR}/closure-dimension-matter-context.h" - "${CLUSTER_DIR}/closure-dimension-server.cpp" + "${CLUSTER_DIR}/ClosureDimensionCluster.cpp" "${CLUSTER_DIR}/closure-dimension-server.h" ) \ No newline at end of file diff --git a/src/app/clusters/closure-dimension-server/app_config_dependent_sources.gni b/src/app/clusters/closure-dimension-server/app_config_dependent_sources.gni index 4770782d2cd..49c9b98ca7b 100644 --- a/src/app/clusters/closure-dimension-server/app_config_dependent_sources.gni +++ b/src/app/clusters/closure-dimension-server/app_config_dependent_sources.gni @@ -12,12 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. app_config_dependent_sources = [ - "closure-dimension-cluster-logic.cpp", + "ClosureDimensionCluster.cpp", + "ClosureDimensionClusterLogic.cpp", + "ClosureDimensionClusterMatterContext.cpp", "closure-dimension-cluster-logic.h", "closure-dimension-cluster-objects.h", "closure-dimension-delegate.h", - "closure-dimension-matter-context.cpp", "closure-dimension-matter-context.h", - "closure-dimension-server.cpp", "closure-dimension-server.h", ] diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.h b/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.h index 6e774319fff..42939671f58 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.h +++ b/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.h @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2025 Project CHIP Authors + * Copyright (c) 2026 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,355 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/** - * @file Cross-platform API to handle cluster-specific logic for the valve configuration and control cluster on a single endpoint. - */ #pragma once -#include "closure-dimension-cluster-objects.h" -#include "closure-dimension-delegate.h" -#include "closure-dimension-matter-context.h" -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ClosureDimension { - -/** - * @brief Structure is used to configure and validate the Cluster configuration. - * Validates if the feature map, attributes and commands configuration is valid. - */ -struct ClusterConformance -{ - BitFlags & FeatureMap() { return mFeatureMap; } - const BitFlags & FeatureMap() const { return mFeatureMap; } - - inline bool HasFeature(Feature aFeature) const { return mFeatureMap.Has(aFeature); } - - /** - * @brief Function determines if Cluster conformance is valid - * - * The function executes these checks in order to validate the conformance - * 1. Check if either Positioning or MotionLatching is supported. If neither are enabled, returns false. - * 2. If Unit, Limitation or speed is enabled, Positioning must be enabled. Return false otherwise. - * 3. If Translation, Rotation or Modulation is enabled, Positioning must be enabled. Return false otherwise. - * 4. Only one of Translation, Rotation or Modulation must be enabled. Return false otherwise. - * 5. If the Overflow attribute is supported, at least one of Rotation or MotionLatching feature must be supported. - * Return false otherwise. - * 6. If Rotation feature is enabled, then the Overflow attribute must be supported. Return false otherwise. - * - * @return true, the cluster confirmance is valid - * false, otherwise - */ - bool Valid() const - { - // Positioning or Matching must be enabled - VerifyOrReturnValue(HasFeature(Feature::kPositioning) || HasFeature(Feature::kMotionLatching), false, - ChipLogError(AppServer, "Validation failed: Neither Positioning nor MotionLatching is enabled.")); - - // If Unit, Limitation or speed is enabled, Positioning must be enabled - if (HasFeature(Feature::kUnit) || HasFeature(Feature::kLimitation) || HasFeature(Feature::kSpeed)) - { - VerifyOrReturnValue( - HasFeature(Feature::kPositioning), false, - ChipLogError(AppServer, "Validation failed: Unit , Limitation, and speed requires the Positioning feature.")); - } - - // If Translation, Rotation or Modulation is enabled, Positioning must be enabled. - if (HasFeature(Feature::kTranslation) || HasFeature(Feature::kRotation) || HasFeature(Feature::kModulation)) - { - VerifyOrReturnValue( - HasFeature(Feature::kPositioning), false, - ChipLogError(NotSpecified, "Validation failed: Translation, Rotation or Modulation requires Positioning enabled.")); - } - - // Only one of Translation, Rotation or Modulation features must be enabled. Return false otherwise. - if ((HasFeature(Feature::kTranslation) && HasFeature(Feature::kRotation)) || - (HasFeature(Feature::kRotation) && HasFeature(Feature::kModulation)) || - (HasFeature(Feature::kModulation) && HasFeature(Feature::kTranslation))) - { - ChipLogError(AppServer, "Validation failed: Only one of Translation, Rotation or Modulation feature can be enabled."); - return false; - } - return true; - } - -private: - BitFlags mFeatureMap; -}; - -/** - * @brief Struct to store the cluster Initilization parameters - */ -struct ClusterInitParameters -{ - TranslationDirectionEnum translationDirection = TranslationDirectionEnum::kUnknownEnumValue; - RotationAxisEnum rotationAxis = RotationAxisEnum::kUnknownEnumValue; - ModulationTypeEnum modulationType = ModulationTypeEnum::kUnknownEnumValue; -}; - -/** - * @brief Struct to store the current cluster state - */ -struct ClusterState -{ - DataModel::Nullable currentState{ DataModel::NullNullable }; - DataModel::Nullable targetState{ DataModel::NullNullable }; - Percent100ths resolution = 1; - Percent100ths stepValue = 1; - ClosureUnitEnum unit = ClosureUnitEnum::kUnknownEnumValue; - DataModel::Nullable unitRange = DataModel::Nullable(); - Structs::RangePercent100thsStruct::Type limitRange{}; - TranslationDirectionEnum translationDirection = TranslationDirectionEnum::kUnknownEnumValue; - RotationAxisEnum rotationAxis = RotationAxisEnum::kUnknownEnumValue; - OverflowEnum overflow = OverflowEnum::kUnknownEnumValue; - ModulationTypeEnum modulationType = ModulationTypeEnum::kUnknownEnumValue; - BitFlags latchControlModes; -}; - -class ClusterLogic -{ -public: - /** - * @brief Instantiates a ClusterLogic class. The caller maintains ownership of the driver and the context, - * but provides them for use by the ClusterLogic class. - */ - ClusterLogic(DelegateBase & delegate, MatterContext & matterContext) : mDelegate(delegate), mMatterContext(matterContext) {} - - const ClusterState & GetState() { return mState; } - const ClusterConformance & GetConformance() { return mConformance; } - - /** - * @brief Validates the conformance and performs initialisation and sets up the ClusterInitParameters into Attributes. - * - * @param [in] conformance cluster conformance - * @param [in] clusterInitParameters cluster Init Parameters - * - * @return CHIP_ERROR_INCORRECT_STATE if the cluster has already been initialized, - * CHIP_ERROR_INVALID_DEVICE_DESCRIPTOR if the conformance is incorrect. - * Set function errors if setting the attributes with the provided ClusterInitParameters fails. - * CHIP_NO_ERROR on succesful initialisation. - */ - CHIP_ERROR Init(const ClusterConformance & conformance, const ClusterInitParameters & clusterInitParameters); - - /** - * @brief Set Current State. - * - * @param[in] currentState Current State Position, Latch and Speed. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - */ - CHIP_ERROR SetCurrentState(const DataModel::Nullable & currentState); - - /** - * @brief Set TargetState. - * - * @param[in] targetState TargetState Position, Latch and Speed. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - */ - CHIP_ERROR SetTargetState(const DataModel::Nullable & targetState); - - /** - * @brief Set Resolution. - * - * @param[in] resolution Minimal acceptable change of Position fields of attributes. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetResolution(const Percent100ths resolution); - - /** - * @brief Set StepValue. - * - * @param[in] stepValue One step value for Step command - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetStepValue(const Percent100ths stepValue); - - /** - * @brief Set Unit. - * - * @param[in] unit Unit related to the Positioning. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetUnit(const ClosureUnitEnum unit); - - /** - * @brief Set UnitRange. - * - * @param[in] unitRange Minimum and Maximum values expressed by positioning following the unit. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetUnitRange(const DataModel::Nullable & unitRange); - - /** - * @brief Set LimitRange. - * - * @param[in] limitRange Range of possible values for the position field in Current attribute. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetLimitRange(const Structs::RangePercent100thsStruct::Type & limitRange); - - /** - * @brief Set Overflow. - * - * @param[in] overflow Overflow related to Rotation. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - */ - CHIP_ERROR SetOverflow(const OverflowEnum overflow); - - /** - * @brief Sets the latch control modes for the closure dimension cluster. - * - * This method updates the latch control modes using the provided bit flags. - * - * @param latchControlModes BitFlags representing the desired latch control modes. - * @return CHIP_ERROR Returns CHIP_NO_ERROR on success, or an appropriate error code on failure. - */ - CHIP_ERROR SetLatchControlModes(const BitFlags & latchControlModes); - - // All Get functions: - // Return CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized. - // Return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if the attribute is not supported. - // Otherwise return CHIP_NO_ERROR and set the input parameter value to the current cluster state value - CHIP_ERROR GetCurrentState(DataModel::Nullable & currentState); - CHIP_ERROR GetTargetState(DataModel::Nullable & targetState); - CHIP_ERROR GetResolution(Percent100ths & resolution); - CHIP_ERROR GetStepValue(Percent100ths & stepValue); - CHIP_ERROR GetUnit(ClosureUnitEnum & unit); - CHIP_ERROR GetUnitRange(DataModel::Nullable & unitRange); - CHIP_ERROR GetLimitRange(Structs::RangePercent100thsStruct::Type & limitRange); - CHIP_ERROR GetTranslationDirection(TranslationDirectionEnum & translationDirection); - CHIP_ERROR GetRotationAxis(RotationAxisEnum & rotationAxis); - CHIP_ERROR GetOverflow(OverflowEnum & overflow); - CHIP_ERROR GetModulationType(ModulationTypeEnum & modulationType); - CHIP_ERROR GetLatchControlModes(BitFlags & latchControlModes); - CHIP_ERROR GetFeatureMap(BitFlags & featureMap); - CHIP_ERROR GetClusterRevision(Attributes::ClusterRevision::TypeInfo::Type & clusterRevision); - - /** - * @brief Calls delegate HandleSetTarget function after validating the parameters and conformance. - * - * @param [in] position TargetState position - * @param [in] latch TargetState latch - * @param [in] speed TargetState speed - * - * @return Exits if the cluster is not initialized. - * InvalidCommand if none of the input parameters are present. - * ConstraintError if the input values are out is out of range. - * InvalidInState if the current position of closure is not known. - * Success on succesful handling. - */ - Protocols::InteractionModel::Status HandleSetTargetCommand(Optional position, Optional latch, - Optional speed); - - /** - * @brief Calls delegate HandleStep function after validating the parameters and conformance. - * - * @param [in] direction step direction - * @param [in] numberOfSteps Number of steps - * @param [in] speed step speed - * - * @return Exits if the cluster is not initialized. - * UnsupportedCommand if Positioning feature is not supported. - * ConstraintError if the input values are out is out of range. - * InvalidInState if the current position of closure is not known. - * Success on successful handling. - */ - Protocols::InteractionModel::Status HandleStepCommand(StepDirectionEnum direction, uint16_t numberOfSteps, - Optional speed); - -private: - /** - * @brief Set TranslationDirection. - * This attribute is not supposed to change once the installation is finalized. - * SetTranslationDirection should only be called from Init() - * - * @param[in] translationDirection Direction of the translation. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported - * - */ - CHIP_ERROR SetTranslationDirection(const TranslationDirectionEnum translationDirection); - - /** - * @brief Set RotationAxis. - * This attribute is not supposed to change once the installation is finalized. - * so SetRotationAxis should only be called from Init(). - * - * @param[in] rotationAxis Axis of the rotation. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported - * - */ - CHIP_ERROR SetRotationAxis(const RotationAxisEnum rotationAxis); - - /** - * @brief Set ModulationType. - * This attribute is not supposed to change once the installation is finalized. - * so SetModulationType should only be called from Init(). - * - * @param[in] modulationType Modulation type. - * - * @return CHIP_NO_ERROR if set was successful. - * CHIP_ERROR_INVALID_ARGUMENT if argument are not valid - * CHIP_ERROR_INCORRECT_STATE if the cluster has not been initialized - * CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE if feature is not supported. - * - */ - CHIP_ERROR SetModulationType(const ModulationTypeEnum modulationType); - - bool mInitialized = false; - ClusterState mState; - ClusterConformance mConformance; - DelegateBase & mDelegate; - MatterContext & mMatterContext; - - // At Present, QuieterReportingAttribute doesnt support Structs. - // So, this variable will be used for Quietreporting of current state position. - // TODO: Refactor CurrentState Atrribute to use QuieterReportingAttribute once Issue#39801 is resolved - QuieterReportingAttribute quietReportableCurrentStatePosition{ DataModel::NullNullable }; -}; - -} // namespace ClosureDimension -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-objects.h b/src/app/clusters/closure-dimension-server/closure-dimension-cluster-objects.h index 72bb22eeb9b..cf30af8b911 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-cluster-objects.h +++ b/src/app/clusters/closure-dimension-server/closure-dimension-cluster-objects.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2025 Project CHIP Authors + * Copyright (c) 2026 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,53 +18,4 @@ #pragma once -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ClosureDimension { - -/** - * Structure represents the current state struct of a closure dimension cluster derivation instance. - */ -struct GenericDimensionStateStruct : public Structs::DimensionStateStruct::Type -{ - GenericDimensionStateStruct(Optional> positionValue = NullOptional, - Optional> latchValue = NullOptional, - Optional speedValue = NullOptional) - { - Set(positionValue, latchValue, speedValue); - } - - GenericDimensionStateStruct(const GenericDimensionStateStruct & currentState) { *this = currentState; } - - GenericDimensionStateStruct & operator=(const GenericDimensionStateStruct & current) - { - Set(current.position, current.latch, current.speed); - return *this; - } - - void Set(Optional> positionValue = NullOptional, - Optional> latchValue = NullOptional, - Optional speedValue = NullOptional) - { - position = positionValue; - latch = latchValue; - speed = speedValue; - } - - bool operator==(const GenericDimensionStateStruct & rhs) const - { - return position == rhs.position && latch == rhs.latch && speed == rhs.speed; - } - - bool operator!=(const GenericDimensionStateStruct & rhs) const - { - return position != rhs.position || latch != rhs.latch || speed != rhs.speed; - } -}; -} // namespace ClosureDimension -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h b/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h index 487452a4e2d..fe424f545cd 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h +++ b/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2025 Project CHIP Authors + * Copyright (c) 2026 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,54 +18,4 @@ #pragma once -#include -#include -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ClosureDimension { - -/** @brief - * Defines methods for implementing application-specific logic for the Closure Dimension Cluster. - */ - -class DelegateBase -{ -public: - DelegateBase(){}; - virtual ~DelegateBase() = default; - - /** - * @brief This function handles SetTarget command implementaion. - * - * @param [in] position TargetState position to be set - * @param [in] latch TargetState Latch to be set - * @param [in] speed TargetState speed to be set - * - * @return Success when succesfully handled. - * Error when handle SetTarget fails. - */ - virtual Protocols::InteractionModel::Status HandleSetTarget(const Optional & position, - const Optional & latch, - const Optional & speed) = 0; - - /** - * @brief This function handles Step command implementaion. - * - * @param [in] direction step direction - * @param [in] numberOfSteps total number of steps - * @param [in] speed speed of each step - * - * @return Success when successfully handled. - * Error when handle Step fails. - */ - virtual Protocols::InteractionModel::Status HandleStep(const StepDirectionEnum & direction, const uint16_t & numberOfSteps, - const Optional & speed) = 0; -}; - -} // namespace ClosureDimension -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.h b/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.h index b047cd3720c..a0c0c662b52 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.h +++ b/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2024 Project CHIP Authors + * Copyright (c) 2026 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,37 +18,4 @@ #pragma once -#include -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ClosureDimension { - -/** @brief - * Interface to allow interaction with interaction model and ember layers. Can be faked for unit testing. - */ -class MatterContext -{ -public: - MatterContext(EndpointId endpoint) : mEndpoint(endpoint) {} - - /** - * @brief calls the attribute change callback - * @param[in] attributeId Attribute ID whose value needs to be marked dirty. - */ - virtual void MarkDirty(AttributeId attributeId); - - virtual ~MatterContext() = default; - - EndpointId GetEndpointId() const { return mEndpoint; } - -private: - EndpointId mEndpoint; -}; - -} // namespace ClosureDimension -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/clusters/closure-dimension-server/closure-dimension-server.h b/src/app/clusters/closure-dimension-server/closure-dimension-server.h index 2d32ca1cdc1..ce2c02846ba 100644 --- a/src/app/clusters/closure-dimension-server/closure-dimension-server.h +++ b/src/app/clusters/closure-dimension-server/closure-dimension-server.h @@ -1,6 +1,6 @@ /** * - * Copyright (c) 2025 Project CHIP Authors + * Copyright (c) 2026 Project CHIP Authors * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,56 +16,5 @@ * */ #pragma once -#include "closure-dimension-cluster-logic.h" -#include -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ClosureDimension { - -/** - * @brief Class implements the client facing APIs to read, write and process incoming commands - * App should instantiate and init one Interface per endpoint - */ -class Interface : public AttributeAccessInterface, public CommandHandlerInterface -{ -public: - Interface(EndpointId endpoint, ClusterLogic & clusterLogic) : - AttributeAccessInterface(Optional(endpoint), Id), CommandHandlerInterface(Optional(endpoint), Id), - mClusterLogic(clusterLogic) - {} - - // AttributeAccessInterface implementation - - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - - // CommandHandlerInterface implementation - - void InvokeCommand(HandlerContext & handlerContext) override; - - /** - * @brief This function registers attribute access and command handler. - * @return CHIP_NO_ERROR when succesfully initialized. - * Aborts if registration fails. - */ - CHIP_ERROR Init(); - - /** - * @brief This function unregisters attribute access and command handlers. - * @return CHIP_NO_ERROR when succesfully initialized - * Aborts if attribute access unregistration fails. - */ - CHIP_ERROR Shutdown(); - -private: - // This is owned by the caller and passed to the interface for its use. - ClusterLogic & mClusterLogic; -}; - -} // namespace ClosureDimension -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/clusters/groupcast/GroupcastCluster.h b/src/app/clusters/groupcast/GroupcastCluster.h index 0b7a8c887a5..bb888430923 100644 --- a/src/app/clusters/groupcast/GroupcastCluster.h +++ b/src/app/clusters/groupcast/GroupcastCluster.h @@ -43,12 +43,6 @@ class GroupcastCluster : public DefaultServerCluster, public Credentials::GroupD static constexpr uint16_t kMaxMembershipEndpoints = 255; static constexpr uint16_t kMaxCommandEndpoints = 20; - struct EndpointList - { - EndpointId entries[kMaxMembershipEndpoints]; - uint16_t count = 0; - }; - GroupcastCluster(GroupcastContext && context); GroupcastCluster(GroupcastContext && context, BitFlags features); virtual ~GroupcastCluster() override; @@ -66,6 +60,13 @@ class GroupcastCluster : public DefaultServerCluster, public Credentials::GroupD CHIP_ERROR GeneratedCommands(const ConcreteClusterPath & path, ReadOnlyBufferBuilder & builder) override; +private: + struct EndpointList + { + EndpointId entries[kMaxMembershipEndpoints]; + uint16_t count = 0; + }; + Protocols::InteractionModel::Status GroupcastTesting(FabricIndex fabricIndex, Groupcast::Commands::GroupcastTesting::DecodableType data); @@ -95,7 +96,6 @@ class GroupcastCluster : public DefaultServerCluster, public Credentials::GroupD void SetDataModelProvider(DataModel::Provider & provider) { mDataModelProvider = &provider; } void ResetDataModelProvider() { mDataModelProvider = nullptr; } -private: void SetFabricUnderTest(FabricIndex fabricUnderTest); static void OnGroupcastTestingDone(System::Layer * aLayer, void * appState); TimerDelegate & GetTimerDelegate() const { return mGroupcastContext.timerDelegate; } diff --git a/src/app/clusters/zone-management-server/CodegenIntegration.h b/src/app/clusters/zone-management-server/CodegenIntegration.h new file mode 100644 index 00000000000..5f4539a7c39 --- /dev/null +++ b/src/app/clusters/zone-management-server/CodegenIntegration.h @@ -0,0 +1,172 @@ +/* + * + * Copyright (c) 2026 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ZoneManagement { + +class ZoneMgmtServer : public CommandHandlerInterface, public AttributeAccessInterface +{ +public: + /** + * @brief Creates a Zone Management cluster instance. The Init() function needs to be called for this instance + * to be registered and called by the interaction model at the appropriate times. + * + * @param aDelegate A reference to the delegate to be used by this server. + * Note: the caller must ensure that the delegate lives throughout the instance's + * lifetime. + * + * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. + * @param aFeatures The bitflags value that identifies which features are supported by this instance. + * @param aMaxUserDefinedZones The maximum number of user-defined zones supported by the device. + * This value is specified by the device manufacturer. + * @param aMaxZones The maximum number of zones that are allowed to exist on the device. This is the + * sum of the predefined built-in zones and the user-defined zones. + * @param aSensitivityMax The hardware-specific value for the number of supported sensitivity levels. + * This value is specified by the device manufacturer. + * @param aTwoDCartesianMax The maximum X and Y points that are allowed for TwoD Cartesian Zones. + * + */ + ZoneMgmtServer(Delegate & aDelegate, EndpointId aEndpointId, const BitFlags aFeatures, uint8_t aMaxUserDefinedZones, + uint8_t aMaxZones, uint8_t aSensitivityMax, const TwoDCartesianVertexStruct & aTwoDCartesianMax); + + ~ZoneMgmtServer() override; + + /** + * @brief Initialise the Zone Management server instance. + * This function must be called after defining a ZoneMgmtServer class object. + * @return Returns an error if some of the constraint/feature validation checks fail or + * the CommandHandler or AttributeHandler registration fails, else returns CHIP_NO_ERROR. + */ + CHIP_ERROR Init(); + + bool HasFeature(Feature feature) const; + + // Attribute Setters + CHIP_ERROR SetSensitivity(uint8_t aSensitivity); + + // Attribute Getters + const std::vector & GetZones() const { return mZones; } + + const std::vector & GetTriggers() const { return mTriggers; } + + const Optional GetTriggerForZone(uint16_t zoneID); + + uint8_t GetMaxUserDefinedZones() const { return mMaxUserDefinedZones; } + uint8_t GetMaxZones() const { return mMaxZones; } + uint8_t GetSensitivityMax() const { return mSensitivityMax; } + uint8_t GetSensitivity() const { return mSensitivity; } + const TwoDCartesianVertexStruct & GetTwoDCartesianMax() const { return mTwoDCartesianMax; } + + CHIP_ERROR AddZone(const ZoneInformationStorage & zone); + CHIP_ERROR UpdateZone(uint16_t zoneId, const ZoneInformationStorage & zone); + CHIP_ERROR RemoveZone(uint16_t zoneId); + + Protocols::InteractionModel::Status AddOrUpdateTrigger(const ZoneTriggerControlStruct & trigger); + Protocols::InteractionModel::Status RemoveTrigger(uint16_t zoneId); + + // Generate Zone events + Protocols::InteractionModel::Status GenerateZoneTriggeredEvent(uint16_t zoneID, ZoneEventTriggeredReasonEnum triggerReason); + Protocols::InteractionModel::Status GenerateZoneStoppedEvent(uint16_t zoneID, ZoneEventStoppedReasonEnum stopReason); + +private: + Delegate & mDelegate; + EndpointId mEndpointId; + const BitFlags mFeatures; + + // Attributes + const uint8_t mMaxUserDefinedZones; + const uint8_t mMaxZones; + const uint8_t mSensitivityMax; + const TwoDCartesianVertexStruct mTwoDCartesianMax; + uint8_t mUserDefinedZonesCount = 0; + + std::vector mZones; + std::vector mTriggers; + uint8_t mSensitivity = 0; + + /** + * IM-level implementation of read + * @return appropriately mapped CHIP_ERROR if applicable + */ + CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; + + /** + * IM-level implementation of write + * @return appropriately mapped CHIP_ERROR if applicable + */ + CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; + + /** + * Helper function that loads all the persistent attributes from the KVS. + */ + void LoadPersistentAttributes(); + + CHIP_ERROR ReadAndEncodeZones(const AttributeValueEncoder::ListEncodeHelper & encoder); + + CHIP_ERROR ReadAndEncodeTriggers(const AttributeValueEncoder::ListEncodeHelper & encoder); + + Protocols::InteractionModel::Status ValidateTwoDCartesianZone(const TwoDCartesianZoneDecodableStruct & zone); + + Protocols::InteractionModel::Status ValidateTrigger(const ZoneTriggerControlStruct & trigger); + + // Utility that matches a given zone's ZoneUse and verices with the given + // parameters to check if they match. Used by ZoneAlreadyExists(). + bool DoZoneUseAndVerticesMatch(ZoneUseEnum use, const std::vector & vertices, + const TwoDCartesianZoneStorage & zone); + + // Utility function to check if a given ZoneUse and a TwoDVertex already + // exists in mZones. + bool ZoneAlreadyExists(ZoneUseEnum zoneUse, const std::vector & vertices, + const DataModel::Nullable & excludeZoneId); + + /** + * @brief Inherited from CommandHandlerInterface + */ + void InvokeCommand(HandlerContext & ctx) override; + + void HandleCreateTwoDCartesianZone(HandlerContext & ctx, const Commands::CreateTwoDCartesianZone::DecodableType & req); + + void HandleUpdateTwoDCartesianZone(HandlerContext & ctx, const Commands::UpdateTwoDCartesianZone::DecodableType & req); + + void HandleRemoveZone(HandlerContext & ctx, const Commands::RemoveZone::DecodableType & req); + + void HandleCreateOrUpdateTrigger(HandlerContext & ctx, const Commands::CreateOrUpdateTrigger::DecodableType & req); + + void HandleRemoveTrigger(HandlerContext & ctx, const Commands::RemoveTrigger::DecodableType & req); +}; + +} // namespace ZoneManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/zone-management-server/Delegate.h b/src/app/clusters/zone-management-server/Delegate.h new file mode 100644 index 00000000000..f4f8873c415 --- /dev/null +++ b/src/app/clusters/zone-management-server/Delegate.h @@ -0,0 +1,154 @@ +/* + * + * Copyright (c) 2025 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ZoneManagement { + +class ZoneMgmtServer; + +/** @brief + * Defines interfaces for implementing application-specific logic for various aspects of the ZoneManagement Cluster. + * Specifically, it defines interfaces for the command handling and loading of the allocated streams. + */ +class Delegate +{ +public: + Delegate() = default; + + virtual ~Delegate() = default; + + /** + * @brief Command Delegate for creation of TwoDCartesianZone with the provided parameters. + * + * @param[in] zone Structure with parameters for defining a TwoDCartesian zone. + * + * @param[out] outZoneID Indicates the ID of the created zone. + * + * @return Success if the creation is successful and a zoneID was + * produced; otherwise, the command SHALL be rejected with an appropriate + * error. + */ + virtual Protocols::InteractionModel::Status CreateTwoDCartesianZone(const TwoDCartesianZoneStorage & zone, + uint16_t & outZoneID) = 0; + + /** + * @brief Command Delegate for updating of a TwoDCartesianZone with the provided parameters. + * + * @param[in] zoneID Indicates the ID of the zone to update. + * @param[in] zone Structure with parameters for a TwoDCartesian zone. + * + * + * @return Success if the update is successful; otherwise, the command SHALL be + * rejected with an appropriate error. + */ + virtual Protocols::InteractionModel::Status UpdateTwoDCartesianZone(uint16_t zoneID, const TwoDCartesianZoneStorage & zone) = 0; + + /** + * @brief Command Delegate for the removal of a TwoDCartesianZone for a given zoneID. + * + * @param[in] zoneID Indicates the ID of the zone to remove. + * + * @return Success if the removal is successful; otherwise, the command SHALL be + * rejected with an appropriate error. + */ + virtual Protocols::InteractionModel::Status RemoveZone(uint16_t zoneID) = 0; + + /** + * @brief Command Delegate for creation of a ZoneTrigger. + * + * @param[in] zoneTrigger Structure with parameters for defining a ZoneTriggerControl. + * + * @return Success if the creation is successful; otherwise, the command SHALL be + * rejected with an appropriate error. + */ + virtual Protocols::InteractionModel::Status CreateTrigger(const ZoneTriggerControlStruct & zoneTrigger) = 0; + + /** + * @brief Command Delegate for update of a ZoneTrigger. + * + * @param[in] zoneTrigger Structure with parameters for defining a ZoneTriggerControl. + * + * @return Success if the update is successful; otherwise, the command SHALL be + * rejected with an appropriate error. + */ + virtual Protocols::InteractionModel::Status UpdateTrigger(const ZoneTriggerControlStruct & zoneTrigger) = 0; + + /** + * @brief Command Delegate for the removal of a ZoneTrigger for a given zoneID. + * + * @param[in] zoneID Indicates the ID of the zone to remove the ZoneTrigger for. + * + * @return Success if the removal is successful; otherwise, the command SHALL be + * rejected with an appropriate error. + */ + virtual Protocols::InteractionModel::Status RemoveTrigger(uint16_t zoneID) = 0; + + /** + * @brief Delegate callback for notifying change in an attribute. + * + */ + virtual void OnAttributeChanged(AttributeId attributeId) = 0; + + /** + * @brief Callback into the delegate once persistent attributes managed by + * the Cluster have been loaded from Storage. + */ + virtual CHIP_ERROR PersistentAttributesLoadedCallback() = 0; + + /** + * Delegate function to load the created zones and triggers. + * The application is responsible for persisting them. The Load APIs + * would be used to load the persisted zones and triggers into the cluster + * server list members at initialization. + * Once loaded, the cluster server can serve Reads on these + * attributes. + */ + virtual CHIP_ERROR LoadZones(std::vector & aZones) = 0; + + virtual CHIP_ERROR LoadTriggers(std::vector & aTriggers) = 0; + + ZoneMgmtServer * GetZoneMgmtServer() const { return mZoneMgmtServer; } + +private: + friend class ZoneMgmtServer; + + ZoneMgmtServer * mZoneMgmtServer = nullptr; + + /** + * This method is used by the SDK to ensure the delegate points to the server instance it's associated with. + * When a server instance is created or destroyed, this method will be called to set and clear, respectively, + * the pointer to the server instance. + * + * @param aZoneMgmtServer A pointer to the ZoneMgmtServer object related to this delegate object. + */ + void SetZoneMgmtServer(ZoneMgmtServer * aZoneMgmtServer) { mZoneMgmtServer = aZoneMgmtServer; } +}; + +} // namespace ZoneManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/zone-management-server/TwoDCartesianZoneStorage.h b/src/app/clusters/zone-management-server/TwoDCartesianZoneStorage.h new file mode 100644 index 00000000000..a7ab5dc9306 --- /dev/null +++ b/src/app/clusters/zone-management-server/TwoDCartesianZoneStorage.h @@ -0,0 +1,79 @@ +/** + * + * Copyright (c) 2025-2026 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once +#include +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ZoneManagement { + +using TwoDCartesianZoneDecodableStruct = Structs::TwoDCartesianZoneStruct::DecodableType; +using TwoDCartesianZoneStruct = Structs::TwoDCartesianZoneStruct::Type; +using TwoDCartesianVertexStruct = Structs::TwoDCartesianVertexStruct::Type; + +struct TwoDCartesianZoneStorage : TwoDCartesianZoneStruct +{ + TwoDCartesianZoneStorage(){}; + + TwoDCartesianZoneStorage(const CharSpan & aName, ZoneUseEnum aUse, const std::vector & aVertices, + Optional aColor) + { + Set(aName, aUse, aVertices, aColor); + } + + TwoDCartesianZoneStorage(const TwoDCartesianZoneStorage & aTwoDCartZone) { *this = aTwoDCartZone; } + + TwoDCartesianZoneStorage & operator=(const TwoDCartesianZoneStorage & aTwoDCartZone) + { + Set(aTwoDCartZone.name, aTwoDCartZone.use, aTwoDCartZone.verticesVector, aTwoDCartZone.color); + return *this; + } + + void Set(const CharSpan & aName, ZoneUseEnum aUse, const std::vector & aVertices, + Optional aColor) + { + nameString = std::string(aName.begin(), aName.end()); + name = CharSpan(nameString.c_str(), nameString.size()); + use = aUse; + verticesVector = aVertices; + vertices = DataModel::List(verticesVector.data(), verticesVector.size()); + if (aColor.HasValue()) + { + colorString = std::string(aColor.Value().begin(), aColor.Value().end()); + color = MakeOptional(CharSpan(colorString.c_str(), colorString.size())); + } + else + { + colorString.clear(); + color = NullOptional; + } + } + + std::string nameString; + std::string colorString; + std::vector verticesVector; +}; + +} // namespace ZoneManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/zone-management-server/ZoneInformationStorage.h b/src/app/clusters/zone-management-server/ZoneInformationStorage.h new file mode 100644 index 00000000000..9cc673683d4 --- /dev/null +++ b/src/app/clusters/zone-management-server/ZoneInformationStorage.h @@ -0,0 +1,66 @@ +/** + * + * Copyright (c) 2025-2026 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +#pragma once + +#include +#include + +namespace chip { +namespace app { +namespace Clusters { +namespace ZoneManagement { + +using ZoneInformationStruct = Structs::ZoneInformationStruct::Type; +using ZoneTriggerControlStruct = Structs::ZoneTriggerControlStruct::Type; + +struct ZoneInformationStorage : ZoneInformationStruct +{ + ZoneInformationStorage(){}; + + ZoneInformationStorage(const uint16_t & aZoneID, ZoneTypeEnum aZoneType, ZoneSourceEnum aZoneSource, + const Optional & aTwoDCartZoneStorage) + { + Set(aZoneID, aZoneType, aZoneSource, aTwoDCartZoneStorage); + } + + ZoneInformationStorage(const ZoneInformationStorage & aZoneInfoStorage) { *this = aZoneInfoStorage; } + + ZoneInformationStorage & operator=(const ZoneInformationStorage & aZoneInfoStorage) + { + Set(aZoneInfoStorage.zoneID, aZoneInfoStorage.zoneType, aZoneInfoStorage.zoneSource, aZoneInfoStorage.twoDCartZoneStorage); + return *this; + } + + void Set(const uint16_t & aZoneID, ZoneTypeEnum aZoneType, ZoneSourceEnum aZoneSource, + const Optional & aTwoDCartZoneStorage) + { + zoneID = aZoneID; + zoneType = aZoneType; + zoneSource = aZoneSource; + twoDCartZoneStorage = aTwoDCartZoneStorage; + twoDCartesianZone = twoDCartZoneStorage; + } + + Optional twoDCartZoneStorage; +}; + +} // namespace ZoneManagement +} // namespace Clusters +} // namespace app +} // namespace chip diff --git a/src/app/clusters/zone-management-server/ZoneManagementCluster.cpp b/src/app/clusters/zone-management-server/ZoneManagementCluster.cpp index c6651b7724b..4667181c7d9 100644 --- a/src/app/clusters/zone-management-server/ZoneManagementCluster.cpp +++ b/src/app/clusters/zone-management-server/ZoneManagementCluster.cpp @@ -33,19 +33,17 @@ #include #include -using namespace chip; -using namespace chip::app; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::ZoneManagement; -using namespace chip::app::Clusters::ZoneManagement::Structs; using namespace chip::app::Clusters::ZoneManagement::Attributes; -using namespace Protocols::InteractionModel; +using namespace chip::Protocols::InteractionModel; namespace chip { namespace app { namespace Clusters { namespace ZoneManagement { +using ZoneTriggerControlStruct = Structs::ZoneTriggerControlStruct::Type; +using ZoneInformationStruct = Structs::ZoneInformationStruct::Type; + ZoneMgmtServer::ZoneMgmtServer(Delegate & aDelegate, EndpointId aEndpointId, const BitFlags aFeatures, uint8_t aMaxUserDefinedZones, uint8_t aMaxZones, uint8_t aSensitivityMax, const TwoDCartesianVertexStruct & aTwoDCartesianMax) : diff --git a/src/app/clusters/zone-management-server/tests/TestZonePolygon.cpp b/src/app/clusters/zone-management-server/tests/TestZonePolygon.cpp index 899110c71a5..9f5848951fd 100644 --- a/src/app/clusters/zone-management-server/tests/TestZonePolygon.cpp +++ b/src/app/clusters/zone-management-server/tests/TestZonePolygon.cpp @@ -25,15 +25,14 @@ #include +#include #include -#include #include #include using namespace chip; -using namespace chip::Testing; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::ZoneManagement; diff --git a/src/app/clusters/zone-management-server/zone-management-server.h b/src/app/clusters/zone-management-server/zone-management-server.h index 3937e434f56..b8a8d036532 100644 --- a/src/app/clusters/zone-management-server/zone-management-server.h +++ b/src/app/clusters/zone-management-server/zone-management-server.h @@ -1,6 +1,6 @@ /* * - * Copyright (c) 2025 Project CHIP Authors + * Copyright (c) 2025-2026 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,354 +18,8 @@ #pragma once -#include -#include -#include -#include +// Note: This file exists for backwards compatibility only. +// New code should directly use ZoneManagementCluster.h instead. +// Implemented in PR #43423 -#include -#include -#include -#include -#include - -namespace chip { -namespace app { -namespace Clusters { -namespace ZoneManagement { - -using TwoDCartesianZoneDecodableStruct = Structs::TwoDCartesianZoneStruct::DecodableType; -using TwoDCartesianZoneStruct = Structs::TwoDCartesianZoneStruct::Type; -using TwoDCartesianVertexStruct = Structs::TwoDCartesianVertexStruct::Type; -using ZoneInformationStruct = Structs::ZoneInformationStruct::Type; -using ZoneTriggerControlStruct = Structs::ZoneTriggerControlStruct::Type; - -class ZoneMgmtServer; - -struct TwoDCartesianZoneStorage : TwoDCartesianZoneStruct -{ - TwoDCartesianZoneStorage(){}; - - TwoDCartesianZoneStorage(const CharSpan & aName, ZoneUseEnum aUse, const std::vector & aVertices, - Optional aColor) - { - Set(aName, aUse, aVertices, aColor); - } - - TwoDCartesianZoneStorage(const TwoDCartesianZoneStorage & aTwoDCartZone) { *this = aTwoDCartZone; } - - TwoDCartesianZoneStorage & operator=(const TwoDCartesianZoneStorage & aTwoDCartZone) - { - Set(aTwoDCartZone.name, aTwoDCartZone.use, aTwoDCartZone.verticesVector, aTwoDCartZone.color); - return *this; - } - - void Set(const CharSpan & aName, ZoneUseEnum aUse, const std::vector & aVertices, - Optional aColor) - { - nameString = std::string(aName.begin(), aName.end()); - name = CharSpan(nameString.c_str(), nameString.size()); - use = aUse; - verticesVector = aVertices; - vertices = DataModel::List(verticesVector.data(), verticesVector.size()); - if (aColor.HasValue()) - { - colorString = std::string(aColor.Value().begin(), aColor.Value().end()); - color = MakeOptional(CharSpan(colorString.c_str(), colorString.size())); - } - else - { - colorString.clear(); - color = NullOptional; - } - } - - std::string nameString; - std::string colorString; - std::vector verticesVector; -}; - -struct ZoneInformationStorage : ZoneInformationStruct -{ - ZoneInformationStorage(){}; - - ZoneInformationStorage(const uint16_t & aZoneID, ZoneTypeEnum aZoneType, ZoneSourceEnum aZoneSource, - const Optional & aTwoDCartZoneStorage) - { - Set(aZoneID, aZoneType, aZoneSource, aTwoDCartZoneStorage); - } - - ZoneInformationStorage(const ZoneInformationStorage & aZoneInfoStorage) { *this = aZoneInfoStorage; } - - ZoneInformationStorage & operator=(const ZoneInformationStorage & aZoneInfoStorage) - { - Set(aZoneInfoStorage.zoneID, aZoneInfoStorage.zoneType, aZoneInfoStorage.zoneSource, aZoneInfoStorage.twoDCartZoneStorage); - return *this; - } - - void Set(const uint16_t & aZoneID, ZoneTypeEnum aZoneType, ZoneSourceEnum aZoneSource, - const Optional & aTwoDCartZoneStorage) - { - zoneID = aZoneID; - zoneType = aZoneType; - zoneSource = aZoneSource; - twoDCartZoneStorage = aTwoDCartZoneStorage; - twoDCartesianZone = twoDCartZoneStorage; - } - - Optional twoDCartZoneStorage; -}; - -/** @brief - * Defines interfaces for implementing application-specific logic for various aspects of the ZoneManagement Cluster. - * Specifically, it defines interfaces for the command handling and loading of the allocated streams. - */ -class Delegate -{ -public: - Delegate() = default; - - virtual ~Delegate() = default; - - /** - * @brief Command Delegate for creation of TwoDCartesianZone with the provided parameters. - * - * @param[in] zone Structure with parameters for defining a TwoDCartesian zone. - * - * @param[out] outZoneID Indicates the ID of the created zone. - * - * @return Success if the creation is successful and a zoneID was - * produced; otherwise, the command SHALL be rejected with an appropriate - * error. - */ - virtual Protocols::InteractionModel::Status CreateTwoDCartesianZone(const TwoDCartesianZoneStorage & zone, - uint16_t & outZoneID) = 0; - - /** - * @brief Command Delegate for updating of a TwoDCartesianZone with the provided parameters. - * - * @param[in] zoneID Indicates the ID of the zone to update. - * @param[in] zone Structure with parameters for a TwoDCartesian zone. - * - * - * @return Success if the update is successful; otherwise, the command SHALL be - * rejected with an appropriate error. - */ - virtual Protocols::InteractionModel::Status UpdateTwoDCartesianZone(uint16_t zoneID, const TwoDCartesianZoneStorage & zone) = 0; - - /** - * @brief Command Delegate for the removal of a TwoDCartesianZone for a given zoneID. - * - * @param[in] zoneID Indicates the ID of the zone to remove. - * - * @return Success if the removal is successful; otherwise, the command SHALL be - * rejected with an appropriate error. - */ - virtual Protocols::InteractionModel::Status RemoveZone(uint16_t zoneID) = 0; - - /** - * @brief Command Delegate for creation of a ZoneTrigger. - * - * @param[in] zoneTrigger Structure with parameters for defining a ZoneTriggerControl. - * - * @return Success if the creation is successful; otherwise, the command SHALL be - * rejected with an appropriate error. - */ - virtual Protocols::InteractionModel::Status CreateTrigger(const ZoneTriggerControlStruct & zoneTrigger) = 0; - - /** - * @brief Command Delegate for update of a ZoneTrigger. - * - * @param[in] zoneTrigger Structure with parameters for defining a ZoneTriggerControl. - * - * @return Success if the update is successful; otherwise, the command SHALL be - * rejected with an appropriate error. - */ - virtual Protocols::InteractionModel::Status UpdateTrigger(const ZoneTriggerControlStruct & zoneTrigger) = 0; - - /** - * @brief Command Delegate for the removal of a ZoneTrigger for a given zoneID. - * - * @param[in] zoneID Indicates the ID of the zone to remove the ZoneTrigger for. - * - * @return Success if the removal is successful; otherwise, the command SHALL be - * rejected with an appropriate error. - */ - virtual Protocols::InteractionModel::Status RemoveTrigger(uint16_t zoneID) = 0; - - /** - * @brief Delegate callback for notifying change in an attribute. - * - */ - virtual void OnAttributeChanged(AttributeId attributeId) = 0; - - /** - * @brief Callback into the delegate once persistent attributes managed by - * the Cluster have been loaded from Storage. - */ - virtual CHIP_ERROR PersistentAttributesLoadedCallback() = 0; - - /** - * Delegate function to load the created zones and triggers. - * The application is responsible for persisting them. The Load APIs - * would be used to load the persisted zones and triggers into the cluster - * server list members at initialization. - * Once loaded, the cluster server can serve Reads on these - * attributes. - */ - virtual CHIP_ERROR LoadZones(std::vector & aZones) = 0; - - virtual CHIP_ERROR LoadTriggers(std::vector & aTriggers) = 0; - - ZoneMgmtServer * GetZoneMgmtServer() const { return mZoneMgmtServer; } - -private: - friend class ZoneMgmtServer; - - ZoneMgmtServer * mZoneMgmtServer = nullptr; - - /** - * This method is used by the SDK to ensure the delegate points to the server instance it's associated with. - * When a server instance is created or destroyed, this method will be called to set and clear, respectively, - * the pointer to the server instance. - * - * @param aZoneMgmtServer A pointer to the ZoneMgmtServer object related to this delegate object. - */ - void SetZoneMgmtServer(ZoneMgmtServer * aZoneMgmtServer) { mZoneMgmtServer = aZoneMgmtServer; } -}; - -class ZoneMgmtServer : public CommandHandlerInterface, public AttributeAccessInterface -{ -public: - /** - * @brief Creates a Zone Management cluster instance. The Init() function needs to be called for this instance - * to be registered and called by the interaction model at the appropriate times. - * - * @param aDelegate A reference to the delegate to be used by this server. - * Note: the caller must ensure that the delegate lives throughout the instance's - * lifetime. - * - * @param aEndpointId The endpoint on which this cluster exists. This must match the zap configuration. - * @param aFeatures The bitflags value that identifies which features are supported by this instance. - * @param aMaxUserDefinedZones The maximum number of user-defined zones supported by the device. - * This value is specified by the device manufacturer. - * @param aMaxZones The maximum number of zones that are allowed to exist on the device. This is the - * sum of the predefined built-in zones and the user-defined zones. - * @param aSensitivityMax The hardware-specific value for the number of supported sensitivity levels. - * This value is specified by the device manufacturer. - * @param aTwoDCartesianMax The maximum X and Y points that are allowed for TwoD Cartesian Zones. - * - */ - ZoneMgmtServer(Delegate & aDelegate, EndpointId aEndpointId, const BitFlags aFeatures, uint8_t aMaxUserDefinedZones, - uint8_t aMaxZones, uint8_t aSensitivityMax, const TwoDCartesianVertexStruct & aTwoDCartesianMax); - - ~ZoneMgmtServer() override; - - /** - * @brief Initialise the Zone Management server instance. - * This function must be called after defining a ZoneMgmtServer class object. - * @return Returns an error if some of the constraint/feature validation checks fail or - * the CommandHandler or AttributeHandler registration fails, else returns CHIP_NO_ERROR. - */ - CHIP_ERROR Init(); - - bool HasFeature(Feature feature) const; - - // Attribute Setters - CHIP_ERROR SetSensitivity(uint8_t aSensitivity); - - // Attribute Getters - const std::vector & GetZones() const { return mZones; } - - const std::vector & GetTriggers() const { return mTriggers; } - - const Optional GetTriggerForZone(uint16_t zoneID); - - uint8_t GetMaxUserDefinedZones() const { return mMaxUserDefinedZones; } - uint8_t GetMaxZones() const { return mMaxZones; } - uint8_t GetSensitivityMax() const { return mSensitivityMax; } - uint8_t GetSensitivity() const { return mSensitivity; } - const TwoDCartesianVertexStruct & GetTwoDCartesianMax() const { return mTwoDCartesianMax; } - - CHIP_ERROR AddZone(const ZoneInformationStorage & zone); - CHIP_ERROR UpdateZone(uint16_t zoneId, const ZoneInformationStorage & zone); - CHIP_ERROR RemoveZone(uint16_t zoneId); - - Protocols::InteractionModel::Status AddOrUpdateTrigger(const ZoneTriggerControlStruct & trigger); - Protocols::InteractionModel::Status RemoveTrigger(uint16_t zoneId); - - // Generate Zone events - Protocols::InteractionModel::Status GenerateZoneTriggeredEvent(uint16_t zoneID, ZoneEventTriggeredReasonEnum triggerReason); - Protocols::InteractionModel::Status GenerateZoneStoppedEvent(uint16_t zoneID, ZoneEventStoppedReasonEnum stopReason); - -private: - Delegate & mDelegate; - EndpointId mEndpointId; - const BitFlags mFeatures; - - // Attributes - const uint8_t mMaxUserDefinedZones; - const uint8_t mMaxZones; - const uint8_t mSensitivityMax; - const TwoDCartesianVertexStruct mTwoDCartesianMax; - uint8_t mUserDefinedZonesCount = 0; - - std::vector mZones; - std::vector mTriggers; - uint8_t mSensitivity = 0; - - /** - * IM-level implementation of read - * @return appropriately mapped CHIP_ERROR if applicable - */ - CHIP_ERROR Read(const ConcreteReadAttributePath & aPath, AttributeValueEncoder & aEncoder) override; - - /** - * IM-level implementation of write - * @return appropriately mapped CHIP_ERROR if applicable - */ - CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, AttributeValueDecoder & aDecoder) override; - - /** - * Helper function that loads all the persistent attributes from the KVS. - */ - void LoadPersistentAttributes(); - - CHIP_ERROR ReadAndEncodeZones(const AttributeValueEncoder::ListEncodeHelper & encoder); - - CHIP_ERROR ReadAndEncodeTriggers(const AttributeValueEncoder::ListEncodeHelper & encoder); - - Protocols::InteractionModel::Status ValidateTwoDCartesianZone(const TwoDCartesianZoneDecodableStruct & zone); - - Protocols::InteractionModel::Status ValidateTrigger(const ZoneTriggerControlStruct & trigger); - - // Utility that matches a given zone's ZoneUse and verices with the given - // parameters to check if they match. Used by ZoneAlreadyExists(). - bool DoZoneUseAndVerticesMatch(ZoneUseEnum use, const std::vector & vertices, - const TwoDCartesianZoneStorage & zone); - - // Utility function to check if a given ZoneUse and a TwoDVertex already - // exists in mZones. - bool ZoneAlreadyExists(ZoneUseEnum zoneUse, const std::vector & vertices, - const DataModel::Nullable & excludeZoneId); - - /** - * @brief Inherited from CommandHandlerInterface - */ - void InvokeCommand(HandlerContext & ctx) override; - - void HandleCreateTwoDCartesianZone(HandlerContext & ctx, const Commands::CreateTwoDCartesianZone::DecodableType & req); - - void HandleUpdateTwoDCartesianZone(HandlerContext & ctx, const Commands::UpdateTwoDCartesianZone::DecodableType & req); - - void HandleRemoveZone(HandlerContext & ctx, const Commands::RemoveZone::DecodableType & req); - - void HandleCreateOrUpdateTrigger(HandlerContext & ctx, const Commands::CreateOrUpdateTrigger::DecodableType & req); - - void HandleRemoveTrigger(HandlerContext & ctx, const Commands::RemoveTrigger::DecodableType & req); -}; - -} // namespace ZoneManagement -} // namespace Clusters -} // namespace app -} // namespace chip +#include diff --git a/src/app/tests/BUILD.gn b/src/app/tests/BUILD.gn index 36d9400f330..f5e2700d718 100644 --- a/src/app/tests/BUILD.gn +++ b/src/app/tests/BUILD.gn @@ -175,13 +175,13 @@ source_set("ecosystem-information-test-srcs") { source_set("closure-dimension-test-srcs") { sources = [ - "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.cpp", + "${chip_root}/src/app/clusters/closure-dimension-server/ClosureDimensionCluster.cpp", + "${chip_root}/src/app/clusters/closure-dimension-server/ClosureDimensionClusterLogic.cpp", + "${chip_root}/src/app/clusters/closure-dimension-server/ClosureDimensionClusterMatterContext.cpp", "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-cluster-logic.h", "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-cluster-objects.h", "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-delegate.h", - "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.cpp", "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-matter-context.h", - "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-server.cpp", "${chip_root}/src/app/clusters/closure-dimension-server/closure-dimension-server.h", ] public_deps = [ diff --git a/src/app/zap-templates/zcl/data-model/chip/ambient-context-sensing-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/ambient-context-sensing-cluster.xml index 2dc6bb5c527..e2178af2fb3 100644 --- a/src/app/zap-templates/zcl/data-model/chip/ambient-context-sensing-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/ambient-context-sensing-cluster.xml @@ -18,7 +18,7 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/AmbientContextSensing.adoc Parameters: zap -a in-progress sdk-root=./connectedhomeip spec-root=/opt/connectedhomeip-spec /opt/connectedhomeip-spec/src/app_clusters/AmbientContextSensing.adoc -Git: 0.9-winter-2026-572-g31a450daa +Git: 0.9-summer2026-167-g6982bddd1 Alchemy: v1.6.9 --> @@ -49,7 +49,7 @@ Alchemy: v1.6.9 - + @@ -79,22 +79,32 @@ Alchemy: v1.6.9 - - - + + + + + + - - - + + + + + + - - - + + + + + + + @@ -108,6 +118,7 @@ Alchemy: v1.6.9 + @@ -120,45 +131,73 @@ Alchemy: v1.6.9 - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + - + + + + + + + + + + - - - - + + + + + + - - - This event SHALL be generated when there is at least one of HumanActivityDetected or ObjectIdentified or AudioContextDetected or ObjectCountReached attribute changes from False To True. + + + + This event SHALL be generated when a new different ambient context detection is added to AmbientContextType. + @@ -169,15 +208,19 @@ Alchemy: v1.6.9 - + + + + - - This event SHALL be generated when there is a negative Boolean state change from HumanActivityDetected or ObjectIdentified or AudioContextDetected or ObjectCountReached attribute. + + This event SHALL be generated when the ambient context detection that generated the AmbientContextDetectStarted event is removed from AmbientContextType. + @@ -188,7 +231,10 @@ Alchemy: v1.6.9 - + + + + diff --git a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml index 7c4df7d0033..5c74cf5bf94 100644 --- a/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/basic-information-cluster.xml @@ -17,9 +17,9 @@ limitations under the License. @@ -158,6 +158,18 @@ Alchemy: v1.6.9 + + + + + + + + + + + + diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 5eb1d6629fd..9d11a8763e8 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -208,6 +208,7 @@ "ProductAppearance", "SpecificationVersion", "MaxPathsPerInvoke", + "DeviceLocation", "ConfigurationVersion" ], "Boolean State": ["ClusterRevision", "FeatureMap", "StateValue"], diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 86fd20671a7..4072affe9c9 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -207,6 +207,7 @@ "ProductAppearance", "SpecificationVersion", "MaxPathsPerInvoke", + "DeviceLocation", "ConfigurationVersion" ], "Boolean State": ["ClusterRevision", "FeatureMap", "StateValue"], diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index afd189f27dd..9b76a31fd16 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -1144,6 +1144,7 @@ cluster BasicInformation = 40 { readonly attribute optional ProductAppearanceStruct productAppearance = 20; readonly attribute optional int32u specificationVersion = 21; readonly attribute optional int16u maxPathsPerInvoke = 22; + attribute access(write: administer) optional nullable LocationDescriptorStruct deviceLocation = 23; readonly attribute optional int32u configurationVersion = 24; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; @@ -8809,12 +8810,13 @@ provisional cluster AmbientContextSensing = 1073 { } info event AmbientContextDetectStarted = 0 { - optional AmbientContextTypeStruct ambientContextType[] = 0; - optional int16u objectCount = 1; + optional AmbientContextTypeStruct ambientContextDetected = 0; + optional boolean objectCountReached = 1; + optional int16u objectCount = 2; } info event AmbientContextDetectEnded = 1 { - event_no startEventNumber = 0; + posix_ms eventStartTime = 0; } readonly attribute optional boolean humanActivityDetected = 0; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 62c2ff29315..1465d68a0e0 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -4074,6 +4074,7 @@ public static class BasicInformationCluster extends BaseChipCluster { private static final long PRODUCT_APPEARANCE_ATTRIBUTE_ID = 20L; private static final long SPECIFICATION_VERSION_ATTRIBUTE_ID = 21L; private static final long MAX_PATHS_PER_INVOKE_ATTRIBUTE_ID = 22L; + private static final long DEVICE_LOCATION_ATTRIBUTE_ID = 23L; private static final long CONFIGURATION_VERSION_ATTRIBUTE_ID = 24L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; @@ -4115,6 +4116,10 @@ public interface ProductAppearanceAttributeCallback extends BaseAttributeCallbac void onSuccess(ChipStructs.BasicInformationClusterProductAppearanceStruct value); } + public interface DeviceLocationAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable ChipStructs.BasicInformationClusterLocationDescriptorStruct value); + } + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { void onSuccess(List value); } @@ -4752,6 +4757,41 @@ public void onSuccess(byte[] tlv) { }, MAX_PATHS_PER_INVOKE_ATTRIBUTE_ID, minInterval, maxInterval); } + public void readDeviceLocationAttribute( + DeviceLocationAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEVICE_LOCATION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.BasicInformationClusterLocationDescriptorStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEVICE_LOCATION_ATTRIBUTE_ID, true); + } + + public void writeDeviceLocationAttribute(DefaultClusterCallback callback, ChipStructs.BasicInformationClusterLocationDescriptorStruct value) { + writeDeviceLocationAttribute(callback, value, 0); + } + + public void writeDeviceLocationAttribute(DefaultClusterCallback callback, ChipStructs.BasicInformationClusterLocationDescriptorStruct value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = value != null ? value.encodeTlv() : new NullType(); + writeAttribute(new WriteAttributesCallbackImpl(callback), DEVICE_LOCATION_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeDeviceLocationAttribute( + DeviceLocationAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DEVICE_LOCATION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + @Nullable ChipStructs.BasicInformationClusterLocationDescriptorStruct value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, DEVICE_LOCATION_ATTRIBUTE_ID, minInterval, maxInterval); + } + public void readConfigurationVersionAttribute( LongAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CONFIGURATION_VERSION_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java index 1648e44eb7b..991d80e1b06 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipEventStructs.java @@ -6679,22 +6679,27 @@ public String toString() { } } public static class AmbientContextSensingClusterAmbientContextDetectStartedEvent { - public Optional> ambientContextType; + public Optional ambientContextDetected; + public Optional objectCountReached; public Optional objectCount; - private static final long AMBIENT_CONTEXT_TYPE_ID = 0L; - private static final long OBJECT_COUNT_ID = 1L; + private static final long AMBIENT_CONTEXT_DETECTED_ID = 0L; + private static final long OBJECT_COUNT_REACHED_ID = 1L; + private static final long OBJECT_COUNT_ID = 2L; public AmbientContextSensingClusterAmbientContextDetectStartedEvent( - Optional> ambientContextType, + Optional ambientContextDetected, + Optional objectCountReached, Optional objectCount ) { - this.ambientContextType = ambientContextType; + this.ambientContextDetected = ambientContextDetected; + this.objectCountReached = objectCountReached; this.objectCount = objectCount; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(AMBIENT_CONTEXT_TYPE_ID, ambientContextType.map((nonOptionalambientContextType) -> ArrayType.generateArrayType(nonOptionalambientContextType, (elementnonOptionalambientContextType) -> elementnonOptionalambientContextType.encodeTlv())).orElse(new EmptyType()))); + values.add(new StructElement(AMBIENT_CONTEXT_DETECTED_ID, ambientContextDetected.map((nonOptionalambientContextDetected) -> nonOptionalambientContextDetected.encodeTlv()).orElse(new EmptyType()))); + values.add(new StructElement(OBJECT_COUNT_REACHED_ID, objectCountReached.map((nonOptionalobjectCountReached) -> new BooleanType(nonOptionalobjectCountReached)).orElse(new EmptyType()))); values.add(new StructElement(OBJECT_COUNT_ID, objectCount.map((nonOptionalobjectCount) -> new UIntType(nonOptionalobjectCount)).orElse(new EmptyType()))); return new StructType(values); @@ -6704,13 +6709,19 @@ public static AmbientContextSensingClusterAmbientContextDetectStartedEvent decod if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Optional> ambientContextType = Optional.empty(); + Optional ambientContextDetected = Optional.empty(); + Optional objectCountReached = Optional.empty(); Optional objectCount = Optional.empty(); for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == AMBIENT_CONTEXT_TYPE_ID) { - if (element.value(BaseTLVType.class).type() == TLVType.Array) { - ArrayType castingValue = element.value(ArrayType.class); - ambientContextType = Optional.of(castingValue.map((elementcastingValue) -> ChipStructs.AmbientContextSensingClusterAmbientContextTypeStruct.decodeTlv(elementcastingValue))); + if (element.contextTagNum() == AMBIENT_CONTEXT_DETECTED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Struct) { + StructType castingValue = element.value(StructType.class); + ambientContextDetected = Optional.of(ChipStructs.AmbientContextSensingClusterAmbientContextTypeStruct.decodeTlv(castingValue)); + } + } else if (element.contextTagNum() == OBJECT_COUNT_REACHED_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { + BooleanType castingValue = element.value(BooleanType.class); + objectCountReached = Optional.of(castingValue.value(Boolean.class)); } } else if (element.contextTagNum() == OBJECT_COUNT_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { @@ -6720,7 +6731,8 @@ public static AmbientContextSensingClusterAmbientContextDetectStartedEvent decod } } return new AmbientContextSensingClusterAmbientContextDetectStartedEvent( - ambientContextType, + ambientContextDetected, + objectCountReached, objectCount ); } @@ -6729,8 +6741,11 @@ public static AmbientContextSensingClusterAmbientContextDetectStartedEvent decod public String toString() { StringBuilder output = new StringBuilder(); output.append("AmbientContextSensingClusterAmbientContextDetectStartedEvent {\n"); - output.append("\tambientContextType: "); - output.append(ambientContextType); + output.append("\tambientContextDetected: "); + output.append(ambientContextDetected); + output.append("\n"); + output.append("\tobjectCountReached: "); + output.append(objectCountReached); output.append("\n"); output.append("\tobjectCount: "); output.append(objectCount); @@ -6740,18 +6755,18 @@ public String toString() { } } public static class AmbientContextSensingClusterAmbientContextDetectEndedEvent { - public Long startEventNumber; - private static final long START_EVENT_NUMBER_ID = 0L; + public Long eventStartTime; + private static final long EVENT_START_TIME_ID = 0L; public AmbientContextSensingClusterAmbientContextDetectEndedEvent( - Long startEventNumber + Long eventStartTime ) { - this.startEventNumber = startEventNumber; + this.eventStartTime = eventStartTime; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(START_EVENT_NUMBER_ID, new UIntType(startEventNumber))); + values.add(new StructElement(EVENT_START_TIME_ID, new UIntType(eventStartTime))); return new StructType(values); } @@ -6760,17 +6775,17 @@ public static AmbientContextSensingClusterAmbientContextDetectEndedEvent decodeT if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Long startEventNumber = null; + Long eventStartTime = null; for (StructElement element: ((StructType)tlvValue).value()) { - if (element.contextTagNum() == START_EVENT_NUMBER_ID) { + if (element.contextTagNum() == EVENT_START_TIME_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - startEventNumber = castingValue.value(Long.class); + eventStartTime = castingValue.value(Long.class); } } } return new AmbientContextSensingClusterAmbientContextDetectEndedEvent( - startEventNumber + eventStartTime ); } @@ -6778,8 +6793,8 @@ public static AmbientContextSensingClusterAmbientContextDetectEndedEvent decodeT public String toString() { StringBuilder output = new StringBuilder(); output.append("AmbientContextSensingClusterAmbientContextDetectEndedEvent {\n"); - output.append("\tstartEventNumber: "); - output.append(startEventNumber); + output.append("\teventStartTime: "); + output.append(eventStartTime); output.append("\n"); output.append("}\n"); return output.toString(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 2b27ccbe9ef..3378fd8f7d2 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -980,6 +980,82 @@ public String toString() { return output.toString(); } } +public static class BasicInformationClusterLocationDescriptorStruct { + public String locationName; + public @Nullable Integer floorNumber; + public @Nullable Integer areaType; + private static final long LOCATION_NAME_ID = 0L; + private static final long FLOOR_NUMBER_ID = 1L; + private static final long AREA_TYPE_ID = 2L; + + public BasicInformationClusterLocationDescriptorStruct( + String locationName, + @Nullable Integer floorNumber, + @Nullable Integer areaType + ) { + this.locationName = locationName; + this.floorNumber = floorNumber; + this.areaType = areaType; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(LOCATION_NAME_ID, new StringType(locationName))); + values.add(new StructElement(FLOOR_NUMBER_ID, floorNumber != null ? new IntType(floorNumber) : new NullType())); + values.add(new StructElement(AREA_TYPE_ID, areaType != null ? new UIntType(areaType) : new NullType())); + + return new StructType(values); + } + + public static BasicInformationClusterLocationDescriptorStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + String locationName = null; + @Nullable Integer floorNumber = null; + @Nullable Integer areaType = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == LOCATION_NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + locationName = castingValue.value(String.class); + } + } else if (element.contextTagNum() == FLOOR_NUMBER_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.Int) { + IntType castingValue = element.value(IntType.class); + floorNumber = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == AREA_TYPE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + areaType = castingValue.value(Integer.class); + } + } + } + return new BasicInformationClusterLocationDescriptorStruct( + locationName, + floorNumber, + areaType + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("BasicInformationClusterLocationDescriptorStruct {\n"); + output.append("\tlocationName: "); + output.append(locationName); + output.append("\n"); + output.append("\tfloorNumber: "); + output.append(floorNumber); + output.append("\n"); + output.append("\tareaType: "); + output.append(areaType); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class BasicInformationClusterCapabilityMinimaStruct { public Integer caseSessionsPerFabric; public Integer subscriptionsPerFabric; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index be7738b6cd6..0fa3c7fc549 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -1988,6 +1988,7 @@ public enum Attribute { ProductAppearance(20L), SpecificationVersion(21L), MaxPathsPerInvoke(22L), + DeviceLocation(23L), ConfigurationVersion(24L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 83b7caca47e..015a7ea8f6b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -1363,6 +1363,27 @@ public void onError(Exception ex) { } } + public static class DelegatedBasicInformationClusterDeviceLocationAttributeCallback implements ChipClusters.BasicInformationCluster.DeviceLocationAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(@Nullable ChipStructs.BasicInformationClusterLocationDescriptorStruct value) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("value", "ChipStructs.BasicInformationClusterLocationDescriptorStruct"); + responseValues.put(commandResponseInfo, value); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedBasicInformationClusterGeneratedCommandListAttributeCallback implements ChipClusters.BasicInformationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt index f31ac3b3bfd..ac3355edab6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt @@ -22,34 +22,34 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class AmbientContextSensingClusterAmbientContextDetectEndedEvent(val startEventNumber: ULong) { +class AmbientContextSensingClusterAmbientContextDetectEndedEvent(val eventStartTime: ULong) { override fun toString(): String = buildString { append("AmbientContextSensingClusterAmbientContextDetectEndedEvent {\n") - append("\tstartEventNumber : $startEventNumber\n") + append("\teventStartTime : $eventStartTime\n") append("}\n") } fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_START_EVENT_NUMBER), startEventNumber) + put(ContextSpecificTag(TAG_EVENT_START_TIME), eventStartTime) endStructure() } } companion object { - private const val TAG_START_EVENT_NUMBER = 0 + private const val TAG_EVENT_START_TIME = 0 fun fromTlv( tlvTag: Tag, tlvReader: TlvReader, ): AmbientContextSensingClusterAmbientContextDetectEndedEvent { tlvReader.enterStructure(tlvTag) - val startEventNumber = tlvReader.getULong(ContextSpecificTag(TAG_START_EVENT_NUMBER)) + val eventStartTime = tlvReader.getULong(ContextSpecificTag(TAG_EVENT_START_TIME)) tlvReader.exitContainer() - return AmbientContextSensingClusterAmbientContextDetectEndedEvent(startEventNumber) + return AmbientContextSensingClusterAmbientContextDetectEndedEvent(eventStartTime) } } } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt index e309bd0b109..4b5813d20ca 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt @@ -18,24 +18,23 @@ package chip.devicecontroller.cluster.eventstructs import chip.devicecontroller.cluster.* import java.util.Optional -import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter class AmbientContextSensingClusterAmbientContextDetectStartedEvent( - val ambientContextType: + val ambientContextDetected: Optional< - List< - chip.devicecontroller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct - > + chip.devicecontroller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct >, + val objectCountReached: Optional, val objectCount: Optional, ) { override fun toString(): String = buildString { append("AmbientContextSensingClusterAmbientContextDetectStartedEvent {\n") - append("\tambientContextType : $ambientContextType\n") + append("\tambientContextDetected : $ambientContextDetected\n") + append("\tobjectCountReached : $objectCountReached\n") append("\tobjectCount : $objectCount\n") append("}\n") } @@ -43,13 +42,13 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - if (ambientContextType.isPresent) { - val optambientContextType = ambientContextType.get() - startArray(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE)) - for (item in optambientContextType.iterator()) { - item.toTlv(AnonymousTag, this) - } - endArray() + if (ambientContextDetected.isPresent) { + val optambientContextDetected = ambientContextDetected.get() + optambientContextDetected.toTlv(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED), this) + } + if (objectCountReached.isPresent) { + val optobjectCountReached = objectCountReached.get() + put(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED), optobjectCountReached) } if (objectCount.isPresent) { val optobjectCount = objectCount.get() @@ -60,34 +59,31 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( } companion object { - private const val TAG_AMBIENT_CONTEXT_TYPE = 0 - private const val TAG_OBJECT_COUNT = 1 + private const val TAG_AMBIENT_CONTEXT_DETECTED = 0 + private const val TAG_OBJECT_COUNT_REACHED = 1 + private const val TAG_OBJECT_COUNT = 2 fun fromTlv( tlvTag: Tag, tlvReader: TlvReader, ): AmbientContextSensingClusterAmbientContextDetectStartedEvent { tlvReader.enterStructure(tlvTag) - val ambientContextType = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE))) { + val ambientContextDetected = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED))) { Optional.of( - buildList< - chip.devicecontroller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct - > { - tlvReader.enterArray(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE)) - while (!tlvReader.isEndOfContainer()) { - this.add( - chip.devicecontroller.cluster.structs - .AmbientContextSensingClusterAmbientContextTypeStruct - .fromTlv(AnonymousTag, tlvReader) - ) - } - tlvReader.exitContainer() - } + chip.devicecontroller.cluster.structs + .AmbientContextSensingClusterAmbientContextTypeStruct + .fromTlv(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED), tlvReader) ) } else { Optional.empty() } + val objectCountReached = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED))) + } else { + Optional.empty() + } val objectCount = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OBJECT_COUNT))) { Optional.of(tlvReader.getUInt(ContextSpecificTag(TAG_OBJECT_COUNT))) @@ -98,7 +94,8 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( tlvReader.exitContainer() return AmbientContextSensingClusterAmbientContextDetectStartedEvent( - ambientContextType, + ambientContextDetected, + objectCountReached, objectCount, ) } diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni index 497771d6841..261dde0bb5e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -21,6 +21,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BridgedDeviceBasicInformationClusterLocationDescriptorStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt new file mode 100644 index 00000000000..556654de22d --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package chip.devicecontroller.cluster.structs + +import chip.devicecontroller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class BasicInformationClusterLocationDescriptorStruct( + val locationName: String, + val floorNumber: Int?, + val areaType: UInt?, +) { + override fun toString(): String = buildString { + append("BasicInformationClusterLocationDescriptorStruct {\n") + append("\tlocationName : $locationName\n") + append("\tfloorNumber : $floorNumber\n") + append("\tareaType : $areaType\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LOCATION_NAME), locationName) + if (floorNumber != null) { + put(ContextSpecificTag(TAG_FLOOR_NUMBER), floorNumber) + } else { + putNull(ContextSpecificTag(TAG_FLOOR_NUMBER)) + } + if (areaType != null) { + put(ContextSpecificTag(TAG_AREA_TYPE), areaType) + } else { + putNull(ContextSpecificTag(TAG_AREA_TYPE)) + } + endStructure() + } + } + + companion object { + private const val TAG_LOCATION_NAME = 0 + private const val TAG_FLOOR_NUMBER = 1 + private const val TAG_AREA_TYPE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): BasicInformationClusterLocationDescriptorStruct { + tlvReader.enterStructure(tlvTag) + val locationName = tlvReader.getString(ContextSpecificTag(TAG_LOCATION_NAME)) + val floorNumber = + if (!tlvReader.isNull()) { + tlvReader.getInt(ContextSpecificTag(TAG_FLOOR_NUMBER)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FLOOR_NUMBER)) + null + } + val areaType = + if (!tlvReader.isNull()) { + tlvReader.getUInt(ContextSpecificTag(TAG_AREA_TYPE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AREA_TYPE)) + null + } + + tlvReader.exitContainer() + + return BasicInformationClusterLocationDescriptorStruct(locationName, floorNumber, areaType) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt index 26bd29a5292..724c42bf95d 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt @@ -69,6 +69,17 @@ class BasicInformationCluster( object SubscriptionEstablished : ProductAppearanceAttributeSubscriptionState() } + class DeviceLocationAttribute(val value: BasicInformationClusterLocationDescriptorStruct?) + + sealed class DeviceLocationAttributeSubscriptionState { + data class Success(val value: BasicInformationClusterLocationDescriptorStruct?) : + DeviceLocationAttributeSubscriptionState() + + data class Error(val exception: Exception) : DeviceLocationAttributeSubscriptionState() + + object SubscriptionEstablished : DeviceLocationAttributeSubscriptionState() + } + class GeneratedCommandListAttribute(val value: List) sealed class GeneratedCommandListAttributeSubscriptionState { @@ -2237,6 +2248,152 @@ class BasicInformationCluster( } } + suspend fun readDeviceLocationAttribute(): DeviceLocationAttribute { + val ATTRIBUTE_ID: UInt = 23u + + val attributePath = + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + + val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) + + val response = controller.read(readRequest) + + if (response.successes.isEmpty()) { + logger.log(Level.WARNING, "Read command failed") + throw IllegalStateException("Read command failed with failures: ${response.failures}") + } + + logger.log(Level.FINE, "Read command succeeded") + + val attributeData = + response.successes.filterIsInstance().firstOrNull { + it.path.attributeId == ATTRIBUTE_ID + } + + requireNotNull(attributeData) { "Devicelocation attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: BasicInformationClusterLocationDescriptorStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + BasicInformationClusterLocationDescriptorStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + return DeviceLocationAttribute(decodedValue) + } + + suspend fun writeDeviceLocationAttribute( + value: BasicInformationClusterLocationDescriptorStruct, + timedWriteTimeout: Duration? = null, + ) { + val ATTRIBUTE_ID: UInt = 23u + + val tlvWriter = TlvWriter() + value.toTlv(AnonymousTag, tlvWriter) + + val writeRequests: WriteRequests = + WriteRequests( + requests = + listOf( + WriteRequest( + attributePath = + AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), + tlvPayload = tlvWriter.getEncoded(), + ) + ), + timedRequest = timedWriteTimeout, + ) + + val response: WriteResponse = controller.write(writeRequests) + + when (response) { + is WriteResponse.Success -> { + logger.log(Level.FINE, "Write command succeeded") + } + is WriteResponse.PartialWriteFailure -> { + val aggregatedErrorMessage = + response.failures.joinToString("\n") { failure -> + "Error at ${failure.attributePath}: ${failure.ex.message}" + } + + response.failures.forEach { failure -> + logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") + } + + throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") + } + } + } + + suspend fun subscribeDeviceLocationAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 23u + val attributePaths = + listOf( + AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) + ) + + val subscribeRequest: SubscribeRequest = + SubscribeRequest( + eventPaths = emptyList(), + attributePaths = attributePaths, + minInterval = Duration.ofSeconds(minInterval.toLong()), + maxInterval = Duration.ofSeconds(maxInterval.toLong()), + ) + + return controller.subscribe(subscribeRequest).transform { subscriptionState -> + when (subscriptionState) { + is SubscriptionState.SubscriptionErrorNotification -> { + emit( + DeviceLocationAttributeSubscriptionState.Error( + Exception( + "Subscription terminated with error code: ${subscriptionState.terminationCause}" + ) + ) + ) + } + is SubscriptionState.NodeStateUpdate -> { + val attributeData = + subscriptionState.updateState.successes + .filterIsInstance() + .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } + + requireNotNull(attributeData) { + "Devicelocation attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: BasicInformationClusterLocationDescriptorStruct? = + if (!tlvReader.isNull()) { + if (tlvReader.isNextTag(AnonymousTag)) { + BasicInformationClusterLocationDescriptorStruct.fromTlv(AnonymousTag, tlvReader) + } else { + null + } + } else { + tlvReader.getNull(AnonymousTag) + null + } + + decodedValue?.let { emit(DeviceLocationAttributeSubscriptionState.Success(it)) } + } + SubscriptionState.SubscriptionEstablished -> { + emit(DeviceLocationAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + suspend fun readConfigurationVersionAttribute(): UInt? { val ATTRIBUTE_ID: UInt = 24u diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt index df2db3bf97d..909dff3ef8f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectEndedEvent.kt @@ -22,34 +22,34 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class AmbientContextSensingClusterAmbientContextDetectEndedEvent(val startEventNumber: ULong) { +class AmbientContextSensingClusterAmbientContextDetectEndedEvent(val eventStartTime: ULong) { override fun toString(): String = buildString { append("AmbientContextSensingClusterAmbientContextDetectEndedEvent {\n") - append("\tstartEventNumber : $startEventNumber\n") + append("\teventStartTime : $eventStartTime\n") append("}\n") } fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_START_EVENT_NUMBER), startEventNumber) + put(ContextSpecificTag(TAG_EVENT_START_TIME), eventStartTime) endStructure() } } companion object { - private const val TAG_START_EVENT_NUMBER = 0 + private const val TAG_EVENT_START_TIME = 0 fun fromTlv( tlvTag: Tag, tlvReader: TlvReader, ): AmbientContextSensingClusterAmbientContextDetectEndedEvent { tlvReader.enterStructure(tlvTag) - val startEventNumber = tlvReader.getULong(ContextSpecificTag(TAG_START_EVENT_NUMBER)) + val eventStartTime = tlvReader.getULong(ContextSpecificTag(TAG_EVENT_START_TIME)) tlvReader.exitContainer() - return AmbientContextSensingClusterAmbientContextDetectEndedEvent(startEventNumber) + return AmbientContextSensingClusterAmbientContextDetectEndedEvent(eventStartTime) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt index d1fce95cfab..050a481ccce 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/eventstructs/AmbientContextSensingClusterAmbientContextDetectStartedEvent.kt @@ -18,22 +18,23 @@ package matter.controller.cluster.eventstructs import java.util.Optional import matter.controller.cluster.* -import matter.tlv.AnonymousTag import matter.tlv.ContextSpecificTag import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter class AmbientContextSensingClusterAmbientContextDetectStartedEvent( - val ambientContextType: + val ambientContextDetected: Optional< - List + matter.controller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct >, + val objectCountReached: Optional, val objectCount: Optional, ) { override fun toString(): String = buildString { append("AmbientContextSensingClusterAmbientContextDetectStartedEvent {\n") - append("\tambientContextType : $ambientContextType\n") + append("\tambientContextDetected : $ambientContextDetected\n") + append("\tobjectCountReached : $objectCountReached\n") append("\tobjectCount : $objectCount\n") append("}\n") } @@ -41,13 +42,13 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - if (ambientContextType.isPresent) { - val optambientContextType = ambientContextType.get() - startArray(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE)) - for (item in optambientContextType.iterator()) { - item.toTlv(AnonymousTag, this) - } - endArray() + if (ambientContextDetected.isPresent) { + val optambientContextDetected = ambientContextDetected.get() + optambientContextDetected.toTlv(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED), this) + } + if (objectCountReached.isPresent) { + val optobjectCountReached = objectCountReached.get() + put(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED), optobjectCountReached) } if (objectCount.isPresent) { val optobjectCount = objectCount.get() @@ -58,34 +59,30 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( } companion object { - private const val TAG_AMBIENT_CONTEXT_TYPE = 0 - private const val TAG_OBJECT_COUNT = 1 + private const val TAG_AMBIENT_CONTEXT_DETECTED = 0 + private const val TAG_OBJECT_COUNT_REACHED = 1 + private const val TAG_OBJECT_COUNT = 2 fun fromTlv( tlvTag: Tag, tlvReader: TlvReader, ): AmbientContextSensingClusterAmbientContextDetectStartedEvent { tlvReader.enterStructure(tlvTag) - val ambientContextType = - if (tlvReader.isNextTag(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE))) { + val ambientContextDetected = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED))) { Optional.of( - buildList< - matter.controller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct - > { - tlvReader.enterArray(ContextSpecificTag(TAG_AMBIENT_CONTEXT_TYPE)) - while (!tlvReader.isEndOfContainer()) { - this.add( - matter.controller.cluster.structs - .AmbientContextSensingClusterAmbientContextTypeStruct - .fromTlv(AnonymousTag, tlvReader) - ) - } - tlvReader.exitContainer() - } + matter.controller.cluster.structs.AmbientContextSensingClusterAmbientContextTypeStruct + .fromTlv(ContextSpecificTag(TAG_AMBIENT_CONTEXT_DETECTED), tlvReader) ) } else { Optional.empty() } + val objectCountReached = + if (tlvReader.isNextTag(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED))) { + Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_OBJECT_COUNT_REACHED))) + } else { + Optional.empty() + } val objectCount = if (tlvReader.isNextTag(ContextSpecificTag(TAG_OBJECT_COUNT))) { Optional.of(tlvReader.getUShort(ContextSpecificTag(TAG_OBJECT_COUNT))) @@ -96,7 +93,8 @@ class AmbientContextSensingClusterAmbientContextDetectStartedEvent( tlvReader.exitContainer() return AmbientContextSensingClusterAmbientContextDetectStartedEvent( - ambientContextType, + ambientContextDetected, + objectCountReached, objectCount, ) } diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index f98f5c7587a..a3778d84ced 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -21,6 +21,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ApplicationLauncherClusterApplicationStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/AudioOutputClusterOutputInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterCapabilityMinimaStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterProductAppearanceStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BindingClusterTargetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/BridgedDeviceBasicInformationClusterLocationDescriptorStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt new file mode 100644 index 00000000000..ccaa62c28ac --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/BasicInformationClusterLocationDescriptorStruct.kt @@ -0,0 +1,87 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package matter.controller.cluster.structs + +import matter.controller.cluster.* +import matter.tlv.ContextSpecificTag +import matter.tlv.Tag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class BasicInformationClusterLocationDescriptorStruct( + val locationName: String, + val floorNumber: Short?, + val areaType: UByte?, +) { + override fun toString(): String = buildString { + append("BasicInformationClusterLocationDescriptorStruct {\n") + append("\tlocationName : $locationName\n") + append("\tfloorNumber : $floorNumber\n") + append("\tareaType : $areaType\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_LOCATION_NAME), locationName) + if (floorNumber != null) { + put(ContextSpecificTag(TAG_FLOOR_NUMBER), floorNumber) + } else { + putNull(ContextSpecificTag(TAG_FLOOR_NUMBER)) + } + if (areaType != null) { + put(ContextSpecificTag(TAG_AREA_TYPE), areaType) + } else { + putNull(ContextSpecificTag(TAG_AREA_TYPE)) + } + endStructure() + } + } + + companion object { + private const val TAG_LOCATION_NAME = 0 + private const val TAG_FLOOR_NUMBER = 1 + private const val TAG_AREA_TYPE = 2 + + fun fromTlv( + tlvTag: Tag, + tlvReader: TlvReader, + ): BasicInformationClusterLocationDescriptorStruct { + tlvReader.enterStructure(tlvTag) + val locationName = tlvReader.getString(ContextSpecificTag(TAG_LOCATION_NAME)) + val floorNumber = + if (!tlvReader.isNull()) { + tlvReader.getShort(ContextSpecificTag(TAG_FLOOR_NUMBER)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_FLOOR_NUMBER)) + null + } + val areaType = + if (!tlvReader.isNull()) { + tlvReader.getUByte(ContextSpecificTag(TAG_AREA_TYPE)) + } else { + tlvReader.getNull(ContextSpecificTag(TAG_AREA_TYPE)) + null + } + + tlvReader.exitContainer() + + return BasicInformationClusterLocationDescriptorStruct(locationName, floorNumber, areaType) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 7887ab57daa..13aa916c0fb 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -3247,6 +3247,79 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; } + case Attributes::DeviceLocation::Id: { + using TypeInfo = Attributes::DeviceLocation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + if (cppValue.IsNull()) + { + value = nullptr; + } + else + { + jobject value_locationName; + LogErrorOnFailure( + chip::JniReferences::GetInstance().CharToStringUTF(cppValue.Value().locationName, value_locationName)); + jobject value_floorNumber; + if (cppValue.Value().floorNumber.IsNull()) + { + value_floorNumber = nullptr; + } + else + { + std::string value_floorNumberClassName = "java/lang/Integer"; + std::string value_floorNumberCtorSignature = "(I)V"; + jint jnivalue_floorNumber = static_cast(cppValue.Value().floorNumber.Value()); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + value_floorNumberClassName.c_str(), value_floorNumberCtorSignature.c_str(), jnivalue_floorNumber, + value_floorNumber); + } + jobject value_areaType; + if (cppValue.Value().areaType.IsNull()) + { + value_areaType = nullptr; + } + else + { + std::string value_areaTypeClassName = "java/lang/Integer"; + std::string value_areaTypeCtorSignature = "(I)V"; + jint jnivalue_areaType = static_cast(cppValue.Value().areaType.Value()); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + value_areaTypeClassName.c_str(), value_areaTypeCtorSignature.c_str(), jnivalue_areaType, value_areaType); + } + + { + jclass locationDescriptorStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$BasicInformationClusterLocationDescriptorStruct", + locationDescriptorStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$BasicInformationClusterLocationDescriptorStruct"); + return nullptr; + } + + jmethodID locationDescriptorStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod( + env, locationDescriptorStructStructClass_1, "", + "(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;)V", &locationDescriptorStructStructCtor_1); + if (err != CHIP_NO_ERROR || locationDescriptorStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$BasicInformationClusterLocationDescriptorStruct constructor"); + return nullptr; + } + + value = env->NewObject(locationDescriptorStructStructClass_1, locationDescriptorStructStructCtor_1, + value_locationName, value_floorNumber, value_areaType); + } + } + return value; + } case Attributes::ConfigurationVersion::Id: { using TypeInfo = Attributes::ConfigurationVersion::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index 6e5d373d5cc..e84c4d028b9 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8933,160 +8933,175 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & { return nullptr; } - jobject value_ambientContextType; - if (!cppValue.ambientContextType.HasValue()) + jobject value_ambientContextDetected; + if (!cppValue.ambientContextDetected.HasValue()) { - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, value_ambientContextType); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, value_ambientContextDetected); } else { - jobject value_ambientContextTypeInsideOptional; - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateArrayList(value_ambientContextTypeInsideOptional); + jobject value_ambientContextDetectedInsideOptional; + jobject value_ambientContextDetectedInsideOptional_ambientContextSensed; + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateArrayList( + value_ambientContextDetectedInsideOptional_ambientContextSensed); - auto iter_value_ambientContextTypeInsideOptional_1 = cppValue.ambientContextType.Value().begin(); - while (iter_value_ambientContextTypeInsideOptional_1.Next()) + auto iter_value_ambientContextDetectedInsideOptional_ambientContextSensed_2 = + cppValue.ambientContextDetected.Value().ambientContextSensed.begin(); + while (iter_value_ambientContextDetectedInsideOptional_ambientContextSensed_2.Next()) { - auto & entry_1 = iter_value_ambientContextTypeInsideOptional_1.GetValue(); - jobject newElement_1; - jobject newElement_1_ambientContextSensed; - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateArrayList(newElement_1_ambientContextSensed); - - auto iter_newElement_1_ambientContextSensed_3 = entry_1.ambientContextSensed.begin(); - while (iter_newElement_1_ambientContextSensed_3.Next()) + auto & entry_2 = iter_value_ambientContextDetectedInsideOptional_ambientContextSensed_2.GetValue(); + jobject newElement_2; + jobject newElement_2_mfgCode; + if (entry_2.mfgCode.IsNull()) { - auto & entry_3 = iter_newElement_1_ambientContextSensed_3.GetValue(); - jobject newElement_3; - jobject newElement_3_mfgCode; - if (entry_3.mfgCode.IsNull()) - { - newElement_3_mfgCode = nullptr; - } - else - { - std::string newElement_3_mfgCodeClassName = "java/lang/Integer"; - std::string newElement_3_mfgCodeCtorSignature = "(I)V"; - jint jninewElement_3_mfgCode = static_cast(entry_3.mfgCode.Value()); - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_3_mfgCodeClassName.c_str(), newElement_3_mfgCodeCtorSignature.c_str(), - jninewElement_3_mfgCode, newElement_3_mfgCode); - } - jobject newElement_3_namespaceID; - std::string newElement_3_namespaceIDClassName = "java/lang/Integer"; - std::string newElement_3_namespaceIDCtorSignature = "(I)V"; - jint jninewElement_3_namespaceID = static_cast(entry_3.namespaceID); - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_3_namespaceIDClassName.c_str(), newElement_3_namespaceIDCtorSignature.c_str(), - jninewElement_3_namespaceID, newElement_3_namespaceID); - jobject newElement_3_tag; - std::string newElement_3_tagClassName = "java/lang/Integer"; - std::string newElement_3_tagCtorSignature = "(I)V"; - jint jninewElement_3_tag = static_cast(entry_3.tag); + newElement_2_mfgCode = nullptr; + } + else + { + std::string newElement_2_mfgCodeClassName = "java/lang/Integer"; + std::string newElement_2_mfgCodeCtorSignature = "(I)V"; + jint jninewElement_2_mfgCode = static_cast(entry_2.mfgCode.Value()); TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_3_tagClassName.c_str(), newElement_3_tagCtorSignature.c_str(), jninewElement_3_tag, - newElement_3_tag); - jobject newElement_3_label; - if (!entry_3.label.HasValue()) - { - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_3_label); - } - else - { - jobject newElement_3_labelInsideOptional; - if (entry_3.label.Value().IsNull()) - { - newElement_3_labelInsideOptional = nullptr; - } - else - { - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF( - entry_3.label.Value().Value(), newElement_3_labelInsideOptional)); - } - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional( - newElement_3_labelInsideOptional, newElement_3_label); - } - - { - jclass semanticTagStructStructClass_4; - err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AmbientContextSensingClusterSemanticTagStruct", - semanticTagStructStructClass_4); - if (err != CHIP_NO_ERROR) - { - ChipLogError(Zcl, "Could not find class ChipStructs$AmbientContextSensingClusterSemanticTagStruct"); - return nullptr; - } - - jmethodID semanticTagStructStructCtor_4; - err = chip::JniReferences::GetInstance().FindMethod( - env, semanticTagStructStructClass_4, "", - "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", - &semanticTagStructStructCtor_4); - if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_4 == nullptr) - { - ChipLogError( - Zcl, "Could not find ChipStructs$AmbientContextSensingClusterSemanticTagStruct constructor"); - return nullptr; - } - - newElement_3 = - env->NewObject(semanticTagStructStructClass_4, semanticTagStructStructCtor_4, newElement_3_mfgCode, - newElement_3_namespaceID, newElement_3_tag, newElement_3_label); - } - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().AddToList(newElement_1_ambientContextSensed, - newElement_3); + newElement_2_mfgCodeClassName.c_str(), newElement_2_mfgCodeCtorSignature.c_str(), + jninewElement_2_mfgCode, newElement_2_mfgCode); } - jobject newElement_1_detectionStartTime; - if (!entry_1.detectionStartTime.HasValue()) + jobject newElement_2_namespaceID; + std::string newElement_2_namespaceIDClassName = "java/lang/Integer"; + std::string newElement_2_namespaceIDCtorSignature = "(I)V"; + jint jninewElement_2_namespaceID = static_cast(entry_2.namespaceID); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_namespaceIDClassName.c_str(), newElement_2_namespaceIDCtorSignature.c_str(), + jninewElement_2_namespaceID, newElement_2_namespaceID); + jobject newElement_2_tag; + std::string newElement_2_tagClassName = "java/lang/Integer"; + std::string newElement_2_tagCtorSignature = "(I)V"; + jint jninewElement_2_tag = static_cast(entry_2.tag); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_2_tagClassName.c_str(), newElement_2_tagCtorSignature.c_str(), jninewElement_2_tag, + newElement_2_tag); + jobject newElement_2_label; + if (!entry_2.label.HasValue()) { - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, - newElement_1_detectionStartTime); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_2_label); } else { - jobject newElement_1_detectionStartTimeInsideOptional; - std::string newElement_1_detectionStartTimeInsideOptionalClassName = "java/lang/Long"; - std::string newElement_1_detectionStartTimeInsideOptionalCtorSignature = "(J)V"; - jlong jninewElement_1_detectionStartTimeInsideOptional = - static_cast(entry_1.detectionStartTime.Value()); - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_1_detectionStartTimeInsideOptionalClassName.c_str(), - newElement_1_detectionStartTimeInsideOptionalCtorSignature.c_str(), - jninewElement_1_detectionStartTimeInsideOptional, newElement_1_detectionStartTimeInsideOptional); - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional( - newElement_1_detectionStartTimeInsideOptional, newElement_1_detectionStartTime); + jobject newElement_2_labelInsideOptional; + if (entry_2.label.Value().IsNull()) + { + newElement_2_labelInsideOptional = nullptr; + } + else + { + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_2.label.Value().Value(), + newElement_2_labelInsideOptional)); + } + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(newElement_2_labelInsideOptional, + newElement_2_label); } { - jclass ambientContextTypeStructStructClass_2; + jclass semanticTagStructStructClass_3; err = chip::JniReferences::GetInstance().GetLocalClassRef( - env, "chip/devicecontroller/ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct", - ambientContextTypeStructStructClass_2); + env, "chip/devicecontroller/ChipStructs$AmbientContextSensingClusterSemanticTagStruct", + semanticTagStructStructClass_3); if (err != CHIP_NO_ERROR) { - ChipLogError(Zcl, - "Could not find class ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct"); + ChipLogError(Zcl, "Could not find class ChipStructs$AmbientContextSensingClusterSemanticTagStruct"); return nullptr; } - jmethodID ambientContextTypeStructStructCtor_2; - err = chip::JniReferences::GetInstance().FindMethod(env, ambientContextTypeStructStructClass_2, "", - "(Ljava/util/ArrayList;Ljava/util/Optional;)V", - &ambientContextTypeStructStructCtor_2); - if (err != CHIP_NO_ERROR || ambientContextTypeStructStructCtor_2 == nullptr) + jmethodID semanticTagStructStructCtor_3; + err = chip::JniReferences::GetInstance().FindMethod( + env, semanticTagStructStructClass_3, "", + "(Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/util/Optional;)V", + &semanticTagStructStructCtor_3); + if (err != CHIP_NO_ERROR || semanticTagStructStructCtor_3 == nullptr) { - ChipLogError( - Zcl, "Could not find ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct constructor"); + ChipLogError(Zcl, + "Could not find ChipStructs$AmbientContextSensingClusterSemanticTagStruct constructor"); return nullptr; } - newElement_1 = env->NewObject(ambientContextTypeStructStructClass_2, ambientContextTypeStructStructCtor_2, - newElement_1_ambientContextSensed, newElement_1_detectionStartTime); + newElement_2 = + env->NewObject(semanticTagStructStructClass_3, semanticTagStructStructCtor_3, newElement_2_mfgCode, + newElement_2_namespaceID, newElement_2_tag, newElement_2_label); + } + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().AddToList( + value_ambientContextDetectedInsideOptional_ambientContextSensed, newElement_2); + } + jobject value_ambientContextDetectedInsideOptional_detectionStartTime; + if (!cppValue.ambientContextDetected.Value().detectionStartTime.HasValue()) + { + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional( + nullptr, value_ambientContextDetectedInsideOptional_detectionStartTime); + } + else + { + jobject value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptional; + std::string value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptionalClassName = + "java/lang/Long"; + std::string value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptionalCtorSignature = "(J)V"; + jlong jnivalue_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptional = + static_cast(cppValue.ambientContextDetected.Value().detectionStartTime.Value()); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptionalClassName.c_str(), + value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptionalCtorSignature.c_str(), + jnivalue_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptional, + value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptional); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional( + value_ambientContextDetectedInsideOptional_detectionStartTimeInsideOptional, + value_ambientContextDetectedInsideOptional_detectionStartTime); + } + + { + jclass ambientContextTypeStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct", + ambientContextTypeStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct"); + return nullptr; + } + + jmethodID ambientContextTypeStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, ambientContextTypeStructStructClass_1, "", + "(Ljava/util/ArrayList;Ljava/util/Optional;)V", + &ambientContextTypeStructStructCtor_1); + if (err != CHIP_NO_ERROR || ambientContextTypeStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, + "Could not find ChipStructs$AmbientContextSensingClusterAmbientContextTypeStruct constructor"); + return nullptr; } - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().AddToList(value_ambientContextTypeInsideOptional, - newElement_1); + + value_ambientContextDetectedInsideOptional = + env->NewObject(ambientContextTypeStructStructClass_1, ambientContextTypeStructStructCtor_1, + value_ambientContextDetectedInsideOptional_ambientContextSensed, + value_ambientContextDetectedInsideOptional_detectionStartTime); } - TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(value_ambientContextTypeInsideOptional, - value_ambientContextType); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional( + value_ambientContextDetectedInsideOptional, value_ambientContextDetected); + } + + jobject value_objectCountReached; + if (!cppValue.objectCountReached.HasValue()) + { + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(nullptr, value_objectCountReached); + } + else + { + jobject value_objectCountReachedInsideOptional; + std::string value_objectCountReachedInsideOptionalClassName = "java/lang/Boolean"; + std::string value_objectCountReachedInsideOptionalCtorSignature = "(Z)V"; + jboolean jnivalue_objectCountReachedInsideOptional = static_cast(cppValue.objectCountReached.Value()); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( + value_objectCountReachedInsideOptionalClassName.c_str(), + value_objectCountReachedInsideOptionalCtorSignature.c_str(), jnivalue_objectCountReachedInsideOptional, + value_objectCountReachedInsideOptional); + TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateOptional(value_objectCountReachedInsideOptional, + value_objectCountReached); } jobject value_objectCount; @@ -9120,7 +9135,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & jmethodID ambientContextDetectStartedStructCtor; err = chip::JniReferences::GetInstance().FindMethod(env, ambientContextDetectStartedStructClass, "", - "(Ljava/util/Optional;Ljava/util/Optional;)V", + "(Ljava/util/Optional;Ljava/util/Optional;Ljava/util/Optional;)V", &ambientContextDetectStartedStructCtor); if (err != CHIP_NO_ERROR || ambientContextDetectStartedStructCtor == nullptr) { @@ -9131,7 +9146,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jobject value = env->NewObject(ambientContextDetectStartedStructClass, ambientContextDetectStartedStructCtor, - value_ambientContextType, value_objectCount); + value_ambientContextDetected, value_objectCountReached, value_objectCount); return value; } @@ -9142,13 +9157,13 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & { return nullptr; } - jobject value_startEventNumber; - std::string value_startEventNumberClassName = "java/lang/Long"; - std::string value_startEventNumberCtorSignature = "(J)V"; - jlong jnivalue_startEventNumber = static_cast(cppValue.startEventNumber); + jobject value_eventStartTime; + std::string value_eventStartTimeClassName = "java/lang/Long"; + std::string value_eventStartTimeCtorSignature = "(J)V"; + jlong jnivalue_eventStartTime = static_cast(cppValue.eventStartTime); TEMPORARY_RETURN_IGNORED chip::JniReferences::GetInstance().CreateBoxedObject( - value_startEventNumberClassName.c_str(), value_startEventNumberCtorSignature.c_str(), jnivalue_startEventNumber, - value_startEventNumber); + value_eventStartTimeClassName.c_str(), value_eventStartTimeCtorSignature.c_str(), jnivalue_eventStartTime, + value_eventStartTime); jclass ambientContextDetectEndedStructClass; err = chip::JniReferences::GetInstance().GetLocalClassRef( @@ -9172,7 +9187,7 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } jobject value = - env->NewObject(ambientContextDetectEndedStructClass, ambientContextDetectEndedStructCtor, value_startEventNumber); + env->NewObject(ambientContextDetectEndedStructClass, ambientContextDetectEndedStructCtor, value_eventStartTime); return value; } diff --git a/src/controller/python/matter/clusters/CHIPClusters.py b/src/controller/python/matter/clusters/CHIPClusters.py index ea4ed75a8f6..12430dfd632 100644 --- a/src/controller/python/matter/clusters/CHIPClusters.py +++ b/src/controller/python/matter/clusters/CHIPClusters.py @@ -1071,6 +1071,13 @@ class ChipClusters: "type": "int", "reportable": True, }, + 0x00000017: { + "attributeName": "DeviceLocation", + "attributeId": 0x00000017, + "type": "", + "reportable": True, + "writable": True, + }, 0x00000018: { "attributeName": "ConfigurationVersion", "attributeId": 0x00000018, diff --git a/src/controller/python/matter/clusters/ClusterObjects.py b/src/controller/python/matter/clusters/ClusterObjects.py index ec09a8fe8de..a8a7ab33698 100644 --- a/src/controller/python/matter/clusters/ClusterObjects.py +++ b/src/controller/python/matter/clusters/ClusterObjects.py @@ -210,7 +210,7 @@ def FromTLV(cls, data: bytes): @ChipUtility.classproperty def descriptor(cls): - raise NotImplementedError() + raise NotImplementedError # The below dictionaries will be filled dynamically @@ -243,15 +243,15 @@ def __init_subclass__(cls, *args, **kwargs) -> None: @ChipUtility.classproperty def cluster_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def command_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def is_client(self) -> bool: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def must_use_timed_invoke(cls) -> bool: @@ -334,15 +334,15 @@ def FromTagDictOrRawValue(cls, val: Any): @ChipUtility.classproperty def cluster_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def attribute_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def must_use_timed_write(cls) -> bool: @@ -382,8 +382,8 @@ def __init_subclass__(cls, *args, **kwargs) -> None: @ChipUtility.classproperty def cluster_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError @ChipUtility.classproperty def event_id(self) -> int: - raise NotImplementedError() + raise NotImplementedError diff --git a/src/controller/python/matter/clusters/Objects.py b/src/controller/python/matter/clusters/Objects.py index dc0ca0b2643..f8f15f76753 100644 --- a/src/controller/python/matter/clusters/Objects.py +++ b/src/controller/python/matter/clusters/Objects.py @@ -3727,6 +3727,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="productAppearance", Tag=0x00000014, Type=typing.Optional[BasicInformation.Structs.ProductAppearanceStruct]), ClusterObjectFieldDescriptor(Label="specificationVersion", Tag=0x00000015, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="maxPathsPerInvoke", Tag=0x00000016, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="deviceLocation", Tag=0x00000017, Type=typing.Union[None, Nullable, Globals.Structs.LocationDescriptorStruct]), ClusterObjectFieldDescriptor(Label="configurationVersion", Tag=0x00000018, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), @@ -3758,6 +3759,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: productAppearance: typing.Optional[BasicInformation.Structs.ProductAppearanceStruct] = None specificationVersion: typing.Optional[uint] = None maxPathsPerInvoke: typing.Optional[uint] = None + deviceLocation: typing.Union[None, Nullable, Globals.Structs.LocationDescriptorStruct] = None configurationVersion: typing.Optional[uint] = None generatedCommandList: typing.List[uint] = field(default_factory=lambda: []) acceptedCommandList: typing.List[uint] = field(default_factory=lambda: []) @@ -4225,6 +4227,22 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: typing.Optional[uint] = None + @dataclass + class DeviceLocation(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000028 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000017 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.Union[None, Nullable, Globals.Structs.LocationDescriptorStruct]) + + value: typing.Union[None, Nullable, Globals.Structs.LocationDescriptorStruct] = None + @dataclass class ConfigurationVersion(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -42516,11 +42534,13 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="ambientContextType", Tag=0, Type=typing.Optional[typing.List[AmbientContextSensing.Structs.AmbientContextTypeStruct]]), - ClusterObjectFieldDescriptor(Label="objectCount", Tag=1, Type=typing.Optional[uint]), + ClusterObjectFieldDescriptor(Label="ambientContextDetected", Tag=0, Type=typing.Optional[AmbientContextSensing.Structs.AmbientContextTypeStruct]), + ClusterObjectFieldDescriptor(Label="objectCountReached", Tag=1, Type=typing.Optional[bool]), + ClusterObjectFieldDescriptor(Label="objectCount", Tag=2, Type=typing.Optional[uint]), ]) - ambientContextType: typing.Optional[typing.List[AmbientContextSensing.Structs.AmbientContextTypeStruct]] = None + ambientContextDetected: typing.Optional[AmbientContextSensing.Structs.AmbientContextTypeStruct] = None + objectCountReached: typing.Optional[bool] = None objectCount: typing.Optional[uint] = None @dataclass @@ -42537,10 +42557,10 @@ def event_id(cls) -> int: def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="startEventNumber", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="eventStartTime", Tag=0, Type=uint), ]) - startEventNumber: uint = 0 + eventStartTime: uint = 0 @dataclass diff --git a/src/controller/python/matter/commissioning/__init__.py b/src/controller/python/matter/commissioning/__init__.py index 15cbf33a770..f11496fba43 100644 --- a/src/controller/python/matter/commissioning/__init__.py +++ b/src/controller/python/matter/commissioning/__init__.py @@ -139,7 +139,7 @@ async def get_commissionee_nonces(self) -> Tuple[bytes, bytes]: async def get_commissionee_credentials(self, request: GetCommissioneeCredentialsRequest) -> GetCommissioneeCredentialsResponse: ''' Returns certifications and infomations for the commissioning. ''' - raise NotImplementedError() + raise NotImplementedError class ExampleCredentialProvider: diff --git a/src/controller/python/matter/crypto/p256keypair.py b/src/controller/python/matter/crypto/p256keypair.py index 3e4d46ef0a3..9b4652764fb 100644 --- a/src/controller/python/matter/crypto/p256keypair.py +++ b/src/controller/python/matter/crypto/p256keypair.py @@ -120,11 +120,11 @@ def public_key(self) -> bytes: For P256Keypair, the output length should be exactly 65 bytes. ''' - raise NotImplementedError() + raise NotImplementedError @abc.abstractmethod def ECDSA_sign_msg(self, message: bytes) -> bytes: - raise NotImplementedError() + raise NotImplementedError @abc.abstractmethod def ECDH_derive_secret(self, remote_pubkey: bytes) -> bytes: @@ -133,7 +133,7 @@ def ECDH_derive_secret(self, remote_pubkey: bytes) -> bytes: remote_pubkey will be a public key conforms with the uncompressed format of section 2.3.3 of the SECG SEC 1 standard. ''' - raise NotImplementedError() + raise NotImplementedError class TestP256Keypair(P256Keypair): diff --git a/src/controller/python/tests/scripts/cluster_objects.py b/src/controller/python/tests/scripts/cluster_objects.py index acbc660554d..599dbd79583 100644 --- a/src/controller/python/tests/scripts/cluster_objects.py +++ b/src/controller/python/tests/scripts/cluster_objects.py @@ -84,15 +84,15 @@ class ClusterObjectTests: @base.test_case def TestAPI(cls): if Clusters.OnOff.id != 6: - raise ValueError() + raise ValueError if Clusters.OnOff.Commands.Off.command_id != 0: - raise ValueError() + raise ValueError if Clusters.OnOff.Commands.Off.cluster_id != 6: - raise ValueError() + raise ValueError if Clusters.OnOff.Commands.On.command_id != 1: - raise ValueError() + raise ValueError if Clusters.OnOff.Commands.On.cluster_id != 6: - raise ValueError() + raise ValueError @classmethod @base.test_case @@ -102,7 +102,7 @@ async def TestCommandRoundTrip(cls, devCtrl): if res is not None: logger.error( f"Got {res} Response from server, but None is expected.") - raise ValueError() + raise ValueError @classmethod @base.test_case @@ -122,10 +122,10 @@ async def TestCommandWithResponse(cls, devCtrl): res = await devCtrl.SendCommand(nodeId=NODE_ID, endpoint=LIGHTING_ENDPOINT_ID, payload=req) if not isinstance(res, Clusters.UnitTesting.Commands.TestAddArgumentsResponse): logger.error(f"Unexpected response of type {type(res)} received.") - raise ValueError() + raise ValueError logger.info(f"Received response: {res}") if res.returnValue != 5: - raise ValueError() + raise ValueError @classmethod @base.test_case diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index a96c82a231c..75c53e5ae12 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -441,6 +441,9 @@ static BOOL AttributeIsSpecifiedInBasicInformationCluster(AttributeId aAttribute case Attributes::MaxPathsPerInvoke::Id: { return YES; } + case Attributes::DeviceLocation::Id: { + return YES; + } case Attributes::ConfigurationVersion::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 59add512e84..64c77dd503d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -1536,6 +1536,37 @@ static id _Nullable DecodeAttributeValueForBasicInformationCluster(AttributeId a value = [NSNumber numberWithUnsignedShort:cppValue]; return value; } + case Attributes::DeviceLocation::Id: { + using TypeInfo = Attributes::DeviceLocation::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + MTRDataTypeLocationDescriptorStruct * _Nullable value; + if (cppValue.IsNull()) { + value = nil; + } else { + value = [MTRDataTypeLocationDescriptorStruct new]; + value.locationName = AsString(cppValue.Value().locationName); + if (value.locationName == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + if (cppValue.Value().floorNumber.IsNull()) { + value.floorNumber = nil; + } else { + value.floorNumber = [NSNumber numberWithShort:cppValue.Value().floorNumber.Value()]; + } + if (cppValue.Value().areaType.IsNull()) { + value.areaType = nil; + } else { + value.areaType = [NSNumber numberWithUnsignedChar:chip::to_underlying(cppValue.Value().areaType.Value())]; + } + } + return value; + } case Attributes::ConfigurationVersion::Id: { using TypeInfo = Attributes::ConfigurationVersion::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index f5bca931927..ddf8d5ce28a 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -1174,6 +1174,14 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); + (void)readAttributeMaxPathsPerInvokeWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); +- (void)readAttributeDeviceLocationWithCompletion:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDeviceLocationWithValue:(MTRDataTypeLocationDescriptorStruct * _Nullable)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDeviceLocationWithValue:(MTRDataTypeLocationDescriptorStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeDeviceLocationWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeDeviceLocationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + - (void)readAttributeConfigurationVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeConfigurationVersionWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 343140d9de8..2a55d47e5c6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -8611,6 +8611,87 @@ + (void)readAttributeMaxPathsPerInvokeWithClusterStateCache:(MTRClusterStateCach completion:completion]; } +- (void)readAttributeDeviceLocationWithCompletion:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = BasicInformation::Attributes::DeviceLocation::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeDeviceLocationWithValue:(MTRDataTypeLocationDescriptorStruct * _Nullable)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeDeviceLocationWithValue:(MTRDataTypeLocationDescriptorStruct * _Nullable) value params:nil completion:completion]; +} +- (void)writeAttributeDeviceLocationWithValue:(MTRDataTypeLocationDescriptorStruct * _Nullable)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + // Make a copy of params before we go async. + params = [params copy]; + value = [value copy]; + + auto * bridge = new MTRDefaultSuccessCallbackBridge(self.callbackQueue, ^(id _Nullable ignored, NSError * _Nullable error) { completion(error); }, ^(ExchangeManager & exchangeManager, const SessionHandle & session, DefaultSuccessCallbackType successCb, MTRErrorCallback failureCb, MTRCallbackBridgeBase * bridge) { + chip::Optional timedWriteTimeout; + if (params != nil) { + if (params.timedWriteTimeout != nil){ + timedWriteTimeout.SetValue(params.timedWriteTimeout.unsignedShortValue); + } + } + + ListFreer listFreer; + using TypeInfo = BasicInformation::Attributes::DeviceLocation::TypeInfo; + TypeInfo::Type cppValue; + if (value == nil) { + cppValue.SetNull(); + } else { + auto & nonNullValue_0 = cppValue.SetNonNull(); + nonNullValue_0.locationName = AsCharSpan(value.locationName); + if (value.floorNumber == nil) { + nonNullValue_0.floorNumber.SetNull(); + } else { + auto & nonNullValue_2 = nonNullValue_0.floorNumber.SetNonNull(); + nonNullValue_2 = value.floorNumber.shortValue; + } + if (value.areaType == nil) { + nonNullValue_0.areaType.SetNull(); + } else { + auto & nonNullValue_2 = nonNullValue_0.areaType.SetNonNull(); + nonNullValue_2 = static_cast>(value.areaType.unsignedCharValue); + } + } + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeDeviceLocationWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = BasicInformation::Attributes::DeviceLocation::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeDeviceLocationWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = BasicInformation::Attributes::DeviceLocation::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + - (void)readAttributeConfigurationVersionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = BasicInformation::Attributes::ConfigurationVersion::TypeInfo; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 14a808dc4f4..59d9502b86d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -620,6 +620,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterBasicInformationAttributeProductAppearanceID MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x00000014, MTRAttributeIDTypeClusterBasicInformationAttributeSpecificationVersionID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000015, MTRAttributeIDTypeClusterBasicInformationAttributeMaxPathsPerInvokeID MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) = 0x00000016, + MTRAttributeIDTypeClusterBasicInformationAttributeDeviceLocationID MTR_PROVISIONALLY_AVAILABLE = 0x00000017, MTRAttributeIDTypeClusterBasicInformationAttributeConfigurationVersionID MTR_PROVISIONALLY_AVAILABLE = 0x00000018, MTRAttributeIDTypeClusterBasicInformationAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterBasicInformationAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index f00cc9bba6d..3b211181f4b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -1006,6 +1006,10 @@ result = @"MaxPathsPerInvoke"; break; + case MTRAttributeIDTypeClusterBasicInformationAttributeDeviceLocationID: + result = @"DeviceLocation"; + break; + case MTRAttributeIDTypeClusterBasicInformationAttributeConfigurationVersionID: result = @"ConfigurationVersion"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 2eccd572ddf..e738b894dd6 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -553,6 +553,10 @@ MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) - (NSDictionary * _Nullable)readAttributeMaxPathsPerInvokeWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)); +- (NSDictionary * _Nullable)readAttributeDeviceLocationWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDeviceLocationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeDeviceLocationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + - (NSDictionary * _Nullable)readAttributeConfigurationVersionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index a54aa408171..d0d630f4884 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -2124,6 +2124,22 @@ - (void)writeAttributeLocalConfigDisabledWithValue:(NSDictionary return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeMaxPathsPerInvokeID) params:params]; } +- (NSDictionary * _Nullable)readAttributeDeviceLocationWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeDeviceLocationID) params:params]; +} + +- (void)writeAttributeDeviceLocationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeDeviceLocationWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeDeviceLocationWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeDeviceLocationID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + - (NSDictionary * _Nullable)readAttributeConfigurationVersionWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeBasicInformationID) attributeID:@(MTRAttributeIDTypeClusterBasicInformationAttributeConfigurationVersionID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 739b3f376cf..e5aa3d689d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4815,70 +4815,64 @@ static id _Nullable DecodeEventPayloadForAmbientContextSensingCluster(EventId aE __auto_type * value = [MTRAmbientContextSensingClusterAmbientContextDetectStartedEvent new]; do { - NSArray * _Nullable memberValue; - if (cppValue.ambientContextType.HasValue()) { + MTRAmbientContextSensingClusterAmbientContextTypeStruct * _Nullable memberValue; + if (cppValue.ambientContextDetected.HasValue()) { + memberValue = [MTRAmbientContextSensingClusterAmbientContextTypeStruct new]; { // Scope for our temporary variables - auto * array_1 = [NSMutableArray new]; - auto iter_1 = cppValue.ambientContextType.Value().begin(); - while (iter_1.Next()) { - auto & entry_1 = iter_1.GetValue(); - MTRAmbientContextSensingClusterAmbientContextTypeStruct * newElement_1; - newElement_1 = [MTRAmbientContextSensingClusterAmbientContextTypeStruct new]; - { // Scope for our temporary variables - auto * array_3 = [NSMutableArray new]; - auto iter_3 = entry_1.ambientContextSensed.begin(); - while (iter_3.Next()) { - auto & entry_3 = iter_3.GetValue(); - MTRDataTypeSemanticTagStruct * newElement_3; - newElement_3 = [MTRDataTypeSemanticTagStruct new]; - if (entry_3.mfgCode.IsNull()) { - newElement_3.mfgCode = nil; - } else { - newElement_3.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_3.mfgCode.Value())]; - } - newElement_3.namespaceID = [NSNumber numberWithUnsignedChar:entry_3.namespaceID]; - newElement_3.tag = [NSNumber numberWithUnsignedChar:entry_3.tag]; - if (entry_3.label.HasValue()) { - if (entry_3.label.Value().IsNull()) { - newElement_3.label = nil; - } else { - newElement_3.label = AsString(entry_3.label.Value().Value()); - if (newElement_3.label == nil) { - CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; - *aError = err; - return nil; - } - } - } else { - newElement_3.label = nil; + auto * array_2 = [NSMutableArray new]; + auto iter_2 = cppValue.ambientContextDetected.Value().ambientContextSensed.begin(); + while (iter_2.Next()) { + auto & entry_2 = iter_2.GetValue(); + MTRDataTypeSemanticTagStruct * newElement_2; + newElement_2 = [MTRDataTypeSemanticTagStruct new]; + if (entry_2.mfgCode.IsNull()) { + newElement_2.mfgCode = nil; + } else { + newElement_2.mfgCode = [NSNumber numberWithUnsignedShort:chip::to_underlying(entry_2.mfgCode.Value())]; + } + newElement_2.namespaceID = [NSNumber numberWithUnsignedChar:entry_2.namespaceID]; + newElement_2.tag = [NSNumber numberWithUnsignedChar:entry_2.tag]; + if (entry_2.label.HasValue()) { + if (entry_2.label.Value().IsNull()) { + newElement_2.label = nil; + } else { + newElement_2.label = AsString(entry_2.label.Value().Value()); + if (newElement_2.label == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; } - [array_3 addObject:newElement_3]; - } - CHIP_ERROR err = iter_3.GetStatus(); - if (err != CHIP_NO_ERROR) { - *aError = err; - return nil; } - newElement_1.ambientContextSensed = array_3; - } - if (entry_1.detectionStartTime.HasValue()) { - newElement_1.detectionStartTime = [NSNumber numberWithUnsignedInt:entry_1.detectionStartTime.Value()]; } else { - newElement_1.detectionStartTime = nil; + newElement_2.label = nil; } - [array_1 addObject:newElement_1]; + [array_2 addObject:newElement_2]; } - CHIP_ERROR err = iter_1.GetStatus(); + CHIP_ERROR err = iter_2.GetStatus(); if (err != CHIP_NO_ERROR) { *aError = err; return nil; } - memberValue = array_1; + memberValue.ambientContextSensed = array_2; + } + if (cppValue.ambientContextDetected.Value().detectionStartTime.HasValue()) { + memberValue.detectionStartTime = [NSNumber numberWithUnsignedInt:cppValue.ambientContextDetected.Value().detectionStartTime.Value()]; + } else { + memberValue.detectionStartTime = nil; } } else { memberValue = nil; } - value.ambientContextType = memberValue; + value.ambientContextDetected = memberValue; + } while (0); + do { + NSNumber * _Nullable memberValue; + if (cppValue.objectCountReached.HasValue()) { + memberValue = [NSNumber numberWithBool:cppValue.objectCountReached.Value()]; + } else { + memberValue = nil; + } + value.objectCountReached = memberValue; } while (0); do { NSNumber * _Nullable memberValue; @@ -4903,8 +4897,8 @@ static id _Nullable DecodeEventPayloadForAmbientContextSensingCluster(EventId aE do { NSNumber * _Nonnull memberValue; - memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.startEventNumber]; - value.startEventNumber = memberValue; + memberValue = [NSNumber numberWithUnsignedLongLong:cppValue.eventStartTime]; + value.eventStartTime = memberValue; } while (0); return value; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index d91dabb1027..e1762aebf8c 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2036,13 +2036,14 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRAmbientContextSensingClusterAmbientContextDetectStartedEvent : NSObject -@property (nonatomic, copy) NSArray * _Nullable ambientContextType MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) MTRAmbientContextSensingClusterAmbientContextTypeStruct * _Nullable ambientContextDetected MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nullable objectCountReached MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSNumber * _Nullable objectCount MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE @interface MTRAmbientContextSensingClusterAmbientContextDetectEndedEvent : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull startEventNumber MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull eventStartTime MTR_PROVISIONALLY_AVAILABLE; @end MTR_AVAILABLE(ios(18.4), macos(15.4), watchos(11.4), tvos(18.4)) diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index a6fb89675e8..32395f6c918 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8738,7 +8738,9 @@ - (instancetype)init { if (self = [super init]) { - _ambientContextType = nil; + _ambientContextDetected = nil; + + _objectCountReached = nil; _objectCount = nil; } @@ -8749,7 +8751,8 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTRAmbientContextSensingClusterAmbientContextDetectStartedEvent alloc] init]; - other.ambientContextType = self.ambientContextType; + other.ambientContextDetected = self.ambientContextDetected; + other.objectCountReached = self.objectCountReached; other.objectCount = self.objectCount; return other; @@ -8757,7 +8760,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: ambientContextType:%@; objectCount:%@; >", NSStringFromClass([self class]), _ambientContextType, _objectCount]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: ambientContextDetected:%@; objectCountReached:%@; objectCount:%@; >", NSStringFromClass([self class]), _ambientContextDetected, _objectCountReached, _objectCount]; return descriptionString; } @@ -8768,7 +8771,7 @@ - (instancetype)init { if (self = [super init]) { - _startEventNumber = @(0); + _eventStartTime = @(0); } return self; } @@ -8777,14 +8780,14 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTRAmbientContextSensingClusterAmbientContextDetectEndedEvent alloc] init]; - other.startEventNumber = self.startEventNumber; + other.eventStartTime = self.eventStartTime; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: startEventNumber:%@; >", NSStringFromClass([self class]), _startEventNumber]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: eventStartTime:%@; >", NSStringFromClass([self class]), _eventStartTime]; return descriptionString; } diff --git a/src/platform/Linux/ConnectivityManagerImpl.h b/src/platform/Linux/ConnectivityManagerImpl.h index 17852670714..be11a2f5bc7 100644 --- a/src/platform/Linux/ConnectivityManagerImpl.h +++ b/src/platform/Linux/ConnectivityManagerImpl.h @@ -323,28 +323,5 @@ class ConnectivityManagerImpl final : public ConnectivityManager, NetworkStatusChangeCallback * mpStatusChangeCallback; }; -#if CHIP_DEVICE_CONFIG_ENABLE_WPA -inline ConnectivityManager::WiFiAPMode ConnectivityManagerImpl::_GetWiFiAPMode() -{ - return mWiFiAPMode; -} - -inline bool ConnectivityManagerImpl::_IsWiFiAPActive() -{ - return mWiFiAPState == kWiFiAPState_Active; -} - -inline bool ConnectivityManagerImpl::_IsWiFiAPApplicationControlled() -{ - return mWiFiAPMode == kWiFiAPMode_ApplicationControlled; -} - -inline System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiAPIdleTimeout() -{ - return mWiFiAPIdleTimeout; -} - -#endif - } // namespace DeviceLayer } // namespace chip diff --git a/src/platform/Linux/ConnectivityManagerImpl_NetworkManagementWpaSupplicant.cpp b/src/platform/Linux/ConnectivityManagerImpl_NetworkManagementWpaSupplicant.cpp index 7fcf2ba9b58..b479fdaf7c4 100644 --- a/src/platform/Linux/ConnectivityManagerImpl_NetworkManagementWpaSupplicant.cpp +++ b/src/platform/Linux/ConnectivityManagerImpl_NetworkManagementWpaSupplicant.cpp @@ -172,6 +172,26 @@ void ConnectivityManagerImpl::_ClearWiFiStationProvision() } } +bool ConnectivityManagerImpl::_IsWiFiAPActive() +{ + return mWiFiAPState == kWiFiAPState_Active; +} + +bool ConnectivityManagerImpl::_IsWiFiAPApplicationControlled() +{ + return mWiFiAPMode == kWiFiAPMode_ApplicationControlled; +} + +System::Clock::Timeout ConnectivityManagerImpl::_GetWiFiAPIdleTimeout() +{ + return mWiFiAPIdleTimeout; +} + +ConnectivityManager::WiFiAPMode ConnectivityManagerImpl::_GetWiFiAPMode() +{ + return mWiFiAPMode; +} + CHIP_ERROR ConnectivityManagerImpl::_SetWiFiAPMode(WiFiAPMode val) { CHIP_ERROR err = CHIP_NO_ERROR; diff --git a/third_party/amazon-kinesis-video-streams-webrtc-sdk-c/repo b/third_party/amazon-kinesis-video-streams-webrtc-sdk-c/repo index 057047ed6ef..beb520b9652 160000 --- a/third_party/amazon-kinesis-video-streams-webrtc-sdk-c/repo +++ b/third_party/amazon-kinesis-video-streams-webrtc-sdk-c/repo @@ -1 +1 @@ -Subproject commit 057047ed6efe9320e7056f4f4b708b9b8934d51d +Subproject commit beb520b965251e7797d509f1c4f79be1913e7bcc diff --git a/third_party/libwebsockets/repo b/third_party/libwebsockets/repo index 6e09203d371..4926031623d 160000 --- a/third_party/libwebsockets/repo +++ b/third_party/libwebsockets/repo @@ -1 +1 @@ -Subproject commit 6e09203d37167428c87e90ac65dff1bc5075b441 +Subproject commit 4926031623deb4aeb09c189e034da5f0d06b9bf9 diff --git a/third_party/openthread/repo b/third_party/openthread/repo index 3fec404effd..0d4a43ab8d4 160000 --- a/third_party/openthread/repo +++ b/third_party/openthread/repo @@ -1 +1 @@ -Subproject commit 3fec404effd231648f018b2ecab0f7d5611c84d9 +Subproject commit 0d4a43ab8d4147f8c7215b561187478a9419ae82 diff --git a/third_party/ot-br-posix/repo b/third_party/ot-br-posix/repo index ccb0e14f4e7..43f2a88b71a 160000 --- a/third_party/ot-br-posix/repo +++ b/third_party/ot-br-posix/repo @@ -1 +1 @@ -Subproject commit ccb0e14f4e7db5de1f7b74915336ffbca68007e2 +Subproject commit 43f2a88b71aa26614cd090769333091d9b9e9744 diff --git a/third_party/pigweed/repo b/third_party/pigweed/repo index 3cd31cbba67..c119d2065b4 160000 --- a/third_party/pigweed/repo +++ b/third_party/pigweed/repo @@ -1 +1 @@ -Subproject commit 3cd31cbba67cb24a0701e44bb7aba11e67aa0257 +Subproject commit c119d2065b42b0ec4c0a0dcba490b4e1bda0e3d8 diff --git a/zzz_generated/app-common/clusters/AmbientContextSensing/Events.h b/zzz_generated/app-common/clusters/AmbientContextSensing/Events.h index ac0dfbd129c..ea6b53c0b65 100644 --- a/zzz_generated/app-common/clusters/AmbientContextSensing/Events.h +++ b/zzz_generated/app-common/clusters/AmbientContextSensing/Events.h @@ -48,8 +48,9 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kAmbientContextType = 0, - kObjectCount = 1, + kAmbientContextDetected = 0, + kObjectCountReached = 1, + kObjectCount = 2, }; struct Type @@ -60,7 +61,8 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::AmbientContextSensing::Id; } static constexpr bool kIsFabricScoped = false; - Optional> ambientContextType; + Optional ambientContextDetected; + Optional objectCountReached; Optional objectCount; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -73,7 +75,8 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::AmbientContextDetectStarted::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AmbientContextSensing::Id; } - Optional> ambientContextType; + Optional ambientContextDetected; + Optional objectCountReached; Optional objectCount; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -84,7 +87,7 @@ static constexpr PriorityLevel kPriorityLevel = PriorityLevel::Info; enum class Fields : uint8_t { - kStartEventNumber = 0, + kEventStartTime = 0, }; struct Type @@ -95,7 +98,7 @@ struct Type static constexpr ClusterId GetClusterId() { return Clusters::AmbientContextSensing::Id; } static constexpr bool kIsFabricScoped = false; - chip::EventNumber startEventNumber = static_cast(0); + uint64_t eventStartTime = static_cast(0); CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; }; @@ -107,7 +110,7 @@ struct DecodableType static constexpr EventId GetEventId() { return Events::AmbientContextDetectEnded::Id; } static constexpr ClusterId GetClusterId() { return Clusters::AmbientContextSensing::Id; } - chip::EventNumber startEventNumber = static_cast(0); + uint64_t eventStartTime = static_cast(0); CHIP_ERROR Decode(TLV::TLVReader & reader); }; diff --git a/zzz_generated/app-common/clusters/AmbientContextSensing/Events.ipp b/zzz_generated/app-common/clusters/AmbientContextSensing/Events.ipp index 1e45f84fb33..433977e9d69 100644 --- a/zzz_generated/app-common/clusters/AmbientContextSensing/Events.ipp +++ b/zzz_generated/app-common/clusters/AmbientContextSensing/Events.ipp @@ -35,7 +35,8 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { TLV::TLVType outer; ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAmbientContextType), ambientContextType)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kAmbientContextDetected), ambientContextDetected)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kObjectCountReached), objectCountReached)); ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kObjectCount), objectCount)); return aWriter.EndContainer(outer); } @@ -50,9 +51,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); ReturnErrorOnFailure(err); - if (__context_tag == to_underlying(Fields::kAmbientContextType)) + if (__context_tag == to_underlying(Fields::kAmbientContextDetected)) { - err = DataModel::Decode(reader, ambientContextType); + err = DataModel::Decode(reader, ambientContextDetected); + } + else if (__context_tag == to_underlying(Fields::kObjectCountReached)) + { + err = DataModel::Decode(reader, objectCountReached); } else if (__context_tag == to_underlying(Fields::kObjectCount)) { @@ -71,7 +76,7 @@ CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { TLV::TLVType outer; ReturnErrorOnFailure(aWriter.StartContainer(aTag, TLV::kTLVType_Structure, outer)); - ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kStartEventNumber), startEventNumber)); + ReturnErrorOnFailure(DataModel::Encode(aWriter, TLV::ContextTag(Fields::kEventStartTime), eventStartTime)); return aWriter.EndContainer(outer); } @@ -85,9 +90,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) VerifyOrReturnError(err != CHIP_ERROR_END_OF_TLV, CHIP_NO_ERROR); ReturnErrorOnFailure(err); - if (__context_tag == to_underlying(Fields::kStartEventNumber)) + if (__context_tag == to_underlying(Fields::kEventStartTime)) { - err = DataModel::Decode(reader, startEventNumber); + err = DataModel::Decode(reader, eventStartTime); } else { diff --git a/zzz_generated/app-common/clusters/BasicInformation/AttributeIds.h b/zzz_generated/app-common/clusters/BasicInformation/AttributeIds.h index 893a43512f1..5c1c7a44357 100644 --- a/zzz_generated/app-common/clusters/BasicInformation/AttributeIds.h +++ b/zzz_generated/app-common/clusters/BasicInformation/AttributeIds.h @@ -14,7 +14,7 @@ namespace BasicInformation { namespace Attributes { // Total number of attributes supported by the cluster, including global attributes -inline constexpr uint32_t kAttributesCount = 29; +inline constexpr uint32_t kAttributesCount = 30; namespace DataModelRevision { inline constexpr AttributeId Id = 0x00000000; @@ -108,6 +108,10 @@ namespace MaxPathsPerInvoke { inline constexpr AttributeId Id = 0x00000016; } // namespace MaxPathsPerInvoke +namespace DeviceLocation { +inline constexpr AttributeId Id = 0x00000017; +} // namespace DeviceLocation + namespace ConfigurationVersion { inline constexpr AttributeId Id = 0x00000018; } // namespace ConfigurationVersion diff --git a/zzz_generated/app-common/clusters/BasicInformation/Attributes.h b/zzz_generated/app-common/clusters/BasicInformation/Attributes.h index 9defff56fe9..511cfd6a20a 100644 --- a/zzz_generated/app-common/clusters/BasicInformation/Attributes.h +++ b/zzz_generated/app-common/clusters/BasicInformation/Attributes.h @@ -331,6 +331,20 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace MaxPathsPerInvoke +namespace DeviceLocation { +struct TypeInfo +{ + using Type = chip::app::DataModel::Nullable; + using DecodableType = + chip::app::DataModel::Nullable; + using DecodableArgType = + const chip::app::DataModel::Nullable &; + + static constexpr ClusterId GetClusterId() { return Clusters::BasicInformation::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::DeviceLocation::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace DeviceLocation namespace ConfigurationVersion { struct TypeInfo { @@ -405,6 +419,7 @@ struct TypeInfo Attributes::ProductAppearance::TypeInfo::DecodableType productAppearance; Attributes::SpecificationVersion::TypeInfo::DecodableType specificationVersion = static_cast(0); Attributes::MaxPathsPerInvoke::TypeInfo::DecodableType maxPathsPerInvoke = static_cast(0); + Attributes::DeviceLocation::TypeInfo::DecodableType deviceLocation; Attributes::ConfigurationVersion::TypeInfo::DecodableType configurationVersion = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; diff --git a/zzz_generated/app-common/clusters/BasicInformation/Attributes.ipp b/zzz_generated/app-common/clusters/BasicInformation/Attributes.ipp index ca43b611358..7daafaa96dc 100644 --- a/zzz_generated/app-common/clusters/BasicInformation/Attributes.ipp +++ b/zzz_generated/app-common/clusters/BasicInformation/Attributes.ipp @@ -78,6 +78,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, specificationVersion); case Attributes::MaxPathsPerInvoke::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, maxPathsPerInvoke); + case Attributes::DeviceLocation::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, deviceLocation); case Attributes::ConfigurationVersion::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, configurationVersion); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): diff --git a/zzz_generated/app-common/clusters/BasicInformation/Metadata.h b/zzz_generated/app-common/clusters/BasicInformation/Metadata.h index 1b71d40a3f1..f56efbe6c67 100644 --- a/zzz_generated/app-common/clusters/BasicInformation/Metadata.h +++ b/zzz_generated/app-common/clusters/BasicInformation/Metadata.h @@ -113,6 +113,10 @@ namespace MaxPathsPerInvoke { inline constexpr DataModel::AttributeEntry kMetadataEntry(MaxPathsPerInvoke::Id, BitFlags(), Access::Privilege::kView, std::nullopt); } // namespace MaxPathsPerInvoke +namespace DeviceLocation { +inline constexpr DataModel::AttributeEntry kMetadataEntry(DeviceLocation::Id, BitFlags(), + Access::Privilege::kView, Access::Privilege::kAdminister); +} // namespace DeviceLocation namespace ConfigurationVersion { inline constexpr DataModel::AttributeEntry kMetadataEntry(ConfigurationVersion::Id, BitFlags(), Access::Privilege::kView, std::nullopt); diff --git a/zzz_generated/app-common/clusters/BasicInformation/MetadataProvider.h b/zzz_generated/app-common/clusters/BasicInformation/MetadataProvider.h index fa89a1f69f1..f8fca0c21e4 100644 --- a/zzz_generated/app-common/clusters/BasicInformation/MetadataProvider.h +++ b/zzz_generated/app-common/clusters/BasicInformation/MetadataProvider.h @@ -69,6 +69,8 @@ struct ClusterMetadataProvider(Id, "product-appearance", Attributes::ProductAppearance::Id, credsIssuerConfig), // make_unique(Id, "specification-version", Attributes::SpecificationVersion::Id, credsIssuerConfig), // make_unique(Id, "max-paths-per-invoke", Attributes::MaxPathsPerInvoke::Id, credsIssuerConfig), // + make_unique(Id, "device-location", Attributes::DeviceLocation::Id, credsIssuerConfig), // make_unique(Id, "configuration-version", Attributes::ConfigurationVersion::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // @@ -20225,6 +20227,9 @@ void registerClusterBasicInformation(Commands & commands, CredentialIssuerComman WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "max-paths-per-invoke", 0, UINT16_MAX, Attributes::MaxPathsPerInvoke::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "device-location", Attributes::DeviceLocation::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "configuration-version", 0, UINT32_MAX, Attributes::ConfigurationVersion::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( @@ -20262,6 +20267,7 @@ void registerClusterBasicInformation(Commands & commands, CredentialIssuerComman make_unique(Id, "product-appearance", Attributes::ProductAppearance::Id, credsIssuerConfig), // make_unique(Id, "specification-version", Attributes::SpecificationVersion::Id, credsIssuerConfig), // make_unique(Id, "max-paths-per-invoke", Attributes::MaxPathsPerInvoke::Id, credsIssuerConfig), // + make_unique(Id, "device-location", Attributes::DeviceLocation::Id, credsIssuerConfig), // make_unique(Id, "configuration-version", Attributes::ConfigurationVersion::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index f135abb2718..86a12457f4c 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -11565,10 +11565,18 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("AmbientContextType", indent + 1, value.ambientContextType); + CHIP_ERROR err = DataModelLogger::LogValue("AmbientContextDetected", indent + 1, value.ambientContextDetected); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AmbientContextType'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'AmbientContextDetected'"); + return err; + } + } + { + CHIP_ERROR err = DataModelLogger::LogValue("ObjectCountReached", indent + 1, value.objectCountReached); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'ObjectCountReached'"); return err; } } @@ -11589,10 +11597,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = DataModelLogger::LogValue("StartEventNumber", indent + 1, value.startEventNumber); + CHIP_ERROR err = DataModelLogger::LogValue("EventStartTime", indent + 1, value.eventStartTime); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'StartEventNumber'"); + DataModelLogger::LogString(indent + 1, "Event truncated due to invalid value for 'EventStartTime'"); return err; } } @@ -13757,6 +13765,11 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("MaxPathsPerInvoke", 1, value); } + case BasicInformation::Attributes::DeviceLocation::Id: { + chip::app::DataModel::Nullable value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("DeviceLocation", 1, value); + } case BasicInformation::Attributes::ConfigurationVersion::Id: { uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index ced4fbb59f7..604eef743ce 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -602,6 +602,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "SpecificationVersion"; case chip::app::Clusters::BasicInformation::Attributes::MaxPathsPerInvoke::Id: return "MaxPathsPerInvoke"; + case chip::app::Clusters::BasicInformation::Attributes::DeviceLocation::Id: + return "DeviceLocation"; case chip::app::Clusters::BasicInformation::Attributes::ConfigurationVersion::Id: return "ConfigurationVersion"; case chip::app::Clusters::BasicInformation::Attributes::GeneratedCommandList::Id: diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index fae4a8342d9..b2a3e2e93ab 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -10050,6 +10050,7 @@ class SubscribeAttributeActionsClusterRevision : public SubscribeAttribute { | * ProductAppearance | 0x0014 | | * SpecificationVersion | 0x0015 | | * MaxPathsPerInvoke | 0x0016 | +| * DeviceLocation | 0x0017 | | * ConfigurationVersion | 0x0018 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | @@ -12075,6 +12076,150 @@ class SubscribeAttributeBasicInformationMaxPathsPerInvoke : public SubscribeAttr #if MTR_ENABLE_PROVISIONAL +/* + * Attribute DeviceLocation + */ +class ReadBasicInformationDeviceLocation : public ReadAttribute { +public: + ReadBasicInformationDeviceLocation() + : ReadAttribute("device-location") + { + } + + ~ReadBasicInformationDeviceLocation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::BasicInformation::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::BasicInformation::Attributes::DeviceLocation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReadAttribute (0x%08" PRIX32 ") on endpoint %u", endpointId, clusterId, attributeId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterBasicInformation alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeDeviceLocationWithCompletion:^(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"BasicInformation.DeviceLocation response %@", [value description]); + if (error == nil) { + TEMPORARY_RETURN_IGNORED RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("BasicInformation DeviceLocation read Error", error); + TEMPORARY_RETURN_IGNORED RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteBasicInformationDeviceLocation : public WriteAttribute { +public: + WriteBasicInformationDeviceLocation() + : WriteAttribute("device-location") + , mComplex(&mValue) + { + AddArgument("attr-name", "device-location"); + AddArgument("attr-value", &mComplex); + WriteAttribute::AddArguments(); + } + + ~WriteBasicInformationDeviceLocation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::BasicInformation::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::BasicInformation::Attributes::DeviceLocation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") WriteAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterBasicInformation alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRWriteParams alloc] init]; + params.timedWriteTimeout = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; + MTRDataTypeLocationDescriptorStruct * _Nullable value; + if (mValue.IsNull()) { + value = nil; + } else { + value = [MTRDataTypeLocationDescriptorStruct new]; + value.locationName = [[NSString alloc] initWithBytes:mValue.Value().locationName.data() length:mValue.Value().locationName.size() encoding:NSUTF8StringEncoding]; + if (mValue.Value().floorNumber.IsNull()) { + value.floorNumber = nil; + } else { + value.floorNumber = [NSNumber numberWithShort:mValue.Value().floorNumber.Value()]; + } + if (mValue.Value().areaType.IsNull()) { + value.areaType = nil; + } else { + value.areaType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mValue.Value().areaType.Value())]; + } + } + + [cluster writeAttributeDeviceLocationWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("BasicInformation DeviceLocation write Error", error); + TEMPORARY_RETURN_IGNORED RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + chip::app::DataModel::Nullable mValue; + TypedComplexArgument> mComplex; +}; + +class SubscribeAttributeBasicInformationDeviceLocation : public SubscribeAttribute { +public: + SubscribeAttributeBasicInformationDeviceLocation() + : SubscribeAttribute("device-location") + { + } + + ~SubscribeAttributeBasicInformationDeviceLocation() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::BasicInformation::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::BasicInformation::Attributes::DeviceLocation::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") ReportAttribute (0x%08" PRIX32 ") on endpoint %u", clusterId, attributeId, endpointId); + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); + __auto_type * cluster = [[MTRBaseClusterBasicInformation alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRSubscribeParams alloc] initWithMinInterval:@(mMinInterval) maxInterval:@(mMaxInterval)]; + if (mKeepSubscriptions.HasValue()) { + params.replaceExistingSubscriptions = !mKeepSubscriptions.Value(); + } + if (mFabricFiltered.HasValue()) { + params.filterByFabric = mFabricFiltered.Value(); + } + if (mAutoResubscribe.HasValue()) { + params.resubscribeAutomatically = mAutoResubscribe.Value(); + } + [cluster subscribeAttributeDeviceLocationWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(MTRDataTypeLocationDescriptorStruct * _Nullable value, NSError * _Nullable error) { + NSLog(@"BasicInformation.DeviceLocation response %@", [value description]); + if (error == nil) { + TEMPORARY_RETURN_IGNORED RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + TEMPORARY_RETURN_IGNORED RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + /* * Attribute ConfigurationVersion */ @@ -195899,6 +196044,11 @@ void registerClusterBasicInformation(Commands & commands) make_unique(), // make_unique(), // make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), //