From 759b686c4a1e8c80361294ebf5073bb1195c4d0a Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:38:36 -0600 Subject: [PATCH 1/9] Generated using ./alchemy zap --attribute="in-progress" ... Chime.adoc --- .github/workflows/tests.yaml | 1 + scripts/rules.matterlint | 1 + .../zcl/zcl-with-test-extensions.json | 112 ++++-- src/app/zap-templates/zcl/zcl.json | 118 ++++-- src/app/zap_cluster_list.json | 340 +++++++++++++----- 5 files changed, 442 insertions(+), 130 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index d14d188a2fb6e4..71761ce3b56075 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -91,6 +91,7 @@ jobs: --no-print \ --log-level info \ src/app/zap-templates/zcl/data-model/chip/global-attributes.xml \ + src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/global-bitmaps.xml \ src/app/zap-templates/zcl/data-model/chip/global-enums.xml \ src/app/zap-templates/zcl/data-model/chip/global-structs.xml \ diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index e7bd644249a13e..c1e2e48cde9498 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -15,6 +15,7 @@ load "../src/app/zap-templates/zcl/data-model/chip/boolean-state-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/actions-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/bridged-device-basic-information.xml"; load "../src/app/zap-templates/zcl/data-model/chip/channel-cluster.xml"; +load "../src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chip-ota.xml"; load "../src/app/zap-templates/zcl/data-model/chip/chip-types.xml"; load "../src/app/zap-templates/zcl/data-model/chip/clusters-extensions.xml"; 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 bc1a29c4b4aa3b..38b74ff15dcc86 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -27,6 +27,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "chime-cluster.xml", "chip-ota.xml", "channel-cluster.xml", "clusters-extensions.xml", @@ -142,9 +143,15 @@ "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { "text": { - "defaultResponsePolicy": ["Always", "Conditional", "Never"] + "defaultResponsePolicy": [ + "Always", + "Conditional", + "Never" + ] }, - "bool": ["commandDiscovery"] + "bool": [ + "commandDiscovery" + ] }, "defaults": { "text": { @@ -190,8 +197,13 @@ "SpecificationVersion", "MaxPathsPerInvoke" ], - "Bridged Device Basic Information": ["ProductAppearance"], - "Descriptor": ["ClusterRevision", "FeatureMap"], + "Bridged Device Basic Information": [ + "ProductAppearance" + ], + "Descriptor": [ + "ClusterRevision", + "FeatureMap" + ], "Device Energy Management": [ "ESAType", "ESACanGenerate", @@ -243,7 +255,11 @@ "SessionEnergyDischarged", "FeatureMap" ], - "Energy EVSE Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Energy EVSE Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", @@ -288,7 +304,11 @@ "ClientsSupportedPerFabric", "MaximumCheckInBackOff" ], - "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], + "Occupancy Sensing": [ + "HoldTimeLimits", + "HoldTime", + "FeatureMap" + ], "Operational Credentials": [ "SupportedFabrics", "CommissionedFabrics", @@ -395,14 +415,21 @@ "CurrentMaxRate", "OverrunCount" ], - "Channel": ["Lineup", "CurrentChannel"], + "Channel": [ + "Lineup", + "CurrentChannel" + ], "Media Playback": [ "SampledPosition", "ActiveAudioTrack", "ActiveTextTrack" ], - "Application Launcher": ["CurrentApp"], - "Application Basic": ["Application"], + "Application Launcher": [ + "CurrentApp" + ], + "Application Basic": [ + "Application" + ], "Time Synchronization": [ "TrustedTimeSource", "DefaultNTP", @@ -414,7 +441,9 @@ "TimeZoneListMaxSize", "DSTOffsetListMaxSize" ], - "Temperature Control": ["SupportedTemperatureLevels"], + "Temperature Control": [ + "SupportedTemperatureLevels" + ], "Dishwasher Mode": [ "SupportedModes", "CurrentMode", @@ -422,7 +451,11 @@ "OnMode", "FeatureMap" ], - "Microwave Oven Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Microwave Oven Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Microwave Oven Control": [ "CookTime", "MaxCookTime", @@ -449,8 +482,16 @@ "OnMode", "FeatureMap" ], - "RVC Clean Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], - "RVC Run Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "RVC Clean Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], + "RVC Run Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Operational State": [ "OperationalState", "OperationalError", @@ -627,7 +668,10 @@ "LevelValue", "FeatureMap" ], - "Air Quality": ["AirQuality", "FeatureMap"], + "Air Quality": [ + "AirQuality", + "FeatureMap" + ], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", @@ -659,9 +703,15 @@ "NeutralCurrent", "FeatureMap" ], - "Power Topology": ["FeatureMap"], - "Valve Configuration and Control": ["RemainingDuration"], - "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Power Topology": [ + "FeatureMap" + ], + "Valve Configuration and Control": [ + "RemainingDuration" + ], + "Boolean State Configuration": [ + "CurrentSensitivityLevel" + ], "Water Heater Management": [ "HeaterTypes", "HeatDemand", @@ -672,17 +722,35 @@ "FeatureMap", "ClusterRevision" ], - "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], - "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], + "Water Heater Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], + "Wi-Fi Network Management": [ + "SSID", + "PassphraseSurrogate" + ], "Thread Network Directory": [ "PreferredExtendedPanID", "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] + "Service Area": [ + "CurrentArea", + "EstimatedEndTime", + "FeatureMap" + ] }, "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, @@ -692,4 +760,4 @@ "uiOptions": { "showProfileId": false } -} +} \ No newline at end of file diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index db4526e39cbbde..eec9804fe01d36 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -3,7 +3,11 @@ "category": "matter", "version": 1, "requiredFeatureLevel": 102, - "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], + "xmlRoot": [ + ".", + "./data-model/chip/", + "./data-model/silabs/" + ], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", @@ -22,6 +26,7 @@ "boolean-state-configuration-cluster.xml", "actions-cluster.xml", "bridged-device-basic-information.xml", + "chime-cluster.xml", "chip-ota.xml", "channel-cluster.xml", "clusters-extensions.xml", @@ -136,9 +141,15 @@ "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { "text": { - "defaultResponsePolicy": ["Always", "Conditional", "Never"] + "defaultResponsePolicy": [ + "Always", + "Conditional", + "Never" + ] }, - "bool": ["commandDiscovery"] + "bool": [ + "commandDiscovery" + ] }, "defaults": { "text": { @@ -184,8 +195,13 @@ "SpecificationVersion", "MaxPathsPerInvoke" ], - "Bridged Device Basic Information": ["ProductAppearance"], - "Descriptor": ["ClusterRevision", "FeatureMap"], + "Bridged Device Basic Information": [ + "ProductAppearance" + ], + "Descriptor": [ + "ClusterRevision", + "FeatureMap" + ], "Device Energy Management": [ "ESAType", "ESACanGenerate", @@ -237,7 +253,11 @@ "SessionEnergyDischarged", "FeatureMap" ], - "Energy EVSE Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Energy EVSE Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", @@ -282,7 +302,11 @@ "ClientsSupportedPerFabric", "MaximumCheckInBackOff" ], - "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], + "Occupancy Sensing": [ + "HoldTimeLimits", + "HoldTime", + "FeatureMap" + ], "Operational Credentials": [ "SupportedFabrics", "CommissionedFabrics", @@ -389,14 +413,21 @@ "CurrentMaxRate", "OverrunCount" ], - "Channel": ["Lineup", "CurrentChannel"], + "Channel": [ + "Lineup", + "CurrentChannel" + ], "Media Playback": [ "SampledPosition", "ActiveAudioTrack", "ActiveTextTrack" ], - "Application Launcher": ["CurrentApp"], - "Application Basic": ["Application"], + "Application Launcher": [ + "CurrentApp" + ], + "Application Basic": [ + "Application" + ], "Time Synchronization": [ "TrustedTimeSource", "DefaultNTP", @@ -408,7 +439,9 @@ "TimeZoneListMaxSize", "DSTOffsetListMaxSize" ], - "Temperature Control": ["SupportedTemperatureLevels"], + "Temperature Control": [ + "SupportedTemperatureLevels" + ], "Dishwasher Mode": [ "SupportedModes", "CurrentMode", @@ -416,7 +449,11 @@ "OnMode", "FeatureMap" ], - "Microwave Oven Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Microwave Oven Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Microwave Oven Control": [ "CookTime", "MaxCookTime", @@ -443,8 +480,16 @@ "OnMode", "FeatureMap" ], - "RVC Clean Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], - "RVC Run Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "RVC Clean Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], + "RVC Run Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], "Operational State": [ "OperationalState", "OperationalError", @@ -621,7 +666,10 @@ "LevelValue", "FeatureMap" ], - "Air Quality": ["AirQuality", "FeatureMap"], + "Air Quality": [ + "AirQuality", + "FeatureMap" + ], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", @@ -653,9 +701,15 @@ "NeutralCurrent", "FeatureMap" ], - "Power Topology": ["FeatureMap"], - "Valve Configuration and Control": ["RemainingDuration"], - "Boolean State Configuration": ["CurrentSensitivityLevel"], + "Power Topology": [ + "FeatureMap" + ], + "Valve Configuration and Control": [ + "RemainingDuration" + ], + "Boolean State Configuration": [ + "CurrentSensitivityLevel" + ], "Water Heater Management": [ "HeaterTypes", "HeatDemand", @@ -666,17 +720,35 @@ "FeatureMap", "ClusterRevision" ], - "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], - "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], + "Water Heater Mode": [ + "SupportedModes", + "CurrentMode", + "FeatureMap" + ], + "Wi-Fi Network Management": [ + "SSID", + "PassphraseSurrogate" + ], "Thread Network Directory": [ "PreferredExtendedPanID", "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] + "Service Area": [ + "CurrentArea", + "EstimatedEndTime", + "FeatureMap" + ] }, "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], + "ZCLDataTypes": [ + "ARRAY", + "BITMAP", + "ENUM", + "NUMBER", + "STRING", + "STRUCT" + ], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, @@ -686,4 +758,4 @@ "uiOptions": { "showProfileId": false } -} +} \ No newline at end of file diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index a047340147ece5..76115ce4348c32 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -19,6 +19,7 @@ "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "CHANNEL_CLUSTER": [], + "CHIME_CLUSTER": [], "CLIENT_MONITORING_CLUSTER": [], "COLOR_CONTROL_CLUSTER": [], "COMMISSIONER_CONTROL_CLUSTER": [], @@ -110,7 +111,9 @@ "TARGET_NAVIGATOR_CLUSTER": [], "TEMPERATURE_CONTROL_CLUSTER": [], "TEMPERATURE_MEASUREMENT_CLUSTER": [], - "THERMOSTAT_CLUSTER": ["thermostat-client"], + "THERMOSTAT_CLUSTER": [ + "thermostat-client" + ], "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [], "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [], "THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [], @@ -134,8 +137,12 @@ "WINDOW_COVERING_CLUSTER": [] }, "ServerDirectories": { - "ACCESS_CONTROL_CLUSTER": ["access-control-server"], - "ACCOUNT_LOGIN_CLUSTER": ["account-login-server"], + "ACCESS_CONTROL_CLUSTER": [ + "access-control-server" + ], + "ACCOUNT_LOGIN_CLUSTER": [ + "account-login-server" + ], "ACTIONS_CLUSTER": [], "ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER": [ "resource-monitoring-server" @@ -143,14 +150,26 @@ "ADMINISTRATOR_COMMISSIONING_CLUSTER": [ "administrator-commissioning-server" ], - "AIR_QUALITY_CLUSTER": ["air-quality-server"], + "AIR_QUALITY_CLUSTER": [ + "air-quality-server" + ], "ALARM_CLUSTER": [], - "APPLICATION_BASIC_CLUSTER": ["application-basic-server"], - "APPLICATION_LAUNCHER_CLUSTER": ["application-launcher-server"], - "AUDIO_OUTPUT_CLUSTER": ["audio-output-server"], + "APPLICATION_BASIC_CLUSTER": [ + "application-basic-server" + ], + "APPLICATION_LAUNCHER_CLUSTER": [ + "application-launcher-server" + ], + "AUDIO_OUTPUT_CLUSTER": [ + "audio-output-server" + ], "BALLAST_CONFIGURATION_CLUSTER": [], - "BASIC_INFORMATION_CLUSTER": ["basic-information"], - "BINDING_CLUSTER": ["bindings"], + "BASIC_INFORMATION_CLUSTER": [ + "basic-information" + ], + "BINDING_CLUSTER": [ + "bindings" + ], "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [ "boolean-state-configuration-server" @@ -164,78 +183,177 @@ "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "CHANNEL_CLUSTER": ["channel-server"], - "COLOR_CONTROL_CLUSTER": ["color-control-server"], - "COMMISSIONER_CONTROL_CLUSTER": ["commissioner-control-server"], + "CHANNEL_CLUSTER": [ + "channel-server" + ], + "CHIME_CLUSTER": [], + "COLOR_CONTROL_CLUSTER": [ + "color-control-server" + ], + "COMMISSIONER_CONTROL_CLUSTER": [ + "commissioner-control-server" + ], "COMMISSIONING_CLUSTER": [], - "CONTENT_LAUNCHER_CLUSTER": ["content-launch-server"], - "CONTENT_CONTROL_CLUSTER": ["content-control-server"], - "CONTENT_APP_OBSERVER_CLUSTER": ["content-app-observer"], - "DESCRIPTOR_CLUSTER": ["descriptor"], - "DEVICE_ENERGY_MANAGEMENT_CLUSTER": ["device-energy-management-server"], - "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER": ["mode-base-server"], + "CONTENT_LAUNCHER_CLUSTER": [ + "content-launch-server" + ], + "CONTENT_CONTROL_CLUSTER": [ + "content-control-server" + ], + "CONTENT_APP_OBSERVER_CLUSTER": [ + "content-app-observer" + ], + "DESCRIPTOR_CLUSTER": [ + "descriptor" + ], + "DEVICE_ENERGY_MANAGEMENT_CLUSTER": [ + "device-energy-management-server" + ], + "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER": [ + "mode-base-server" + ], "DEVICE_TEMP_CLUSTER": [], - "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], - "DISHWASHER_ALARM_CLUSTER": ["dishwasher-alarm-server"], - "DISHWASHER_MODE_CLUSTER": ["mode-base-server"], - "MICROWAVE_OVEN_MODE_CLUSTER": ["mode-base-server"], - "DOOR_LOCK_CLUSTER": ["door-lock-server"], - "ECOSYSTEM_INFORMATION_CLUSTER": ["ecosystem-information-server"], + "DIAGNOSTIC_LOGS_CLUSTER": [ + "diagnostic-logs-server" + ], + "DISHWASHER_ALARM_CLUSTER": [ + "dishwasher-alarm-server" + ], + "DISHWASHER_MODE_CLUSTER": [ + "mode-base-server" + ], + "MICROWAVE_OVEN_MODE_CLUSTER": [ + "mode-base-server" + ], + "DOOR_LOCK_CLUSTER": [ + "door-lock-server" + ], + "ECOSYSTEM_INFORMATION_CLUSTER": [ + "ecosystem-information-server" + ], "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [ "electrical-energy-measurement-server" ], "ELECTRICAL_POWER_MEASUREMENT_CLUSTER": [ "electrical-power-measurement-server" ], - "ENERGY_EVSE_CLUSTER": ["energy-evse-server"], - "ENERGY_EVSE_MODE_CLUSTER": ["mode-base-server"], + "ENERGY_EVSE_CLUSTER": [ + "energy-evse-server" + ], + "ENERGY_EVSE_MODE_CLUSTER": [ + "mode-base-server" + ], "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER": [ "ethernet-network-diagnostics-server" ], - "ENERGY_PREFERENCE_CLUSTER": ["energy-preference-server"], - "FAN_CONTROL_CLUSTER": ["fan-control-server"], - "FAULT_INJECTION_CLUSTER": ["fault-injection-server"], - "FIXED_LABEL_CLUSTER": ["fixed-label-server"], + "ENERGY_PREFERENCE_CLUSTER": [ + "energy-preference-server" + ], + "FAN_CONTROL_CLUSTER": [ + "fan-control-server" + ], + "FAULT_INJECTION_CLUSTER": [ + "fault-injection-server" + ], + "FIXED_LABEL_CLUSTER": [ + "fixed-label-server" + ], "FLOW_MEASUREMENT_CLUSTER": [], "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "GENERAL_COMMISSIONING_CLUSTER": ["general-commissioning-server"], - "GENERAL_DIAGNOSTICS_CLUSTER": ["general-diagnostics-server"], - "GROUPS_CLUSTER": ["groups-server"], - "HEPA_FILTER_MONITORING_CLUSTER": ["resource-monitoring-server"], - "GROUP_KEY_MANAGEMENT_CLUSTER": ["group-key-mgmt-server"], - "ICD_MANAGEMENT_CLUSTER": ["icd-management-server"], - "IDENTIFY_CLUSTER": ["identify-server"], + "GENERAL_COMMISSIONING_CLUSTER": [ + "general-commissioning-server" + ], + "GENERAL_DIAGNOSTICS_CLUSTER": [ + "general-diagnostics-server" + ], + "GROUPS_CLUSTER": [ + "groups-server" + ], + "HEPA_FILTER_MONITORING_CLUSTER": [ + "resource-monitoring-server" + ], + "GROUP_KEY_MANAGEMENT_CLUSTER": [ + "group-key-mgmt-server" + ], + "ICD_MANAGEMENT_CLUSTER": [ + "icd-management-server" + ], + "IDENTIFY_CLUSTER": [ + "identify-server" + ], "ILLUMINANCE_MEASUREMENT_CLUSTER": [], - "KEYPAD_INPUT_CLUSTER": ["keypad-input-server"], - "LAUNDRY_WASHER_MODE_CLUSTER": ["mode-base-server"], - "LEVEL_CONTROL_CLUSTER": ["level-control"], + "KEYPAD_INPUT_CLUSTER": [ + "keypad-input-server" + ], + "LAUNDRY_WASHER_MODE_CLUSTER": [ + "mode-base-server" + ], + "LEVEL_CONTROL_CLUSTER": [ + "level-control" + ], "LOCALIZATION_CONFIGURATION_CLUSTER": [ "localization-configuration-server" ], - "LOW_POWER_CLUSTER": ["low-power-server"], - "MEDIA_INPUT_CLUSTER": ["media-input-server"], - "MEDIA_PLAYBACK_CLUSTER": ["media-playback-server"], - "MICROWAVE_OVEN_CONTROL_CLUSTER": ["microwave-oven-control-server"], - "MESSAGES_CLUSTER": ["messages-server"], - "MODE_SELECT_CLUSTER": ["mode-select-server"], - "NETWORK_COMMISSIONING_CLUSTER": ["network-commissioning"], + "LOW_POWER_CLUSTER": [ + "low-power-server" + ], + "MEDIA_INPUT_CLUSTER": [ + "media-input-server" + ], + "MEDIA_PLAYBACK_CLUSTER": [ + "media-playback-server" + ], + "MICROWAVE_OVEN_CONTROL_CLUSTER": [ + "microwave-oven-control-server" + ], + "MESSAGES_CLUSTER": [ + "messages-server" + ], + "MODE_SELECT_CLUSTER": [ + "mode-select-server" + ], + "NETWORK_COMMISSIONING_CLUSTER": [ + "network-commissioning" + ], "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "SAMPLE_MEI_CLUSTER": ["sample-mei-server"], - "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], - "ON_OFF_CLUSTER": ["on-off-server"], - "POWER_TOPOLOGY_CLUSTER": ["power-topology-server"], - "OPERATIONAL_CREDENTIALS_CLUSTER": ["operational-credentials-server"], - "OPERATIONAL_STATE_CLUSTER": ["operational-state-server"], - "OPERATIONAL_STATE_OVEN_CLUSTER": ["operational-state-server"], - "OPERATIONAL_STATE_RVC_CLUSTER": ["operational-state-server"], + "SAMPLE_MEI_CLUSTER": [ + "sample-mei-server" + ], + "OCCUPANCY_SENSING_CLUSTER": [ + "occupancy-sensor-server" + ], + "ON_OFF_CLUSTER": [ + "on-off-server" + ], + "POWER_TOPOLOGY_CLUSTER": [ + "power-topology-server" + ], + "OPERATIONAL_CREDENTIALS_CLUSTER": [ + "operational-credentials-server" + ], + "OPERATIONAL_STATE_CLUSTER": [ + "operational-state-server" + ], + "OPERATIONAL_STATE_OVEN_CLUSTER": [ + "operational-state-server" + ], + "OPERATIONAL_STATE_RVC_CLUSTER": [ + "operational-state-server" + ], "OTA_BOOTLOAD_CLUSTER": [], - "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": ["ota-provider"], - "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": ["ota-requestor"], - "OVEN_MODE_CLUSTER": ["mode-base-server"], + "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [ + "ota-provider" + ], + "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [ + "ota-requestor" + ], + "OVEN_MODE_CLUSTER": [ + "mode-base-server" + ], "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], @@ -251,7 +369,9 @@ "POLL_CONTROL_CLUSTER": [], "POWER_CONFIG_CLUSTER": [], "POWER_PROFILE_CLUSTER": [], - "POWER_SOURCE_CLUSTER": ["power-source-server"], + "POWER_SOURCE_CLUSTER": [ + "power-source-server" + ], "POWER_SOURCE_CONFIGURATION_CLUSTER": [ "power-source-configuration-server" ], @@ -266,22 +386,44 @@ "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], + "REFRIGERATOR_ALARM_CLUSTER": [ + "refrigerator-alarm-server" + ], "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [ "mode-base-server" ], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_CLUSTER": ["mode-base-server"], - "RVC_RUN_MODE_CLUSTER": ["mode-base-server"], - "SCENES_CLUSTER": ["scenes-server"], - "SERVICE_AREA_CLUSTER": ["service-area-server"], - "SMOKE_CO_ALARM_CLUSTER": ["smoke-co-alarm-server"], - "SOFTWARE_DIAGNOSTICS_CLUSTER": ["software-diagnostics-server"], - "SWITCH_CLUSTER": ["switch-server"], - "TARGET_NAVIGATOR_CLUSTER": ["target-navigator-server"], - "TEMPERATURE_CONTROL_CLUSTER": ["temperature-control-server"], + "RVC_CLEAN_MODE_CLUSTER": [ + "mode-base-server" + ], + "RVC_RUN_MODE_CLUSTER": [ + "mode-base-server" + ], + "SCENES_CLUSTER": [ + "scenes-server" + ], + "SERVICE_AREA_CLUSTER": [ + "service-area-server" + ], + "SMOKE_CO_ALARM_CLUSTER": [ + "smoke-co-alarm-server" + ], + "SOFTWARE_DIAGNOSTICS_CLUSTER": [ + "software-diagnostics-server" + ], + "SWITCH_CLUSTER": [ + "switch-server" + ], + "TARGET_NAVIGATOR_CLUSTER": [ + "target-navigator-server" + ], + "TEMPERATURE_CONTROL_CLUSTER": [ + "temperature-control-server" + ], "TEMPERATURE_MEASUREMENT_CLUSTER": [], - "THERMOSTAT_CLUSTER": ["thermostat-server"], + "THERMOSTAT_CLUSTER": [ + "thermostat-server" + ], "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [ "thermostat-user-interface-configuration-server" ], @@ -291,27 +433,55 @@ "THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [ "thread-network-diagnostics-server" ], - "THREAD_NETWORK_DIRECTORY_CLUSTER": ["thread-network-directory-server"], + "THREAD_NETWORK_DIRECTORY_CLUSTER": [ + "thread-network-directory-server" + ], "TIME_CLUSTER": [], - "TIME_FORMAT_LOCALIZATION_CLUSTER": ["time-format-localization-server"], - "TIME_SYNCHRONIZATION_CLUSTER": ["time-synchronization-server"], - "TIMER_CLUSTER": ["timer-server"], + "TIME_FORMAT_LOCALIZATION_CLUSTER": [ + "time-format-localization-server" + ], + "TIME_SYNCHRONIZATION_CLUSTER": [ + "time-synchronization-server" + ], + "TIMER_CLUSTER": [ + "timer-server" + ], "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], "UNIT_LOCALIZATION_CLUSTER": [], - "UNIT_TESTING_CLUSTER": ["test-cluster-server"], - "USER_LABEL_CLUSTER": ["user-label-server"], + "UNIT_TESTING_CLUSTER": [ + "test-cluster-server" + ], + "USER_LABEL_CLUSTER": [ + "user-label-server" + ], "VALVE_CONFIGURATION_AND_CONTROL_CLUSTER": [ "valve-configuration-and-control-server" ], - "WAKE_ON_LAN_CLUSTER": ["wake-on-lan-server"], - "LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"], - "LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"], - "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], - "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], - "WINDOW_COVERING_CLUSTER": ["window-covering-server"], - "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], - "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"] + "WAKE_ON_LAN_CLUSTER": [ + "wake-on-lan-server" + ], + "LAUNDRY_WASHER_CONTROLS_CLUSTER": [ + "laundry-washer-controls-server" + ], + "LAUNDRY_DRYER_CONTROLS_CLUSTER": [ + "laundry-dryer-controls-server" + ], + "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [ + "wifi-network-diagnostics-server" + ], + "WIFI_NETWORK_MANAGEMENT_CLUSTER": [ + "wifi-network-management-server" + ], + "WINDOW_COVERING_CLUSTER": [ + "window-covering-server" + ], + "WATER_HEATER_MANAGEMENT_CLUSTER": [ + "water-heater-management-server" + ], + "WATER_HEATER_MODE_CLUSTER": [ + "mode-base-server" + ] } -} +} \ No newline at end of file From 4ccc06e23d1eb59601ab302d2660d5cf95ecc298 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:42:42 -0600 Subject: [PATCH 2/9] Generated using ./alchemy zap --attribute="in-progress" ... Chime.adoc --- .../zcl/data-model/chip/chime-cluster.xml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml diff --git a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml new file mode 100644 index 00000000000000..1a9e9bad409fc1 --- /dev/null +++ b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + Chime + 0x0556 + CHIME_CLUSTER + + true + true + + InstalledChimeSounds + ActiveChimeSoundId + Enabled + + + + + + From 89ffcb252ba5799059209cf9ad58011be4e92b41 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:44:29 -0600 Subject: [PATCH 3/9] Generated using ./alchemy zap --attribute="in-progress" ... Chime.adoc --- docs/zap_clusters.md | 1 + .../data_model/controller-clusters.matter | 22 + .../chip/devicecontroller/ChipClusters.java | 312 +++++ .../chip/devicecontroller/ChipStructs.java | 61 + .../devicecontroller/ClusterIDMapping.java | 107 ++ .../devicecontroller/ClusterInfoMapping.java | 126 ++ .../devicecontroller/ClusterReadMapping.java | 104 ++ .../devicecontroller/ClusterWriteMapping.java | 46 + .../chip/devicecontroller/cluster/files.gni | 1 + .../structs/ChimeClusterChimeSoundStruct.kt | 56 + .../cluster/clusters/ChimeCluster.kt | 1009 +++++++++++++++++ .../java/matter/controller/cluster/files.gni | 2 + .../structs/ChimeClusterChimeSoundStruct.kt | 56 + .../CHIPAttributeTLVValueDecoder.cpp | 225 ++++ .../CHIPEventTLVValueDecoder.cpp | 10 + .../python/chip/clusters/CHIPClusters.py | 72 ++ .../python/chip/clusters/Objects.py | 204 ++++ .../MTRAttributeSpecifiedCheck.mm | 39 + .../MTRAttributeTLVValueDecoder.mm | 70 ++ .../CHIP/zap-generated/MTRBaseClusters.h | 92 ++ .../CHIP/zap-generated/MTRBaseClusters.mm | 413 +++++++ .../CHIP/zap-generated/MTRClusterConstants.h | 15 + .../CHIP/zap-generated/MTRClusterNames.mm | 60 + .../CHIP/zap-generated/MTRClusters.h | 50 + .../CHIP/zap-generated/MTRClusters.mm | 102 ++ .../zap-generated/MTRCommandPayloadsObjc.h | 28 + .../zap-generated/MTRCommandPayloadsObjc.mm | 73 ++ .../MTRCommandPayloads_Internal.h | 6 + .../zap-generated/MTRCommandTimedCheck.mm | 12 + .../zap-generated/MTREventTLVValueDecoder.mm | 15 + .../CHIP/zap-generated/MTRStructsObjc.h | 6 + .../CHIP/zap-generated/MTRStructsObjc.mm | 30 + .../zap-generated/attributes/Accessors.cpp | 190 ++++ .../zap-generated/attributes/Accessors.h | 30 + .../app-common/zap-generated/callback.h | 50 + .../app-common/zap-generated/cluster-enums.h | 2 + .../zap-generated/cluster-objects.cpp | 107 ++ .../zap-generated/cluster-objects.h | 165 +++ .../app-common/zap-generated/ids/Attributes.h | 42 + .../app-common/zap-generated/ids/Clusters.h | 3 + .../app-common/zap-generated/ids/Commands.h | 10 + .../zap-generated/cluster/Commands.h | 124 ++ .../cluster/ComplexArgumentParser.cpp | 30 + .../cluster/ComplexArgumentParser.h | 5 + .../cluster/logging/DataModelLogger.cpp | 76 ++ .../cluster/logging/DataModelLogger.h | 3 + .../cluster/logging/EntryToText.cpp | 36 + .../zap-generated/cluster/Commands.h | 976 ++++++++++++++++ 48 files changed, 5274 insertions(+) create mode 100644 src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt create mode 100644 src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 41679143b5c428..94fe851dcdda21 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -129,6 +129,7 @@ Generally regenerate using one of: | 1294 | 0x50E | AccountLogin | | 1295 | 0x50F | ContentControl | | 1296 | 0x510 | ContentAppObserver | +| 1366 | 0x556 | Chime | | 1872 | 0x750 | EcosystemInformation | | 1873 | 0x751 | CommissionerControl | | 4294048773 | 0xFFF1FC05 | UnitTesting | diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 6c7748e0898737..9502c371cbf23c 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9408,6 +9408,28 @@ provisional cluster ContentAppObserver = 1296 { command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } +/** */ +cluster Chime = 1366 { + revision 1; + + struct ChimeSoundStruct { + int8u chimeId = 0; + char_string<48> name = 1; + } + + readonly attribute ChimeSoundStruct installedChimeSounds[] = 0; + attribute int8u activeChimeSoundId = 1; + attribute boolean enabled = 2; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + command PlayChimeSound(): DefaultSuccess = 0; +} + /** Provides extended device information for all the logical devices represented by a Bridged Node. */ provisional cluster EcosystemInformation = 1872 { revision 1; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index bb92218a4b4b59..c8e56acda2f197 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59491,6 +59491,318 @@ public void onSuccess(byte[] tlv) { } } + public static class ChimeCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 1366L; + + private static final long INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID = 0L; + private static final long ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID = 1L; + private static final long ENABLED_ATTRIBUTE_ID = 2L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; + private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; + private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; + private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; + private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; + private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; + + public ChimeCluster(long devicePtr, int endpointId) { + super(devicePtr, endpointId, CLUSTER_ID); + } + + @Override + @Deprecated + public long initWithDevice(long devicePtr, int endpointId) { + return 0L; + } + + public void playChimeSound(DefaultClusterCallback callback) { + playChimeSound(callback, 0); + } + + public void playChimeSound(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { + final long commandId = 0L; + + ArrayList elements = new ArrayList<>(); + StructType commandArgs = new StructType(elements); + invoke(new InvokeCallbackImpl(callback) { + @Override + public void onResponse(StructType invokeStructValue) { + callback.onSuccess(); + }}, commandId, commandArgs, timedInvokeTimeoutMs); + } + + public interface InstalledChimeSoundsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); + } + + public void readInstalledChimeSoundsAttribute( + InstalledChimeSoundsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, true); + } + + public void subscribeInstalledChimeSoundsAttribute( + InstalledChimeSoundsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readActiveChimeSoundIdAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, true); + } + + public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value) { + writeActiveChimeSoundIdAttribute(callback, value, 0); + } + + public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new UIntType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeActiveChimeSoundIdAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEnabledAttribute( + BooleanAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ENABLED_ATTRIBUTE_ID, true); + } + + public void writeEnabledAttribute(DefaultClusterCallback callback, Boolean value) { + writeEnabledAttribute(callback, value, 0); + } + + public void writeEnabledAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { + BaseTLVType tlvValue = new BooleanType(value); + writeAttribute(new WriteAttributesCallbackImpl(callback), ENABLED_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + } + + public void subscribeEnabledAttribute( + BooleanAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ENABLED_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ENABLED_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeGeneratedCommandListAttribute( + GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAcceptedCommandListAttribute( + AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readEventListAttribute( + EventListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeEventListAttribute( + EventListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readAttributeListAttribute( + AttributeListAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); + } + + public void subscribeAttributeListAttribute( + AttributeListAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readFeatureMapAttribute( + LongAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, true); + } + + public void subscribeFeatureMapAttribute( + LongAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); + } + + public void readClusterRevisionAttribute( + IntegerAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + readAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, true); + } + + public void subscribeClusterRevisionAttribute( + IntegerAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); + + subscribeAttribute(new ReportCallbackImpl(callback, path) { + @Override + public void onSuccess(byte[] tlv) { + Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + callback.onSuccess(value); + } + }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); + } + } + public static class EcosystemInformationCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1872L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index 7ee8a88f80f64b..ad16b0792b13a3 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12724,6 +12724,67 @@ public String toString() { return output.toString(); } } +public static class ChimeClusterChimeSoundStruct { + public Integer chimeId; + public String name; + private static final long CHIME_ID_ID = 0L; + private static final long NAME_ID = 1L; + + public ChimeClusterChimeSoundStruct( + Integer chimeId, + String name + ) { + this.chimeId = chimeId; + this.name = name; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(CHIME_ID_ID, new UIntType(chimeId))); + values.add(new StructElement(NAME_ID, new StringType(name))); + + return new StructType(values); + } + + public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Integer chimeId = null; + String name = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == CHIME_ID_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + chimeId = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == NAME_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + name = castingValue.value(String.class); + } + } + } + return new ChimeClusterChimeSoundStruct( + chimeId, + name + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ChimeClusterChimeSoundStruct {\n"); + output.append("\tchimeId: "); + output.append(chimeId); + output.append("\n"); + output.append("\tname: "); + output.append(name); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class EcosystemInformationClusterDeviceTypeStruct { public Long deviceType; public Integer revision; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 8bf4e6d615c358..fb2070787cb1bb 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -379,6 +379,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == ContentAppObserver.ID) { return new ContentAppObserver(); } + if (clusterId == Chime.ID) { + return new Chime(); + } if (clusterId == EcosystemInformation.ID) { return new EcosystemInformation(); } @@ -16878,6 +16881,110 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } + public static class Chime implements BaseCluster { + public static final long ID = 1366L; + public long getID() { + return ID; + } + + public enum Attribute { + InstalledChimeSounds(0L), + ActiveChimeSoundId(1L), + Enabled(2L), + GeneratedCommandList(65528L), + AcceptedCommandList(65529L), + EventList(65530L), + AttributeList(65531L), + FeatureMap(65532L), + ClusterRevision(65533L),; + private final long id; + Attribute(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Attribute value(long id) throws NoSuchFieldError { + for (Attribute attribute : Attribute.values()) { + if (attribute.getID() == id) { + return attribute; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Event {; + private final long id; + Event(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Event value(long id) throws NoSuchFieldError { + for (Event event : Event.values()) { + if (event.getID() == id) { + return event; + } + } + throw new NoSuchFieldError(); + } + } + + public enum Command { + PlayChimeSound(0L),; + private final long id; + Command(long id) { + this.id = id; + } + + public long getID() { + return id; + } + + public static Command value(long id) throws NoSuchFieldError { + for (Command command : Command.values()) { + if (command.getID() == id) { + return command; + } + } + throw new NoSuchFieldError(); + } + }@Override + public String getAttributeName(long id) throws NoSuchFieldError { + return Attribute.value(id).toString(); + } + + @Override + public String getEventName(long id) throws NoSuchFieldError { + return Event.value(id).toString(); + } + + @Override + public String getCommandName(long id) throws NoSuchFieldError { + return Command.value(id).toString(); + } + + @Override + public long getAttributeID(String name) throws IllegalArgumentException { + return Attribute.valueOf(name).getID(); + } + + @Override + public long getEventID(String name) throws IllegalArgumentException { + return Event.valueOf(name).getID(); + } + + @Override + public long getCommandID(String name) throws IllegalArgumentException { + return Command.valueOf(name).getID(); + } + } public static class EcosystemInformation implements BaseCluster { public static final long ID = 1872L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index d10ce6b823d8d4..3025c268521b80 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -19994,6 +19994,111 @@ public void onError(Exception ex) { } } + public static class DelegatedChimeClusterInstalledChimeSoundsAttributeCallback implements ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedChimeClusterGeneratedCommandListAttributeCallback implements ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedChimeClusterAcceptedCommandListAttributeCallback implements ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedChimeClusterEventListAttributeCallback implements ChipClusters.ChimeCluster.EventListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + + public static class DelegatedChimeClusterAttributeListAttributeCallback implements ChipClusters.ChimeCluster.AttributeListAttributeCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(List valueList) { + Map responseValues = new LinkedHashMap<>(); + CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); + responseValues.put(commandResponseInfo, valueList); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception ex) { + callback.onFailure(ex); + } + } + public static class DelegatedEcosystemInformationClusterDeviceDirectoryAttributeCallback implements ChipClusters.EcosystemInformationCluster.DeviceDirectoryAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -22330,6 +22435,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.ContentAppObserverCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("contentAppObserver", contentAppObserverClusterInfo); + ClusterInfo chimeClusterInfo = new ClusterInfo( + (ptr, endpointId) -> new ChipClusters.ChimeCluster(ptr, endpointId), new HashMap<>()); + clusterMap.put("chime", chimeClusterInfo); + ClusterInfo ecosystemInformationClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.EcosystemInformationCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("ecosystemInformation", ecosystemInformationClusterInfo); @@ -22471,6 +22580,7 @@ public void combineCommand(Map destination, Map> getCommandMap() { commandMap.put("contentAppObserver", contentAppObserverClusterInteractionInfoMap); + Map chimeClusterInteractionInfoMap = new LinkedHashMap<>(); + + Map chimeplayChimeSoundCommandParams = new LinkedHashMap(); + InteractionInfo chimeplayChimeSoundInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster) + .playChimeSound((DefaultClusterCallback) callback + ); + }, + () -> new DelegatedDefaultClusterCallback(), + chimeplayChimeSoundCommandParams + ); + chimeClusterInteractionInfoMap.put("playChimeSound", chimeplayChimeSoundInteractionInfo); + + commandMap.put("chime", chimeClusterInteractionInfoMap); + Map ecosystemInformationClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("ecosystemInformation", ecosystemInformationClusterInteractionInfoMap); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 7de9e8cdc25d2f..76df1318c2cc1d 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18236,6 +18236,109 @@ private static Map readContentAppObserverInteractionInf return result; } + private static Map readChimeInteractionInfo() { + Map result = new LinkedHashMap<>();Map readChimeInstalledChimeSoundsCommandParams = new LinkedHashMap(); + InteractionInfo readChimeInstalledChimeSoundsAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readInstalledChimeSoundsAttribute( + (ChipClusters.ChimeCluster.InstalledChimeSoundsAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedChimeClusterInstalledChimeSoundsAttributeCallback(), + readChimeInstalledChimeSoundsCommandParams + ); + result.put("readInstalledChimeSoundsAttribute", readChimeInstalledChimeSoundsAttributeInteractionInfo); + Map readChimeActiveChimeSoundIdCommandParams = new LinkedHashMap(); + InteractionInfo readChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readActiveChimeSoundIdAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readChimeActiveChimeSoundIdCommandParams + ); + result.put("readActiveChimeSoundIdAttribute", readChimeActiveChimeSoundIdAttributeInteractionInfo); + Map readChimeEnabledCommandParams = new LinkedHashMap(); + InteractionInfo readChimeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readEnabledAttribute( + (ChipClusters.BooleanAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), + readChimeEnabledCommandParams + ); + result.put("readEnabledAttribute", readChimeEnabledAttributeInteractionInfo); + Map readChimeGeneratedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readChimeGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readGeneratedCommandListAttribute( + (ChipClusters.ChimeCluster.GeneratedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedChimeClusterGeneratedCommandListAttributeCallback(), + readChimeGeneratedCommandListCommandParams + ); + result.put("readGeneratedCommandListAttribute", readChimeGeneratedCommandListAttributeInteractionInfo); + Map readChimeAcceptedCommandListCommandParams = new LinkedHashMap(); + InteractionInfo readChimeAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readAcceptedCommandListAttribute( + (ChipClusters.ChimeCluster.AcceptedCommandListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedChimeClusterAcceptedCommandListAttributeCallback(), + readChimeAcceptedCommandListCommandParams + ); + result.put("readAcceptedCommandListAttribute", readChimeAcceptedCommandListAttributeInteractionInfo); + Map readChimeEventListCommandParams = new LinkedHashMap(); + InteractionInfo readChimeEventListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readEventListAttribute( + (ChipClusters.ChimeCluster.EventListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedChimeClusterEventListAttributeCallback(), + readChimeEventListCommandParams + ); + result.put("readEventListAttribute", readChimeEventListAttributeInteractionInfo); + Map readChimeAttributeListCommandParams = new LinkedHashMap(); + InteractionInfo readChimeAttributeListAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readAttributeListAttribute( + (ChipClusters.ChimeCluster.AttributeListAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedChimeClusterAttributeListAttributeCallback(), + readChimeAttributeListCommandParams + ); + result.put("readAttributeListAttribute", readChimeAttributeListAttributeInteractionInfo); + Map readChimeFeatureMapCommandParams = new LinkedHashMap(); + InteractionInfo readChimeFeatureMapAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readFeatureMapAttribute( + (ChipClusters.LongAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), + readChimeFeatureMapCommandParams + ); + result.put("readFeatureMapAttribute", readChimeFeatureMapAttributeInteractionInfo); + Map readChimeClusterRevisionCommandParams = new LinkedHashMap(); + InteractionInfo readChimeClusterRevisionAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).readClusterRevisionAttribute( + (ChipClusters.IntegerAttributeCallback) callback + ); + }, + () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), + readChimeClusterRevisionCommandParams + ); + result.put("readClusterRevisionAttribute", readChimeClusterRevisionAttributeInteractionInfo); + + return result; + } private static Map readEcosystemInformationInteractionInfo() { Map result = new LinkedHashMap<>();Map readEcosystemInformationDeviceDirectoryCommandParams = new LinkedHashMap(); InteractionInfo readEcosystemInformationDeviceDirectoryAttributeInteractionInfo = new InteractionInfo( @@ -19686,6 +19789,7 @@ public Map> getReadAttributeMap() { put("accountLogin", readAccountLoginInteractionInfo()); put("contentControl", readContentControlInteractionInfo()); put("contentAppObserver", readContentAppObserverInteractionInfo()); + put("chime", readChimeInteractionInfo()); put("ecosystemInformation", readEcosystemInformationInteractionInfo()); put("commissionerControl", readCommissionerControlInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index b61658cc4ef211..1e8e72762bcd09 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3472,6 +3472,52 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("contentControl", writeContentControlInteractionInfo); Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); + Map writeChimeInteractionInfo = new LinkedHashMap<>(); + Map writeChimeActiveChimeSoundIdCommandParams = new LinkedHashMap(); + CommandParameterInfo chimeactiveChimeSoundIdCommandParameterInfo = + new CommandParameterInfo( + "value", + Integer.class, + Integer.class + ); + writeChimeActiveChimeSoundIdCommandParams.put( + "value", + chimeactiveChimeSoundIdCommandParameterInfo + ); + InteractionInfo writeChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).writeActiveChimeSoundIdAttribute( + (DefaultClusterCallback) callback, + (Integer) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeChimeActiveChimeSoundIdCommandParams + ); + writeChimeInteractionInfo.put("writeActiveChimeSoundIdAttribute", writeChimeActiveChimeSoundIdAttributeInteractionInfo); + Map writeChimeEnabledCommandParams = new LinkedHashMap(); + CommandParameterInfo chimeenabledCommandParameterInfo = + new CommandParameterInfo( + "value", + Boolean.class, + Boolean.class + ); + writeChimeEnabledCommandParams.put( + "value", + chimeenabledCommandParameterInfo + ); + InteractionInfo writeChimeEnabledAttributeInteractionInfo = new InteractionInfo( + (cluster, callback, commandArguments) -> { + ((ChipClusters.ChimeCluster) cluster).writeEnabledAttribute( + (DefaultClusterCallback) callback, + (Boolean) commandArguments.get("value") + ); + }, + () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), + writeChimeEnabledCommandParams + ); + writeChimeInteractionInfo.put("writeEnabledAttribute", writeChimeEnabledAttributeInteractionInfo); + writeAttributeMap.put("chime", writeChimeInteractionInfo); Map writeEcosystemInformationInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("ecosystemInformation", writeEcosystemInformationInteractionInfo); Map writeCommissionerControlInteractionInfo = new LinkedHashMap<>(); 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 bbaa6112dd9dea..397c26ee3dc9e5 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -28,6 +28,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramCategoryStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterProgramStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChannelClusterSeriesInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentControlClusterRatingNameStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt new file mode 100644 index 00000000000000..586f6fcc2cb747 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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 ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) { + override fun toString(): String = buildString { + append("ChimeClusterChimeSoundStruct {\n") + append("\tchimeId : $chimeId\n") + append("\tname : $name\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CHIME_ID), chimeId) + put(ContextSpecificTag(TAG_NAME), name) + endStructure() + } + } + + companion object { + private const val TAG_CHIME_ID = 0 + private const val TAG_NAME = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct { + tlvReader.enterStructure(tlvTag) + val chimeId = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID)) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + + tlvReader.exitContainer() + + return ChimeClusterChimeSoundStruct(chimeId, name) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt new file mode 100644 index 00000000000000..2d6242b849d6f5 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt @@ -0,0 +1,1009 @@ +/* + * + * 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.clusters + +import java.time.Duration +import java.util.logging.Level +import java.util.logging.Logger +import kotlinx.coroutines.flow.Flow +import kotlinx.coroutines.flow.transform +import matter.controller.BooleanSubscriptionState +import matter.controller.InvokeRequest +import matter.controller.InvokeResponse +import matter.controller.MatterController +import matter.controller.ReadData +import matter.controller.ReadRequest +import matter.controller.SubscribeRequest +import matter.controller.SubscriptionState +import matter.controller.UByteSubscriptionState +import matter.controller.UIntSubscriptionState +import matter.controller.UShortSubscriptionState +import matter.controller.WriteRequest +import matter.controller.WriteRequests +import matter.controller.WriteResponse +import matter.controller.cluster.structs.* +import matter.controller.model.AttributePath +import matter.controller.model.CommandPath +import matter.tlv.AnonymousTag +import matter.tlv.TlvReader +import matter.tlv.TlvWriter + +class ChimeCluster(private val controller: MatterController, private val endpointId: UShort) { + class InstalledChimeSoundsAttribute(val value: List) + + sealed class InstalledChimeSoundsAttributeSubscriptionState { + data class Success(val value: List) : + InstalledChimeSoundsAttributeSubscriptionState() + + data class Error(val exception: Exception) : InstalledChimeSoundsAttributeSubscriptionState() + + object SubscriptionEstablished : InstalledChimeSoundsAttributeSubscriptionState() + } + + class GeneratedCommandListAttribute(val value: List) + + sealed class GeneratedCommandListAttributeSubscriptionState { + data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() + } + + class AcceptedCommandListAttribute(val value: List) + + sealed class AcceptedCommandListAttributeSubscriptionState { + data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() + + object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() + } + + class EventListAttribute(val value: List) + + sealed class EventListAttributeSubscriptionState { + data class Success(val value: List) : EventListAttributeSubscriptionState() + + data class Error(val exception: Exception) : EventListAttributeSubscriptionState() + + object SubscriptionEstablished : EventListAttributeSubscriptionState() + } + + class AttributeListAttribute(val value: List) + + sealed class AttributeListAttributeSubscriptionState { + data class Success(val value: List) : AttributeListAttributeSubscriptionState() + + data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() + + object SubscriptionEstablished : AttributeListAttributeSubscriptionState() + } + + suspend fun playChimeSound(timedInvokeTimeout: Duration? = null) { + val commandId: UInt = 0u + + val tlvWriter = TlvWriter() + tlvWriter.startStructure(AnonymousTag) + tlvWriter.endStructure() + + val request: InvokeRequest = + InvokeRequest( + CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), + tlvPayload = tlvWriter.getEncoded(), + timedRequest = timedInvokeTimeout, + ) + + val response: InvokeResponse = controller.invoke(request) + logger.log(Level.FINE, "Invoke command succeeded: ${response}") + } + + suspend fun readInstalledChimeSoundsAttribute(): InstalledChimeSoundsAttribute { + val ATTRIBUTE_ID: UInt = 0u + + 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) { "Installedchimesounds attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ChimeClusterChimeSoundStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + return InstalledChimeSoundsAttribute(decodedValue) + } + + suspend fun subscribeInstalledChimeSoundsAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 0u + 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( + InstalledChimeSoundsAttributeSubscriptionState.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) { + "Installedchimesounds attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(ChimeClusterChimeSoundStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + + emit(InstalledChimeSoundsAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(InstalledChimeSoundsAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readActiveChimeSoundIdAttribute(): UByte { + val ATTRIBUTE_ID: UInt = 1u + + 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) { "Activechimesoundid attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + return decodedValue + } + + suspend fun writeActiveChimeSoundIdAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 1u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + 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 subscribeActiveChimeSoundIdAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 1u + 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( + UByteSubscriptionState.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) { + "Activechimesoundid attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) + + emit(UByteSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UByteSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEnabledAttribute(): Boolean { + val ATTRIBUTE_ID: UInt = 2u + + 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) { "Enabled attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) + + return decodedValue + } + + suspend fun writeEnabledAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { + val ATTRIBUTE_ID: UInt = 2u + + val tlvWriter = TlvWriter() + tlvWriter.put(AnonymousTag, value) + + 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 subscribeEnabledAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 2u + 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( + BooleanSubscriptionState.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) { "Enabled attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) + + emit(BooleanSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(BooleanSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65528u + + 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) { "Generatedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return GeneratedCommandListAttribute(decodedValue) + } + + suspend fun subscribeGeneratedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65528u + 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( + GeneratedCommandListAttributeSubscriptionState.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) { + "Generatedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { + val ATTRIBUTE_ID: UInt = 65529u + + 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) { "Acceptedcommandlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AcceptedCommandListAttribute(decodedValue) + } + + suspend fun subscribeAcceptedCommandListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65529u + 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( + AcceptedCommandListAttributeSubscriptionState.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) { + "Acceptedcommandlist attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readEventListAttribute(): EventListAttribute { + val ATTRIBUTE_ID: UInt = 65530u + + 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) { "Eventlist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return EventListAttribute(decodedValue) + } + + suspend fun subscribeEventListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65530u + 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( + EventListAttributeSubscriptionState.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) { "Eventlist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(EventListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(EventListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readAttributeListAttribute(): AttributeListAttribute { + val ATTRIBUTE_ID: UInt = 65531u + + 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) { "Attributelist attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + return AttributeListAttribute(decodedValue) + } + + suspend fun subscribeAttributeListAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65531u + 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( + AttributeListAttributeSubscriptionState.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) { "Attributelist attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: List = + buildList { + tlvReader.enterArray(AnonymousTag) + while (!tlvReader.isEndOfContainer()) { + add(tlvReader.getUInt(AnonymousTag)) + } + tlvReader.exitContainer() + } + + emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readFeatureMapAttribute(): UInt { + val ATTRIBUTE_ID: UInt = 65532u + + 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) { "Featuremap attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeFeatureMapAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65532u + 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( + UIntSubscriptionState.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) { "Featuremap attribute not found in Node State update" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) + + emit(UIntSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UIntSubscriptionState.SubscriptionEstablished) + } + } + } + } + + suspend fun readClusterRevisionAttribute(): UShort { + val ATTRIBUTE_ID: UInt = 65533u + + 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) { "Clusterrevision attribute not found in response" } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + return decodedValue + } + + suspend fun subscribeClusterRevisionAttribute( + minInterval: Int, + maxInterval: Int, + ): Flow { + val ATTRIBUTE_ID: UInt = 65533u + 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( + UShortSubscriptionState.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) { + "Clusterrevision attribute not found in Node State update" + } + + // Decode the TLV data into the appropriate type + val tlvReader = TlvReader(attributeData.data) + val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) + + emit(UShortSubscriptionState.Success(decodedValue)) + } + SubscriptionState.SubscriptionEstablished -> { + emit(UShortSubscriptionState.SubscriptionEstablished) + } + } + } + } + + companion object { + private val logger = Logger.getLogger(ChimeCluster::class.java.name) + const val CLUSTER_ID: UInt = 1366u + } +} 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 d1a3d9681b21bf..42e2b95b02028f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -28,6 +28,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterProgramCategoryStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterProgramStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChannelClusterSeriesInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentControlClusterRatingNameStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentLauncherClusterAdditionalInfoStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ContentLauncherClusterBrandingInformationStruct.kt", @@ -267,6 +268,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonDioxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CarbonMonoxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChannelCluster.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ColorControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/CommissionerControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ContentAppObserverCluster.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt new file mode 100644 index 00000000000000..adc8cbb0db2d3e --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt @@ -0,0 +1,56 @@ +/* + * + * 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 ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) { + override fun toString(): String = buildString { + append("ChimeClusterChimeSoundStruct {\n") + append("\tchimeId : $chimeId\n") + append("\tname : $name\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_CHIME_ID), chimeId) + put(ContextSpecificTag(TAG_NAME), name) + endStructure() + } + } + + companion object { + private const val TAG_CHIME_ID = 0 + private const val TAG_NAME = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct { + tlvReader.enterStructure(tlvTag) + val chimeId = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID)) + val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) + + tlvReader.exitContainer() + + return ChimeClusterChimeSoundStruct(chimeId, name) + } + } +} diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index fbbb5be261737f..c272e8404c83e7 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -42220,6 +42220,231 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } + case app::Clusters::Chime::Id: { + using namespace app::Clusters::Chime; + switch (aPath.mAttributeId) + { + case Attributes::InstalledChimeSounds::Id: { + using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + jobject newElement_0_chimeId; + std::string newElement_0_chimeIdClassName = "java/lang/Integer"; + std::string newElement_0_chimeIdCtorSignature = "(I)V"; + jint jninewElement_0_chimeId = static_cast(entry_0.chimeId); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_chimeIdClassName.c_str(), + newElement_0_chimeIdCtorSignature.c_str(), + jninewElement_0_chimeId, newElement_0_chimeId); + jobject newElement_0_name; + LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); + + jclass chimeSoundStructStructClass_1; + err = chip::JniReferences::GetInstance().GetLocalClassRef( + env, "chip/devicecontroller/ChipStructs$ChimeClusterChimeSoundStruct", chimeSoundStructStructClass_1); + if (err != CHIP_NO_ERROR) + { + ChipLogError(Zcl, "Could not find class ChipStructs$ChimeClusterChimeSoundStruct"); + return nullptr; + } + + jmethodID chimeSoundStructStructCtor_1; + err = chip::JniReferences::GetInstance().FindMethod(env, chimeSoundStructStructClass_1, "", + "(Ljava/lang/Integer;Ljava/lang/String;)V", + &chimeSoundStructStructCtor_1); + if (err != CHIP_NO_ERROR || chimeSoundStructStructCtor_1 == nullptr) + { + ChipLogError(Zcl, "Could not find ChipStructs$ChimeClusterChimeSoundStruct constructor"); + return nullptr; + } + + newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeId, + newElement_0_name); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::ActiveChimeSoundId::Id: { + using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Boolean"; + std::string valueCtorSignature = "(Z)V"; + jboolean jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::GeneratedCommandList::Id: { + using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AcceptedCommandList::Id: { + using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::EventList::Id: { + using TypeInfo = Attributes::EventList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::AttributeList::Id: { + using TypeInfo = Attributes::AttributeList::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + chip::JniReferences::GetInstance().CreateArrayList(value); + + auto iter_value_0 = cppValue.begin(); + while (iter_value_0.Next()) + { + auto & entry_0 = iter_value_0.GetValue(); + jobject newElement_0; + std::string newElement_0ClassName = "java/lang/Long"; + std::string newElement_0CtorSignature = "(J)V"; + jlong jninewElement_0 = static_cast(entry_0); + chip::JniReferences::GetInstance().CreateBoxedObject( + newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); + chip::JniReferences::GetInstance().AddToList(value, newElement_0); + } + return value; + } + case Attributes::FeatureMap::Id: { + using TypeInfo = Attributes::FeatureMap::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Long"; + std::string valueCtorSignature = "(J)V"; + jlong jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), + jnivalue, value); + return value; + } + case Attributes::ClusterRevision::Id: { + using TypeInfo = Attributes::ClusterRevision::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = app::DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) + { + return nullptr; + } + jobject value; + std::string valueClassName = "java/lang/Integer"; + std::string valueCtorSignature = "(I)V"; + jint jnivalue = static_cast(cppValue); + chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, + value); + return value; + } + default: + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + break; + } + break; + } case app::Clusters::EcosystemInformation::Id: { using namespace app::Clusters::EcosystemInformation; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index dd385a777c9276..2dc46ab844d25e 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -8248,6 +8248,16 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } + case app::Clusters::Chime::Id: { + using namespace app::Clusters::Chime; + switch (aPath.mEventId) + { + default: + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + break; + } + break; + } case app::Clusters::EcosystemInformation::Id: { using namespace app::Clusters::EcosystemInformation; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index af684af705969f..1b5f2e6513fa1c 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13029,6 +13029,76 @@ class ChipClusters: }, }, } + _CHIME_CLUSTER_INFO = { + "clusterName": "Chime", + "clusterId": 0x00000556, + "commands": { + 0x00000000: { + "commandId": 0x00000000, + "commandName": "PlayChimeSound", + "args": { + }, + }, + }, + "attributes": { + 0x00000000: { + "attributeName": "InstalledChimeSounds", + "attributeId": 0x00000000, + "type": "", + "reportable": True, + }, + 0x00000001: { + "attributeName": "ActiveChimeSoundId", + "attributeId": 0x00000001, + "type": "int", + "reportable": True, + "writable": True, + }, + 0x00000002: { + "attributeName": "Enabled", + "attributeId": 0x00000002, + "type": "bool", + "reportable": True, + "writable": True, + }, + 0x0000FFF8: { + "attributeName": "GeneratedCommandList", + "attributeId": 0x0000FFF8, + "type": "int", + "reportable": True, + }, + 0x0000FFF9: { + "attributeName": "AcceptedCommandList", + "attributeId": 0x0000FFF9, + "type": "int", + "reportable": True, + }, + 0x0000FFFA: { + "attributeName": "EventList", + "attributeId": 0x0000FFFA, + "type": "int", + "reportable": True, + }, + 0x0000FFFB: { + "attributeName": "AttributeList", + "attributeId": 0x0000FFFB, + "type": "int", + "reportable": True, + }, + 0x0000FFFC: { + "attributeName": "FeatureMap", + "attributeId": 0x0000FFFC, + "type": "int", + "reportable": True, + }, + 0x0000FFFD: { + "attributeName": "ClusterRevision", + "attributeId": 0x0000FFFD, + "type": "int", + "reportable": True, + }, + }, + } _ECOSYSTEM_INFORMATION_CLUSTER_INFO = { "clusterName": "EcosystemInformation", "clusterId": 0x00000750, @@ -14277,6 +14347,7 @@ class ChipClusters: 0x0000050E: _ACCOUNT_LOGIN_CLUSTER_INFO, 0x0000050F: _CONTENT_CONTROL_CLUSTER_INFO, 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, + 0x00000556: _CHIME_CLUSTER_INFO, 0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO, 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, @@ -14402,6 +14473,7 @@ class ChipClusters: "AccountLogin": _ACCOUNT_LOGIN_CLUSTER_INFO, "ContentControl": _CONTENT_CONTROL_CLUSTER_INFO, "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, + "Chime": _CHIME_CLUSTER_INFO, "EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO, "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 6a9e0b8416fd5a..c70def4c9eb2ec 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -156,6 +156,7 @@ "AccountLogin", "ContentControl", "ContentAppObserver", + "Chime", "EcosystemInformation", "CommissionerControl", "UnitTesting", @@ -46505,6 +46506,209 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 +@dataclass +class Chime(Cluster): + id: typing.ClassVar[int] = 0x00000556 + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="installedChimeSounds", Tag=0x00000000, Type=typing.List[Chime.Structs.ChimeSoundStruct]), + ClusterObjectFieldDescriptor(Label="activeChimeSoundId", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="enabled", Tag=0x00000002, Type=bool), + ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), + ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), + ]) + + installedChimeSounds: 'typing.List[Chime.Structs.ChimeSoundStruct]' = None + activeChimeSoundId: 'uint' = None + enabled: 'bool' = None + generatedCommandList: 'typing.List[uint]' = None + acceptedCommandList: 'typing.List[uint]' = None + eventList: 'typing.List[uint]' = None + attributeList: 'typing.List[uint]' = None + featureMap: 'uint' = None + clusterRevision: 'uint' = None + + class Structs: + @dataclass + class ChimeSoundStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="chimeId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), + ]) + + chimeId: 'uint' = 0 + name: 'str' = "" + + class Commands: + @dataclass + class PlayChimeSound(ClusterCommand): + cluster_id: typing.ClassVar[int] = 0x00000556 + command_id: typing.ClassVar[int] = 0x00000000 + is_client: typing.ClassVar[bool] = True + response_type: typing.ClassVar[str] = None + + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ]) + + class Attributes: + @dataclass + class InstalledChimeSounds(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000000 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[Chime.Structs.ChimeSoundStruct]) + + value: 'typing.List[Chime.Structs.ChimeSoundStruct]' = field(default_factory=lambda: []) + + @dataclass + class ActiveChimeSoundId(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000001 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class Enabled(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x00000002 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=bool) + + value: 'bool' = False + + @dataclass + class GeneratedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF8 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AcceptedCommandList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFF9 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class EventList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFA + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class AttributeList(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFB + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=typing.List[uint]) + + value: 'typing.List[uint]' = field(default_factory=lambda: []) + + @dataclass + class FeatureMap(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFC + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass + class ClusterRevision(ClusterAttributeDescriptor): + @ChipUtility.classproperty + def cluster_id(cls) -> int: + return 0x00000556 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + return 0x0000FFFD + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + return ClusterObjectFieldDescriptor(Type=uint) + + value: 'uint' = 0 + + @dataclass class EcosystemInformation(Cluster): id: typing.ClassVar[int] = 0x00000750 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 6c1548f5159b70..f94445c21d3d3e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5912,6 +5912,42 @@ static BOOL AttributeIsSpecifiedInContentAppObserverCluster(AttributeId aAttribu } } } +static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId) +{ + using namespace Clusters::Chime; + switch (aAttributeId) { + case Attributes::InstalledChimeSounds::Id: { + return YES; + } + case Attributes::ActiveChimeSoundId::Id: { + return YES; + } + case Attributes::Enabled::Id: { + return YES; + } + case Attributes::GeneratedCommandList::Id: { + return YES; + } + case Attributes::AcceptedCommandList::Id: { + return YES; + } + case Attributes::EventList::Id: { + return YES; + } + case Attributes::AttributeList::Id: { + return YES; + } + case Attributes::FeatureMap::Id: { + return YES; + } + case Attributes::ClusterRevision::Id: { + return YES; + } + default: { + return NO; + } + } +} static BOOL AttributeIsSpecifiedInEcosystemInformationCluster(AttributeId aAttributeId) { using namespace Clusters::EcosystemInformation; @@ -6645,6 +6681,9 @@ BOOL MTRAttributeIsSpecified(ClusterId aClusterId, AttributeId aAttributeId) case Clusters::ContentAppObserver::Id: { return AttributeIsSpecifiedInContentAppObserverCluster(aAttributeId); } + case Clusters::Chime::Id: { + return AttributeIsSpecifiedInChimeCluster(aAttributeId); + } case Clusters::EcosystemInformation::Id: { return AttributeIsSpecifiedInEcosystemInformationCluster(aAttributeId); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 4affde0367f59a..3b8fff36f2efe3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16899,6 +16899,73 @@ static id _Nullable DecodeAttributeValueForContentAppObserverCluster(AttributeId *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; return nil; } +static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Chime; + switch (aAttributeId) { + case Attributes::InstalledChimeSounds::Id: { + using TypeInfo = Attributes::InstalledChimeSounds::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSArray * _Nonnull value; + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = cppValue.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRChimeClusterChimeSoundStruct * newElement_0; + newElement_0 = [MTRChimeClusterChimeSoundStruct new]; + newElement_0.chimeId = [NSNumber numberWithUnsignedChar:entry_0.chimeId]; + newElement_0.name = AsString(entry_0.name); + if (newElement_0.name == nil) { + CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; + *aError = err; + return nil; + } + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + *aError = err; + return nil; + } + value = array_0; + } + return value; + } + case Attributes::ActiveChimeSoundId::Id: { + using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithUnsignedChar:cppValue]; + return value; + } + case Attributes::Enabled::Id: { + using TypeInfo = Attributes::Enabled::TypeInfo; + TypeInfo::DecodableType cppValue; + *aError = DataModel::Decode(aReader, cppValue); + if (*aError != CHIP_NO_ERROR) { + return nil; + } + NSNumber * _Nonnull value; + value = [NSNumber numberWithBool:cppValue]; + return value; + } + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; + return nil; +} static id _Nullable DecodeAttributeValueForEcosystemInformationCluster(AttributeId aAttributeId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::EcosystemInformation; @@ -19008,6 +19075,9 @@ id _Nullable MTRDecodeAttributeValue(const ConcreteAttributePath & aPath, TLV::T case Clusters::ContentAppObserver::Id: { return DecodeAttributeValueForContentAppObserverCluster(aPath.mAttributeId, aReader, aError); } + case Clusters::Chime::Id: { + return DecodeAttributeValueForChimeCluster(aPath.mAttributeId, aReader, aError); + } case Clusters::EcosystemInformation::Id: { return DecodeAttributeValueForEcosystemInformationCluster(aPath.mAttributeId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index bcf76c978cb480..cbc390c337da9e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14756,6 +14756,98 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Chime + * + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRBaseClusterChime : MTRGenericBaseCluster + +/** + * Command PlayChimeSound + * + * + */ +- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeInstalledChimeSoundsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeInstalledChimeSoundsWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRBaseClusterChime (Availability) + +/** + * For all instance methods (reads, writes, commands) that take a completion, + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRBaseDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Ecosystem Information * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 67025a001ab842..f129e16427af2b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -102085,6 +102085,419 @@ + (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheC @end +@implementation MTRBaseClusterChime + +- (void)playChimeSoundWithCompletion:(MTRStatusCompletion)completion +{ + [self playChimeSoundWithParams:nil completion:completion]; +} +- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChimeClusterPlayChimeSoundParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Chime::Commands::PlayChimeSound::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (void)readAttributeInstalledChimeSoundsWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeInstalledChimeSoundsWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::InstalledChimeSounds::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)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 = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.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)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::Enabled::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +{ + [self writeAttributeEnabledWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; +} +- (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)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 = Chime::Attributes::Enabled::TypeInfo; + TypeInfo::Type cppValue; + cppValue = value.boolValue; + + chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); + return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); + std::move(*bridge).DispatchAction(self.device); +} + +- (void)subscribeAttributeEnabledWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::Enabled::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEnabledWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::Enabled::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeGeneratedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeGeneratedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeGeneratedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::GeneratedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAcceptedCommandListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAcceptedCommandListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAcceptedCommandListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::AcceptedCommandList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeEventListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::EventList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeEventListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::EventList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeEventListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::EventList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeAttributeListWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::AttributeList::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeAttributeListWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::AttributeList::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeAttributeListWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::AttributeList::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeFeatureMapWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeFeatureMapWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeFeatureMapWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::FeatureMap::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +- (void)readAttributeClusterRevisionWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo; + [self.device _readKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:nil + queue:self.callbackQueue + completion:completion]; +} + +- (void)subscribeAttributeClusterRevisionWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +{ + using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo; + [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID + clusterID:@(TypeInfo::GetClusterId()) + attributeID:@(TypeInfo::GetAttributeId()) + params:params + queue:self.callbackQueue + reportHandler:reportHandler + subscriptionEstablished:subscriptionEstablished]; +} + ++ (void)readAttributeClusterRevisionWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +{ + using TypeInfo = Chime::Attributes::ClusterRevision::TypeInfo; + [clusterStateCacheContainer + _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) + clusterID:TypeInfo::GetClusterId() + attributeID:TypeInfo::GetAttributeId() + queue:queue + completion:completion]; +} + +@end + @implementation MTRBaseClusterEcosystemInformation - (void)readAttributeDeviceDirectoryWithParams:(MTRReadParams * _Nullable)params completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index b86600455521cd..72233c40c81bdc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -197,6 +197,7 @@ typedef NS_ENUM(uint32_t, MTRClusterIDType) { MTRClusterIDTypeAccountLoginID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x0000050E, MTRClusterIDTypeContentControlID MTR_PROVISIONALLY_AVAILABLE = 0x0000050F, MTRClusterIDTypeContentAppObserverID MTR_PROVISIONALLY_AVAILABLE = 0x00000510, + MTRClusterIDTypeChimeID MTR_PROVISIONALLY_AVAILABLE = 0x00000556, MTRClusterIDTypeEcosystemInformationID MTR_PROVISIONALLY_AVAILABLE = 0x00000750, MTRClusterIDTypeCommissionerControlID MTR_PROVISIONALLY_AVAILABLE = 0x00000751, MTRClusterIDTypeUnitTestingID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0xFFF1FC05, @@ -4738,6 +4739,17 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterContentAppObserverAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, MTRAttributeIDTypeClusterContentAppObserverAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster Chime attributes + MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterChimeAttributeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, + MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, + MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, + MTRAttributeIDTypeClusterChimeAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, + MTRAttributeIDTypeClusterChimeAttributeAttributeListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAttributeListID, + MTRAttributeIDTypeClusterChimeAttributeFeatureMapID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeFeatureMapID, + MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeClusterRevisionID, + // Cluster EcosystemInformation attributes MTRAttributeIDTypeClusterEcosystemInformationAttributeDeviceDirectoryID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRAttributeIDTypeClusterEcosystemInformationAttributeLocationDirectoryID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, @@ -6931,6 +6943,9 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterContentAppObserverCommandContentAppMessageResponseID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + // Cluster Chime commands + MTRCommandIDTypeClusterChimeCommandPlayChimeSoundID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, + // Cluster CommissionerControl commands MTRCommandIDTypeClusterCommissionerControlCommandRequestCommissioningApprovalID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, MTRCommandIDTypeClusterCommissionerControlCommandCommissionNodeID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 59b10037b32a43..00c2db4a280021 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -369,6 +369,9 @@ case MTRClusterIDTypeContentAppObserverID: result = @"ContentAppObserver"; break; + case MTRClusterIDTypeChimeID: + result = @"Chime"; + break; case MTRClusterIDTypeEcosystemInformationID: result = @"EcosystemInformation"; break; @@ -8136,6 +8139,53 @@ } break; + case MTRClusterIDTypeChimeID: + + switch (attributeID) { + + // Cluster Chime attributes + case MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID: + result = @"InstalledChimeSounds"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID: + result = @"ActiveChimeSoundId"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeEnabledID: + result = @"Enabled"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID: + result = @"GeneratedCommandList"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID: + result = @"AcceptedCommandList"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeEventListID: + result = @"EventList"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeAttributeListID: + result = @"AttributeList"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeFeatureMapID: + result = @"FeatureMap"; + break; + + case MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID: + result = @"ClusterRevision"; + break; + + default: + result = [NSString stringWithFormat:@"", attributeID]; + break; + } + break; + case MTRClusterIDTypeEcosystemInformationID: switch (attributeID) { @@ -10287,6 +10337,16 @@ } break; + case MTRClusterIDTypeChimeID: + + switch (eventID) { + + default: + result = [NSString stringWithFormat:@"", eventID]; + break; + } + break; + case MTRClusterIDTypeEcosystemInformationID: switch (eventID) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 3a761fa7054192..2b329ff43f23fe 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6824,6 +6824,56 @@ MTR_PROVISIONALLY_AVAILABLE @end +/** + * Cluster Chime + * + */ +MTR_PROVISIONALLY_AVAILABLE +@interface MTRClusterChime : MTRGenericCluster + +- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)playChimeSoundWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion + MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeInstalledChimeSoundsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; + +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)new NS_UNAVAILABLE; + +@end + +@interface MTRClusterChime (Availability) + +/** + * For all instance methods that take a completion (i.e. command invocations), + * the completion will be called on the provided queue. + */ +- (instancetype _Nullable)initWithDevice:(MTRDevice *)device + endpointID:(NSNumber *)endpointID + queue:(dispatch_queue_t)queue MTR_PROVISIONALLY_AVAILABLE; + +@end + /** * Cluster Ecosystem Information * Provides extended device information for all the logical devices represented by a Bridged Node. diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 2ce4294c736a71..c745143f72507b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19549,6 +19549,108 @@ - (void)contentAppMessageWithParams:(MTRContentAppObserverClusterContentAppMessa @end +@implementation MTRClusterChime + +- (void)playChimeSoundWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + [self playChimeSoundWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; +} +- (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +{ + if (params == nil) { + params = [[MTRChimeClusterPlayChimeSoundParams + alloc] init]; + } + + auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { + completion(error); + }; + + auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; + + using RequestType = Chime::Commands::PlayChimeSound::Type; + [self.device _invokeKnownCommandWithEndpointID:self.endpointID + clusterID:@(RequestType::GetClusterId()) + commandID:@(RequestType::GetCommandId()) + commandPayload:params + expectedValues:expectedValues + expectedValueInterval:expectedValueIntervalMs + timedInvokeTimeout:timedInvokeTimeoutMs + serverSideProcessingTimeout:params.serverSideProcessingTimeout + responseClass:nil + queue:self.callbackQueue + completion:responseHandler]; +} + +- (NSDictionary * _Nullable)readAttributeInstalledChimeSoundsWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) params:params]; +} + +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeActiveChimeSoundIdWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEnabledID) params:params]; +} + +- (void)writeAttributeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +{ + [self writeAttributeEnabledWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; +} +- (void)writeAttributeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +{ + NSNumber * timedWriteTimeout = params.timedWriteTimeout; + + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEnabledID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; +} + +- (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAcceptedCommandListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeEventListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeEventListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeAttributeListWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeAttributeListID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeFeatureMapWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeFeatureMapID) params:params]; +} + +- (NSDictionary * _Nullable)readAttributeClusterRevisionWithParams:(MTRReadParams * _Nullable)params +{ + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeClusterRevisionID) params:params]; +} + +@end + @implementation MTRClusterEcosystemInformation - (NSDictionary * _Nullable)readAttributeDeviceDirectoryWithParams:(MTRReadParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 7135f3d88d8357..27a21e0b800666 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -10835,6 +10835,34 @@ MTR_PROVISIONALLY_AVAILABLE error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChimeClusterPlayChimeSoundParams : NSObject +/** + * Controls whether the command is a timed command (using Timed Invoke). + * + * If nil (the default value), a regular invoke is done for commands that do + * not require a timed invoke and a timed invoke with some default timed request + * timeout is done for commands that require a timed invoke. + * + * If not nil, a timed invoke is done, with the provided value used as the timed + * request timeout. The value should be chosen small enough to provide the + * desired security properties but large enough that it will allow a round-trip + * from the sever to the client (for the status response and actual invoke + * request) within the timeout window. + * + */ +@property (nonatomic, copy, nullable) NSNumber * timedInvokeTimeoutMs; + +/** + * Controls how much time, in seconds, we will allow for the server to process the command. + * + * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * + * If nil, the framework will try to select an appropriate timeout value itself. + */ +@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRCommissionerControlClusterRequestCommissioningApprovalParams : NSObject diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index ec90ce4d023543..4783d5b3308c9b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -31337,6 +31337,79 @@ - (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::ContentA @end +@implementation MTRChimeClusterPlayChimeSoundParams +- (instancetype)init +{ + if (self = [super init]) { + _timedInvokeTimeoutMs = nil; + _serverSideProcessingTimeout = nil; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone; +{ + auto other = [[MTRChimeClusterPlayChimeSoundParams alloc] init]; + + other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; + other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + return descriptionString; +} + +@end + +@implementation MTRChimeClusterPlayChimeSoundParams (InternalMethods) + +- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +{ + chip::app::Clusters::Chime::Commands::PlayChimeSound::Type encodableStruct; + ListFreer listFreer; + + auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + if (buffer.IsNull()) { + return CHIP_ERROR_NO_MEMORY; + } + + chip::System::PacketBufferTLVWriter writer; + // Commands never need chained buffers, since they cannot be chunked. + writer.Init(std::move(buffer), /* useChainedBuffers = */ false); + + ReturnErrorOnFailure(chip::app::DataModel::Encode(writer, chip::TLV::AnonymousTag(), encodableStruct)); + + ReturnErrorOnFailure(writer.Finalize(&buffer)); + + reader.Init(std::move(buffer)); + return reader.Next(chip::TLV::kTLVType_Structure, chip::TLV::AnonymousTag()); +} + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error +{ + chip::System::PacketBufferTLVReader reader; + CHIP_ERROR err = [self _encodeToTLVReader:reader]; + if (err != CHIP_NO_ERROR) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:err]; + } + return nil; + } + + auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); + if (decodedObj == nil) { + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + } + } + return decodedObj; +} +@end + @implementation MTRCommissionerControlClusterRequestCommissioningApprovalParams - (instancetype)init { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index 1d5bc86099c258..e7c5f23867e2ac 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -2032,6 +2032,12 @@ NS_ASSUME_NONNULL_BEGIN @end +@interface MTRChimeClusterPlayChimeSoundParams (InternalMethods) + +- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; + +@end + @interface MTRCommissionerControlClusterRequestCommissioningApprovalParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm index 3724ec038ef00c..6b5fed7921cfc9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandTimedCheck.mm @@ -1124,6 +1124,15 @@ static BOOL CommandNeedsTimedInvokeInContentAppObserverCluster(AttributeId aAttr } } } +static BOOL CommandNeedsTimedInvokeInChimeCluster(AttributeId aAttributeId) +{ + using namespace Clusters::Chime; + switch (aAttributeId) { + default: { + return NO; + } + } +} static BOOL CommandNeedsTimedInvokeInEcosystemInformationCluster(AttributeId aAttributeId) { using namespace Clusters::EcosystemInformation; @@ -1512,6 +1521,9 @@ BOOL MTRCommandNeedsTimedInvoke(NSNumber * _Nonnull aClusterID, NSNumber * _Nonn case Clusters::ContentAppObserver::Id: { return CommandNeedsTimedInvokeInContentAppObserverCluster(commandID); } + case Clusters::Chime::Id: { + return CommandNeedsTimedInvokeInChimeCluster(commandID); + } case Clusters::EcosystemInformation::Id: { return CommandNeedsTimedInvokeInEcosystemInformationCluster(commandID); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm index 4b493a97a74df6..d3163c2aa1dbec 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTREventTLVValueDecoder.mm @@ -4543,6 +4543,18 @@ static id _Nullable DecodeEventPayloadForContentAppObserverCluster(EventId aEven *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; return nil; } +static id _Nullable DecodeEventPayloadForChimeCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) +{ + using namespace Clusters::Chime; + switch (aEventId) { + default: { + break; + } + } + + *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; + return nil; +} static id _Nullable DecodeEventPayloadForEcosystemInformationCluster(EventId aEventId, TLV::TLVReader & aReader, CHIP_ERROR * aError) { using namespace Clusters::EcosystemInformation; @@ -5133,6 +5145,9 @@ id _Nullable MTRDecodeEventPayload(const ConcreteEventPath & aPath, TLV::TLVRead case Clusters::ContentAppObserver::Id: { return DecodeEventPayloadForContentAppObserverCluster(aPath.mEventId, aReader, aError); } + case Clusters::Chime::Id: { + return DecodeEventPayloadForChimeCluster(aPath.mEventId, aReader, aError); + } case Clusters::EcosystemInformation::Id: { return DecodeEventPayloadForEcosystemInformationCluster(aPath.mEventId, aReader, aError); } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 61aa5161dced29..2aecf40b144cbf 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2117,6 +2117,12 @@ MTR_PROVISIONALLY_AVAILABLE @interface MTRContentControlClusterRemainingScreenTimeExpiredEvent : NSObject @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRChimeClusterChimeSoundStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull chimeId MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTREcosystemInformationClusterDeviceTypeStruct : NSObject @property (nonatomic, copy) NSNumber * _Nonnull deviceType MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 5cb5806c112a69..67b0774cc0f973 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8768,6 +8768,36 @@ - (NSString *)description @end +@implementation MTRChimeClusterChimeSoundStruct +- (instancetype)init +{ + if (self = [super init]) { + + _chimeId = @(0); + + _name = @""; + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRChimeClusterChimeSoundStruct alloc] init]; + + other.chimeId = self.chimeId; + other.name = self.name; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chimeId:%@; name:%@; >", NSStringFromClass([self class]), _chimeId, _name]; + return descriptionString; +} + +@end + @implementation MTREcosystemInformationClusterDeviceTypeStruct - (instancetype)init { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 4d9c6b9f545dd1..2ccdf50a187413 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -36667,6 +36667,196 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace ContentAppObserver +namespace Chime { +namespace Attributes { + +namespace ActiveChimeSoundId { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); +} + +} // namespace ActiveChimeSoundId + +namespace Enabled { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); +} + +} // namespace Enabled + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); +} + +} // namespace FeatureMap + +namespace ClusterRevision { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) +{ + using Traits = NumericAttributeTraits; + Traits::StorageType temp; + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Chime::Id, Id, readable, sizeof(temp)); + VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); + if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + *value = Traits::StorageToWorking(temp); + return status; +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Chime::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); +} + +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) +{ + using Traits = NumericAttributeTraits; + if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) + { + return Protocols::InteractionModel::Status::ConstraintError; + } + Traits::StorageType storageValue; + Traits::WorkingToStorage(value, storageValue); + uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); + return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); +} + +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace Chime + namespace EcosystemInformation { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index c4b83e7920c064..7d60e62564bfac 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5563,6 +5563,36 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace ContentAppObserver +namespace Chime { +namespace Attributes { + +namespace ActiveChimeSoundId { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +} // namespace ActiveChimeSoundId + +namespace Enabled { +Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); +} // namespace Enabled + +namespace FeatureMap { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); +} // namespace FeatureMap + +namespace ClusterRevision { +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace Chime + namespace EcosystemInformation { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/callback.h b/zzz_generated/app-common/app-common/zap-generated/callback.h index 7e86e92268f703..59e11e3d5ecd61 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -618,6 +618,11 @@ void emberAfContentControlClusterInitCallback(chip::EndpointId endpoint); */ void emberAfContentAppObserverClusterInitCallback(chip::EndpointId endpoint); +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfChimeClusterInitCallback(chip::EndpointId endpoint); + /** * @param endpoint Endpoint that is being initialized */ @@ -5167,6 +5172,45 @@ chip::Protocols::InteractionModel::Status MatterContentAppObserverClusterServerP */ void emberAfContentAppObserverClusterServerTickCallback(chip::EndpointId endpoint); +// +// Chime Cluster +// + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfChimeClusterServerInitCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being shutdown + */ +void MatterChimeClusterServerShutdownCallback(chip::EndpointId endpoint); + +/** + * @param endpoint Endpoint that is being initialized + */ +void emberAfChimeClusterClientInitCallback(chip::EndpointId endpoint); + +/** + * @param attributePath Concrete attribute path that changed + */ +void MatterChimeClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); + +/** + * @param attributePath Concrete attribute path to be changed + * @param attributeType Attribute type + * @param size Attribute size + * @param value Attribute value + */ +chip::Protocols::InteractionModel::Status +MatterChimeClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, + EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); + +/** + * @param endpoint Endpoint that is being served + */ +void emberAfChimeClusterServerTickCallback(chip::EndpointId endpoint); + // // Ecosystem Information Cluster // @@ -6557,6 +6601,12 @@ bool emberAfContentControlClusterSetScheduledContentRatingThresholdCallback( bool emberAfContentAppObserverClusterContentAppMessageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::DecodableType & commandData); +/** + * @brief Chime Cluster PlayChimeSound Command callback (from client) + */ +bool emberAfChimeClusterPlayChimeSoundCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Chime::Commands::PlayChimeSound::DecodableType & commandData); /** * @brief Commissioner Control Cluster RequestCommissioningApproval Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index c55fab3f9ae9fa..206d3da00cdefa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -5392,6 +5392,8 @@ enum class StatusEnum : uint8_t }; } // namespace ContentAppObserver +namespace Chime {} // namespace Chime + namespace EcosystemInformation {} // namespace EcosystemInformation namespace CommissionerControl { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 3029e317897ca2..9c7cad32717aa8 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -28476,6 +28476,106 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace ContentAppObserver +namespace Chime { +namespace Structs { + +namespace ChimeSoundStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kChimeId), chimeId); + encoder.Encode(to_underlying(Fields::kName), name); + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kChimeId)) + { + err = DataModel::Decode(reader, chimeId); + } + else if (__context_tag == to_underlying(Fields::kName)) + { + err = DataModel::Decode(reader, name); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace ChimeSoundStruct +} // namespace Structs + +namespace Commands { +namespace PlayChimeSound { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + return encoder.Finalize(); +} + +CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) +{ + detail::StructDecodeIterator __iterator(reader); + while (true) + { + auto __element = __iterator.Next(); + if (std::holds_alternative(__element)) + { + return std::get(__element); + } + } +} +} // namespace PlayChimeSound. +} // namespace Commands + +namespace Attributes { +CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) +{ + switch (path.mAttributeId) + { + case Attributes::InstalledChimeSounds::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, installedChimeSounds); + case Attributes::ActiveChimeSoundId::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activeChimeSoundId); + case Attributes::Enabled::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, enabled); + case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, generatedCommandList); + case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, acceptedCommandList); + case Attributes::EventList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, eventList); + case Attributes::AttributeList::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, attributeList); + case Attributes::FeatureMap::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, featureMap); + case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, clusterRevision); + default: + return CHIP_NO_ERROR; + } +} +} // namespace Attributes + +namespace Events {} // namespace Events + +} // namespace Chime namespace EcosystemInformation { namespace Structs { @@ -32399,6 +32499,13 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } + case Clusters::Chime::Id: { + switch (aCommand) + { + default: + return false; + } + } case Clusters::CommissionerControl::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 16042f9eeb562f..59d48f7fd11eda 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -41196,6 +41196,171 @@ struct TypeInfo }; } // namespace Attributes } // namespace ContentAppObserver +namespace Chime { +namespace Structs { +namespace ChimeSoundStruct { +enum class Fields : uint8_t +{ + kChimeId = 0, + kName = 1, +}; + +struct Type +{ +public: + uint8_t chimeId = static_cast(0); + chip::CharSpan name; + + CHIP_ERROR Decode(TLV::TLVReader & reader); + + static constexpr bool kIsFabricScoped = false; + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; +}; + +using DecodableType = Type; + +} // namespace ChimeSoundStruct +} // namespace Structs + +namespace Commands { +// Forward-declarations so we can reference these later. + +namespace PlayChimeSound { +struct Type; +struct DecodableType; +} // namespace PlayChimeSound + +} // namespace Commands + +namespace Commands { +namespace PlayChimeSound { +enum class Fields : uint8_t +{ +}; + +struct Type +{ +public: + // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand + static constexpr CommandId GetCommandId() { return Commands::PlayChimeSound::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + + CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; + + using ResponseType = DataModel::NullObjectType; + + static constexpr bool MustUseTimedInvoke() { return false; } +}; + +struct DecodableType +{ +public: + static constexpr CommandId GetCommandId() { return Commands::PlayChimeSound::Id; } + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader); +}; +}; // namespace PlayChimeSound +} // namespace Commands + +namespace Attributes { + +namespace InstalledChimeSounds { +struct TypeInfo +{ + using Type = chip::app::DataModel::List; + using DecodableType = chip::app::DataModel::DecodableList; + using DecodableArgType = + const chip::app::DataModel::DecodableList &; + + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::InstalledChimeSounds::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace InstalledChimeSounds +namespace ActiveChimeSoundId { +struct TypeInfo +{ + using Type = uint8_t; + using DecodableType = uint8_t; + using DecodableArgType = uint8_t; + + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveChimeSoundId::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace ActiveChimeSoundId +namespace Enabled { +struct TypeInfo +{ + using Type = bool; + using DecodableType = bool; + using DecodableArgType = bool; + + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::Enabled::Id; } + static constexpr bool MustUseTimedWrite() { return false; } +}; +} // namespace Enabled +namespace GeneratedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace GeneratedCommandList +namespace AcceptedCommandList { +struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace AcceptedCommandList +namespace EventList { +struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace EventList +namespace AttributeList { +struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace AttributeList +namespace FeatureMap { +struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace FeatureMap +namespace ClusterRevision { +struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo +{ + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } +}; +} // namespace ClusterRevision + +struct TypeInfo +{ + struct DecodableType + { + static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } + + CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); + + Attributes::InstalledChimeSounds::TypeInfo::DecodableType installedChimeSounds; + Attributes::ActiveChimeSoundId::TypeInfo::DecodableType activeChimeSoundId = static_cast(0); + Attributes::Enabled::TypeInfo::DecodableType enabled = static_cast(0); + Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; + Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; + Attributes::EventList::TypeInfo::DecodableType eventList; + Attributes::AttributeList::TypeInfo::DecodableType attributeList; + Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); + Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); + }; +}; +} // namespace Attributes +} // namespace Chime namespace EcosystemInformation { namespace Structs { namespace DeviceTypeStruct = Clusters::detail::Structs::DeviceTypeStruct; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 20e4ea7c9fd82a..a7703bd94c3c36 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7313,6 +7313,48 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace ContentAppObserver +namespace Chime { +namespace Attributes { + +namespace InstalledChimeSounds { +static constexpr AttributeId Id = 0x00000000; +} // namespace InstalledChimeSounds + +namespace ActiveChimeSoundId { +static constexpr AttributeId Id = 0x00000001; +} // namespace ActiveChimeSoundId + +namespace Enabled { +static constexpr AttributeId Id = 0x00000002; +} // namespace Enabled + +namespace GeneratedCommandList { +static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; +} // namespace GeneratedCommandList + +namespace AcceptedCommandList { +static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; +} // namespace AcceptedCommandList + +namespace EventList { +static constexpr AttributeId Id = Globals::Attributes::EventList::Id; +} // namespace EventList + +namespace AttributeList { +static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; +} // namespace AttributeList + +namespace FeatureMap { +static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; +} // namespace FeatureMap + +namespace ClusterRevision { +static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace Chime + namespace EcosystemInformation { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 26dd82c18e704e..688110cd99f66d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -376,6 +376,9 @@ static constexpr ClusterId Id = 0x0000050F; namespace ContentAppObserver { static constexpr ClusterId Id = 0x00000510; } // namespace ContentAppObserver +namespace Chime { +static constexpr ClusterId Id = 0x00000556; +} // namespace Chime namespace EcosystemInformation { static constexpr ClusterId Id = 0x00000750; } // namespace EcosystemInformation diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h index b6cd8158f07d94..b6c40f70d2726d 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h @@ -1803,6 +1803,16 @@ static constexpr CommandId Id = 0x00000001; } // namespace Commands } // namespace ContentAppObserver +namespace Chime { +namespace Commands { + +namespace PlayChimeSound { +static constexpr CommandId Id = 0x00000000; +} // namespace PlayChimeSound + +} // namespace Commands +} // namespace Chime + namespace CommissionerControl { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 2333130d16c13a..eb8fe2243e37f2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -152,6 +152,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | | UnitTesting | 0xFFF1FC05| @@ -13645,6 +13646,62 @@ class ContentAppObserverContentAppMessage : public ClusterCommand chip::app::Clusters::ContentAppObserver::Commands::ContentAppMessage::Type mRequest; }; +/*----------------------------------------------------------------------------*\ +| Cluster Chime | 0x0556 | +|------------------------------------------------------------------------------| +| Commands: | | +| * PlayChimeSound | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * InstalledChimeSounds | 0x0000 | +| * ActiveChimeSoundId | 0x0001 | +| * Enabled | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +/* + * Command PlayChimeSound + */ +class ChimePlayChimeSound : public ClusterCommand +{ +public: + ChimePlayChimeSound(CredentialIssuerCommands * credsIssuerConfig) : ClusterCommand("play-chime-sound", credsIssuerConfig) + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, + commandId, endpointIds.at(0)); + return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); + } + + CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, + groupId); + + return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); + } + +private: + chip::app::Clusters::Chime::Commands::PlayChimeSound::Type mRequest; +}; + /*----------------------------------------------------------------------------*\ | Cluster EcosystemInformation | 0x0750 | |------------------------------------------------------------------------------| @@ -26166,6 +26223,72 @@ void registerClusterContentAppObserver(Commands & commands, CredentialIssuerComm commands.RegisterCluster(clusterName, clusterCommands); } +void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +{ + using namespace chip::app::Clusters::Chime; + + const char * clusterName = "Chime"; + + commands_list clusterCommands = { + // + // Commands + // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + // + // Attributes + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), // + make_unique(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), // + make_unique(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + make_unique>(Id, credsIssuerConfig), // + make_unique< + WriteAttributeAsComplex>>( + Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>(Id, "active-chime-sound-id", 0, UINT8_MAX, Attributes::ActiveChimeSoundId::Id, + WriteCommandType::kWrite, credsIssuerConfig), // + make_unique>(Id, "enabled", 0, 1, Attributes::Enabled::Id, WriteCommandType::kWrite, + credsIssuerConfig), // + make_unique>>( + Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, + credsIssuerConfig), // + make_unique>>( + Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, + WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), // + make_unique(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), // + make_unique(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), // + make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // + make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // + make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // + make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // + make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // + // + // Events + // + make_unique(Id, credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + }; + + commands.RegisterCluster(clusterName, clusterCommands); +} void registerClusterEcosystemInformation(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::EcosystemInformation; @@ -27028,6 +27151,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterAccountLogin(commands, credsIssuerConfig); registerClusterContentControl(commands, credsIssuerConfig); registerClusterContentAppObserver(commands, credsIssuerConfig); + registerClusterChime(commands, credsIssuerConfig); registerClusterEcosystemInformation(commands, credsIssuerConfig); registerClusterCommissionerControl(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 9a1062c23b40a0..0c7234ded5e00a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -5671,6 +5671,36 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::ContentControl::Struct ComplexArgumentParser::Finalize(request.ratingNameDesc); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, + Json::Value & value) +{ + VerifyOrReturnError(value.isObject(), CHIP_ERROR_INVALID_ARGUMENT); + + // Copy to track which members we already processed. + Json::Value valueCopy(value); + + ReturnErrorOnFailure( + ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.chimeId", "chimeId", value.isMember("chimeId"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.name", "name", value.isMember("name"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chimeId"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chimeId, value["chimeId"])); + valueCopy.removeMember("chimeId"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); + valueCopy.removeMember("name"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.chimeId); + ComplexArgumentParser::Finalize(request.name); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request, Json::Value & value) diff --git a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h index ccce33ece63cd8..90898850e7a493 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -658,6 +658,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::ContentControl: static void Finalize(chip::app::Clusters::ContentControl::Structs::RatingNameStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::Type & request, Json::Value & value); 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 05c103395826c0..4d998a0c8582f0 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -4997,6 +4997,31 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("ChimeId", indent + 1, value.chimeId); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeId'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("Name", indent + 1, value.name); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'Name'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & value) @@ -17918,6 +17943,57 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } + case Chime::Id: { + switch (path.mAttributeId) + { + case Chime::Attributes::InstalledChimeSounds::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("InstalledChimeSounds", 1, value); + } + case Chime::Attributes::ActiveChimeSoundId::Id: { + uint8_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ActiveChimeSoundId", 1, value); + } + case Chime::Attributes::Enabled::Id: { + bool value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("Enabled", 1, value); + } + case Chime::Attributes::GeneratedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, Chime::Id); + } + case Chime::Attributes::AcceptedCommandList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, Chime::Id); + } + case Chime::Attributes::EventList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("EventList", 1, value); + } + case Chime::Attributes::AttributeList::Id: { + chip::app::DataModel::DecodableList value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogAttributeId("AttributeList", 1, value, Chime::Id); + } + case Chime::Attributes::FeatureMap::Id: { + uint32_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("FeatureMap", 1, value); + } + case Chime::Attributes::ClusterRevision::Id: { + uint16_t value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("ClusterRevision", 1, value); + } + } + break; + } case EcosystemInformation::Id: { switch (path.mAttributeId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index 8ac710f0c27a0d..f880614eebaf81 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -404,6 +404,9 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ContentControl::Structs::RatingNameStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Chime::Structs::ChimeSoundStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::EcosystemInformation::Structs::EcosystemDeviceStruct::DecodableType & 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 73c5f1ef371fa5..7eb6aaafdcc4a2 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -259,6 +259,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "ContentControl"; case chip::app::Clusters::ContentAppObserver::Id: return "ContentAppObserver"; + case chip::app::Clusters::Chime::Id: + return "Chime"; case chip::app::Clusters::EcosystemInformation::Id: return "EcosystemInformation"; case chip::app::Clusters::CommissionerControl::Id: @@ -4375,6 +4377,31 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } + case chip::app::Clusters::Chime::Id: { + switch (id) + { + case chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::Id: + return "InstalledChimeSounds"; + case chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id: + return "ActiveChimeSoundId"; + case chip::app::Clusters::Chime::Attributes::Enabled::Id: + return "Enabled"; + case chip::app::Clusters::Chime::Attributes::GeneratedCommandList::Id: + return "GeneratedCommandList"; + case chip::app::Clusters::Chime::Attributes::AcceptedCommandList::Id: + return "AcceptedCommandList"; + case chip::app::Clusters::Chime::Attributes::EventList::Id: + return "EventList"; + case chip::app::Clusters::Chime::Attributes::AttributeList::Id: + return "AttributeList"; + case chip::app::Clusters::Chime::Attributes::FeatureMap::Id: + return "FeatureMap"; + case chip::app::Clusters::Chime::Attributes::ClusterRevision::Id: + return "ClusterRevision"; + default: + return "Unknown"; + } + } case chip::app::Clusters::EcosystemInformation::Id: { switch (id) { @@ -5701,6 +5728,15 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } + case chip::app::Clusters::Chime::Id: { + switch (id) + { + case chip::app::Clusters::Chime::Commands::PlayChimeSound::Id: + return "PlayChimeSound"; + default: + return "Unknown"; + } + } case chip::app::Clusters::CommissionerControl::Id: { switch (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 21b8385bdd0004..f88caca98d927a 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -154,6 +154,7 @@ | AccountLogin | 0x050E | | ContentControl | 0x050F | | ContentAppObserver | 0x0510 | +| Chime | 0x0556 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | | UnitTesting | 0xFFF1FC05| @@ -160028,6 +160029,922 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr } }; +#endif // MTR_ENABLE_PROVISIONAL +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL +/*----------------------------------------------------------------------------*\ +| Cluster Chime | 0x0556 | +|------------------------------------------------------------------------------| +| Commands: | | +| * PlayChimeSound | 0x00 | +|------------------------------------------------------------------------------| +| Attributes: | | +| * InstalledChimeSounds | 0x0000 | +| * ActiveChimeSoundId | 0x0001 | +| * Enabled | 0x0002 | +| * GeneratedCommandList | 0xFFF8 | +| * AcceptedCommandList | 0xFFF9 | +| * EventList | 0xFFFA | +| * AttributeList | 0xFFFB | +| * FeatureMap | 0xFFFC | +| * ClusterRevision | 0xFFFD | +|------------------------------------------------------------------------------| +| Events: | | +\*----------------------------------------------------------------------------*/ + +#if MTR_ENABLE_PROVISIONAL +/* + * Command PlayChimeSound + */ +class ChimePlayChimeSound : public ClusterCommand { +public: + ChimePlayChimeSound() + : ClusterCommand("play-chime-sound") + { + ClusterCommand::AddArguments(); + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Chime::Commands::PlayChimeSound::Id; + + ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointId); + + dispatch_queue_t callbackQueue = dispatch_queue_create("com.chip.command", DISPATCH_QUEUE_SERIAL); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + __auto_type * params = [[MTRChimeClusterPlayChimeSoundParams alloc] init]; + params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; + uint16_t repeatCount = mRepeatCount.ValueOr(1); + uint16_t __block responsesNeeded = repeatCount; + while (repeatCount--) { + [cluster playChimeSoundWithParams:params completion: + ^(NSError * _Nullable error) { + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(commandId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; + } + return CHIP_NO_ERROR; + } + +private: +}; + +#endif // MTR_ENABLE_PROVISIONAL + +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute InstalledChimeSounds + */ +class ReadChimeInstalledChimeSounds : public ReadAttribute { +public: + ReadChimeInstalledChimeSounds() + : ReadAttribute("installed-chime-sounds") + { + } + + ~ReadChimeInstalledChimeSounds() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeInstalledChimeSoundsWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.InstalledChimeSounds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime InstalledChimeSounds read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeInstalledChimeSounds : public SubscribeAttribute { +public: + SubscribeAttributeChimeInstalledChimeSounds() + : SubscribeAttribute("installed-chime-sounds") + { + } + + ~SubscribeAttributeChimeInstalledChimeSounds() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeInstalledChimeSoundsWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.InstalledChimeSounds response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ActiveChimeSoundId + */ +class ReadChimeActiveChimeSoundId : public ReadAttribute { +public: + ReadChimeActiveChimeSoundId() + : ReadAttribute("active-chime-sound-id") + { + } + + ~ReadChimeActiveChimeSoundId() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeActiveChimeSoundIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime ActiveChimeSoundId read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteChimeActiveChimeSoundId : public WriteAttribute { +public: + WriteChimeActiveChimeSoundId() + : WriteAttribute("active-chime-sound-id") + { + AddArgument("attr-name", "active-chime-sound-id"); + AddArgument("attr-value", 0, UINT8_MAX, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteChimeActiveChimeSoundId() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::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); + __auto_type * cluster = [[MTRBaseClusterChime 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; + NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; + + [cluster writeAttributeActiveChimeSoundIdWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("Chime ActiveChimeSoundId write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + uint8_t mValue; +}; + +class SubscribeAttributeChimeActiveChimeSoundId : public SubscribeAttribute { +public: + SubscribeAttributeChimeActiveChimeSoundId() + : SubscribeAttribute("active-chime-sound-id") + { + } + + ~SubscribeAttributeChimeActiveChimeSoundId() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeActiveChimeSoundIdWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute Enabled + */ +class ReadChimeEnabled : public ReadAttribute { +public: + ReadChimeEnabled() + : ReadAttribute("enabled") + { + } + + ~ReadChimeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEnabledWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.Enabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime Enabled read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class WriteChimeEnabled : public WriteAttribute { +public: + WriteChimeEnabled() + : WriteAttribute("enabled") + { + AddArgument("attr-name", "enabled"); + AddArgument("attr-value", 0, 1, &mValue); + WriteAttribute::AddArguments(); + } + + ~WriteChimeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::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); + __auto_type * cluster = [[MTRBaseClusterChime 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; + NSNumber * _Nonnull value = [NSNumber numberWithBool:mValue]; + + [cluster writeAttributeEnabledWithValue:value params:params completion:^(NSError * _Nullable error) { + if (error != nil) { + LogNSError("Chime Enabled write Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } + +private: + bool mValue; +}; + +class SubscribeAttributeChimeEnabled : public SubscribeAttribute { +public: + SubscribeAttributeChimeEnabled() + : SubscribeAttribute("enabled") + { + } + + ~SubscribeAttributeChimeEnabled() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::Enabled::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeEnabledWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.Enabled response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute GeneratedCommandList + */ +class ReadChimeGeneratedCommandList : public ReadAttribute { +public: + ReadChimeGeneratedCommandList() + : ReadAttribute("generated-command-list") + { + } + + ~ReadChimeGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::GeneratedCommandList::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeGeneratedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime GeneratedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeGeneratedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeChimeGeneratedCommandList() + : SubscribeAttribute("generated-command-list") + { + } + + ~SubscribeAttributeChimeGeneratedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::GeneratedCommandList::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeGeneratedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.GeneratedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AcceptedCommandList + */ +class ReadChimeAcceptedCommandList : public ReadAttribute { +public: + ReadChimeAcceptedCommandList() + : ReadAttribute("accepted-command-list") + { + } + + ~ReadChimeAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::AcceptedCommandList::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAcceptedCommandListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime AcceptedCommandList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeAcceptedCommandList : public SubscribeAttribute { +public: + SubscribeAttributeChimeAcceptedCommandList() + : SubscribeAttribute("accepted-command-list") + { + } + + ~SubscribeAttributeChimeAcceptedCommandList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::AcceptedCommandList::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeAcceptedCommandListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.AcceptedCommandList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute EventList + */ +class ReadChimeEventList : public ReadAttribute { +public: + ReadChimeEventList() + : ReadAttribute("event-list") + { + } + + ~ReadChimeEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::EventList::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeEventListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime EventList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeEventList : public SubscribeAttribute { +public: + SubscribeAttributeChimeEventList() + : SubscribeAttribute("event-list") + { + } + + ~SubscribeAttributeChimeEventList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::EventList::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeEventListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.EventList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute AttributeList + */ +class ReadChimeAttributeList : public ReadAttribute { +public: + ReadChimeAttributeList() + : ReadAttribute("attribute-list") + { + } + + ~ReadChimeAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::AttributeList::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeAttributeListWithCompletion:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime AttributeList read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeAttributeList : public SubscribeAttribute { +public: + SubscribeAttributeChimeAttributeList() + : SubscribeAttribute("attribute-list") + { + } + + ~SubscribeAttributeChimeAttributeList() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::AttributeList::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeAttributeListWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSArray * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.AttributeList response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute FeatureMap + */ +class ReadChimeFeatureMap : public ReadAttribute { +public: + ReadChimeFeatureMap() + : ReadAttribute("feature-map") + { + } + + ~ReadChimeFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::FeatureMap::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeFeatureMapWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime FeatureMap read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeFeatureMap : public SubscribeAttribute { +public: + SubscribeAttributeChimeFeatureMap() + : SubscribeAttribute("feature-map") + { + } + + ~SubscribeAttributeChimeFeatureMap() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::FeatureMap::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeFeatureMapWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.FeatureMap response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + +/* + * Attribute ClusterRevision + */ +class ReadChimeClusterRevision : public ReadAttribute { +public: + ReadChimeClusterRevision() + : ReadAttribute("cluster-revision") + { + } + + ~ReadChimeClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ClusterRevision::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); + __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; + [cluster readAttributeClusterRevisionWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + LogNSError("Chime ClusterRevision read Error", error); + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + return CHIP_NO_ERROR; + } +}; + +class SubscribeAttributeChimeClusterRevision : public SubscribeAttribute { +public: + SubscribeAttributeChimeClusterRevision() + : SubscribeAttribute("cluster-revision") + { + } + + ~SubscribeAttributeChimeClusterRevision() + { + } + + CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override + { + constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ClusterRevision::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); + __auto_type * cluster = [[MTRBaseClusterChime 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 subscribeAttributeClusterRevisionWithParams:params + subscriptionEstablished:^() { mSubscriptionEstablished = YES; } + reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.ClusterRevision response %@", [value description]); + if (error == nil) { + RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); + } else { + RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); + } + SetCommandExitStatus(error); + }]; + + return CHIP_NO_ERROR; + } +}; + #endif // MTR_ENABLE_PROVISIONAL #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL @@ -183018,6 +183935,64 @@ void registerClusterContentAppObserver(Commands & commands) commands.RegisterCluster(clusterName, clusterCommands); #endif // MTR_ENABLE_PROVISIONAL } +void registerClusterChime(Commands & commands) +{ +#if MTR_ENABLE_PROVISIONAL + using namespace chip::app::Clusters::Chime; + + const char * clusterName = "Chime"; + + commands_list clusterCommands = { + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + make_unique(Id), // + make_unique(Id), // + make_unique(Id), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL + }; + + commands.RegisterCluster(clusterName, clusterCommands); +#endif // MTR_ENABLE_PROVISIONAL +} void registerClusterEcosystemInformation(Commands & commands) { #if MTR_ENABLE_PROVISIONAL @@ -183658,6 +184633,7 @@ void registerClusters(Commands & commands) registerClusterAccountLogin(commands); registerClusterContentControl(commands); registerClusterContentAppObserver(commands); + registerClusterChime(commands); registerClusterEcosystemInformation(commands); registerClusterCommissionerControl(commands); registerClusterUnitTesting(commands); From 0f8fc7ec2d122d75e8963bcd016b28a50d08c3f2 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:46:48 -0600 Subject: [PATCH 4/9] Add cluster apiMaturity & description --- src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml index 1a9e9bad409fc1..b24677652331e1 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml @@ -28,12 +28,12 @@ Git: 0.7-fall2024-ncr-1158-g413e195c2 - + Chime 0x0556 CHIME_CLUSTER - + This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. true true From 29cc834fa8f8adea5f877b92631a20d2a9096c55 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 26 Sep 2024 21:48:57 +0000 Subject: [PATCH 5/9] Restyled by whitespace --- src/app/zap-templates/zcl/zcl-with-test-extensions.json | 2 +- src/app/zap-templates/zcl/zcl.json | 2 +- src/app/zap_cluster_list.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 38b74ff15dcc86..346f1b5df259c5 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -760,4 +760,4 @@ "uiOptions": { "showProfileId": false } -} \ No newline at end of file +} diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index eec9804fe01d36..02fea20f55f98d 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -758,4 +758,4 @@ "uiOptions": { "showProfileId": false } -} \ No newline at end of file +} diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 76115ce4348c32..14ce1447d35720 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -484,4 +484,4 @@ "mode-base-server" ] } -} \ No newline at end of file +} From 75461e50dcec48c5c36850645e559ae4cf3913d3 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Thu, 26 Sep 2024 21:49:00 +0000 Subject: [PATCH 6/9] Restyled by prettier-json --- .../zcl/zcl-with-test-extensions.json | 109 ++---- src/app/zap-templates/zcl/zcl.json | 115 ++---- src/app/zap_cluster_list.json | 336 +++++------------- 3 files changed, 127 insertions(+), 433 deletions(-) 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 346f1b5df259c5..5e058b50f1eb4f 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -143,15 +143,9 @@ "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { "text": { - "defaultResponsePolicy": [ - "Always", - "Conditional", - "Never" - ] + "defaultResponsePolicy": ["Always", "Conditional", "Never"] }, - "bool": [ - "commandDiscovery" - ] + "bool": ["commandDiscovery"] }, "defaults": { "text": { @@ -197,13 +191,8 @@ "SpecificationVersion", "MaxPathsPerInvoke" ], - "Bridged Device Basic Information": [ - "ProductAppearance" - ], - "Descriptor": [ - "ClusterRevision", - "FeatureMap" - ], + "Bridged Device Basic Information": ["ProductAppearance"], + "Descriptor": ["ClusterRevision", "FeatureMap"], "Device Energy Management": [ "ESAType", "ESACanGenerate", @@ -255,11 +244,7 @@ "SessionEnergyDischarged", "FeatureMap" ], - "Energy EVSE Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "Energy EVSE Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", @@ -304,11 +289,7 @@ "ClientsSupportedPerFabric", "MaximumCheckInBackOff" ], - "Occupancy Sensing": [ - "HoldTimeLimits", - "HoldTime", - "FeatureMap" - ], + "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ "SupportedFabrics", "CommissionedFabrics", @@ -415,21 +396,14 @@ "CurrentMaxRate", "OverrunCount" ], - "Channel": [ - "Lineup", - "CurrentChannel" - ], + "Channel": ["Lineup", "CurrentChannel"], "Media Playback": [ "SampledPosition", "ActiveAudioTrack", "ActiveTextTrack" ], - "Application Launcher": [ - "CurrentApp" - ], - "Application Basic": [ - "Application" - ], + "Application Launcher": ["CurrentApp"], + "Application Basic": ["Application"], "Time Synchronization": [ "TrustedTimeSource", "DefaultNTP", @@ -441,9 +415,7 @@ "TimeZoneListMaxSize", "DSTOffsetListMaxSize" ], - "Temperature Control": [ - "SupportedTemperatureLevels" - ], + "Temperature Control": ["SupportedTemperatureLevels"], "Dishwasher Mode": [ "SupportedModes", "CurrentMode", @@ -451,11 +423,7 @@ "OnMode", "FeatureMap" ], - "Microwave Oven Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "Microwave Oven Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Microwave Oven Control": [ "CookTime", "MaxCookTime", @@ -482,16 +450,8 @@ "OnMode", "FeatureMap" ], - "RVC Clean Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], - "RVC Run Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "RVC Clean Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "RVC Run Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Operational State": [ "OperationalState", "OperationalError", @@ -668,10 +628,7 @@ "LevelValue", "FeatureMap" ], - "Air Quality": [ - "AirQuality", - "FeatureMap" - ], + "Air Quality": ["AirQuality", "FeatureMap"], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", @@ -703,15 +660,9 @@ "NeutralCurrent", "FeatureMap" ], - "Power Topology": [ - "FeatureMap" - ], - "Valve Configuration and Control": [ - "RemainingDuration" - ], - "Boolean State Configuration": [ - "CurrentSensitivityLevel" - ], + "Power Topology": ["FeatureMap"], + "Valve Configuration and Control": ["RemainingDuration"], + "Boolean State Configuration": ["CurrentSensitivityLevel"], "Water Heater Management": [ "HeaterTypes", "HeatDemand", @@ -722,35 +673,17 @@ "FeatureMap", "ClusterRevision" ], - "Water Heater Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], - "Wi-Fi Network Management": [ - "SSID", - "PassphraseSurrogate" - ], + "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], "Thread Network Directory": [ "PreferredExtendedPanID", "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": [ - "CurrentArea", - "EstimatedEndTime", - "FeatureMap" - ] + "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] }, "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": [ - "ARRAY", - "BITMAP", - "ENUM", - "NUMBER", - "STRING", - "STRUCT" - ], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index 02fea20f55f98d..d9604efd14b78b 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -3,11 +3,7 @@ "category": "matter", "version": 1, "requiredFeatureLevel": 102, - "xmlRoot": [ - ".", - "./data-model/chip/", - "./data-model/silabs/" - ], + "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", @@ -141,15 +137,9 @@ "manufacturersXml": "../../../../src/app/zap-templates/zcl/data-model/manufacturers.xml", "options": { "text": { - "defaultResponsePolicy": [ - "Always", - "Conditional", - "Never" - ] + "defaultResponsePolicy": ["Always", "Conditional", "Never"] }, - "bool": [ - "commandDiscovery" - ] + "bool": ["commandDiscovery"] }, "defaults": { "text": { @@ -195,13 +185,8 @@ "SpecificationVersion", "MaxPathsPerInvoke" ], - "Bridged Device Basic Information": [ - "ProductAppearance" - ], - "Descriptor": [ - "ClusterRevision", - "FeatureMap" - ], + "Bridged Device Basic Information": ["ProductAppearance"], + "Descriptor": ["ClusterRevision", "FeatureMap"], "Device Energy Management": [ "ESAType", "ESACanGenerate", @@ -253,11 +238,7 @@ "SessionEnergyDischarged", "FeatureMap" ], - "Energy EVSE Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "Energy EVSE Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Ethernet Network Diagnostics": [ "PHYRate", "FullDuplex", @@ -302,11 +283,7 @@ "ClientsSupportedPerFabric", "MaximumCheckInBackOff" ], - "Occupancy Sensing": [ - "HoldTimeLimits", - "HoldTime", - "FeatureMap" - ], + "Occupancy Sensing": ["HoldTimeLimits", "HoldTime", "FeatureMap"], "Operational Credentials": [ "SupportedFabrics", "CommissionedFabrics", @@ -413,21 +390,14 @@ "CurrentMaxRate", "OverrunCount" ], - "Channel": [ - "Lineup", - "CurrentChannel" - ], + "Channel": ["Lineup", "CurrentChannel"], "Media Playback": [ "SampledPosition", "ActiveAudioTrack", "ActiveTextTrack" ], - "Application Launcher": [ - "CurrentApp" - ], - "Application Basic": [ - "Application" - ], + "Application Launcher": ["CurrentApp"], + "Application Basic": ["Application"], "Time Synchronization": [ "TrustedTimeSource", "DefaultNTP", @@ -439,9 +409,7 @@ "TimeZoneListMaxSize", "DSTOffsetListMaxSize" ], - "Temperature Control": [ - "SupportedTemperatureLevels" - ], + "Temperature Control": ["SupportedTemperatureLevels"], "Dishwasher Mode": [ "SupportedModes", "CurrentMode", @@ -449,11 +417,7 @@ "OnMode", "FeatureMap" ], - "Microwave Oven Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "Microwave Oven Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Microwave Oven Control": [ "CookTime", "MaxCookTime", @@ -480,16 +444,8 @@ "OnMode", "FeatureMap" ], - "RVC Clean Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], - "RVC Run Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], + "RVC Clean Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "RVC Run Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], "Operational State": [ "OperationalState", "OperationalError", @@ -666,10 +622,7 @@ "LevelValue", "FeatureMap" ], - "Air Quality": [ - "AirQuality", - "FeatureMap" - ], + "Air Quality": ["AirQuality", "FeatureMap"], "Electrical Energy Measurement": [ "Accuracy", "CumulativeEnergyImported", @@ -701,15 +654,9 @@ "NeutralCurrent", "FeatureMap" ], - "Power Topology": [ - "FeatureMap" - ], - "Valve Configuration and Control": [ - "RemainingDuration" - ], - "Boolean State Configuration": [ - "CurrentSensitivityLevel" - ], + "Power Topology": ["FeatureMap"], + "Valve Configuration and Control": ["RemainingDuration"], + "Boolean State Configuration": ["CurrentSensitivityLevel"], "Water Heater Management": [ "HeaterTypes", "HeatDemand", @@ -720,35 +667,17 @@ "FeatureMap", "ClusterRevision" ], - "Water Heater Mode": [ - "SupportedModes", - "CurrentMode", - "FeatureMap" - ], - "Wi-Fi Network Management": [ - "SSID", - "PassphraseSurrogate" - ], + "Water Heater Mode": ["SupportedModes", "CurrentMode", "FeatureMap"], + "Wi-Fi Network Management": ["SSID", "PassphraseSurrogate"], "Thread Network Directory": [ "PreferredExtendedPanID", "ThreadNetworks", "ThreadNetworkTableSize" ], - "Service Area": [ - "CurrentArea", - "EstimatedEndTime", - "FeatureMap" - ] + "Service Area": ["CurrentArea", "EstimatedEndTime", "FeatureMap"] }, "defaultReportingPolicy": "mandatory", - "ZCLDataTypes": [ - "ARRAY", - "BITMAP", - "ENUM", - "NUMBER", - "STRING", - "STRUCT" - ], + "ZCLDataTypes": ["ARRAY", "BITMAP", "ENUM", "NUMBER", "STRING", "STRUCT"], "fabricHandling": { "automaticallyCreateFields": true, "indexFieldId": 254, diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index 14ce1447d35720..fa76c0e9a2f767 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -111,9 +111,7 @@ "TARGET_NAVIGATOR_CLUSTER": [], "TEMPERATURE_CONTROL_CLUSTER": [], "TEMPERATURE_MEASUREMENT_CLUSTER": [], - "THERMOSTAT_CLUSTER": [ - "thermostat-client" - ], + "THERMOSTAT_CLUSTER": ["thermostat-client"], "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [], "THREAD_BORDER_ROUTER_MANAGEMENT_CLUSTER": [], "THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [], @@ -137,12 +135,8 @@ "WINDOW_COVERING_CLUSTER": [] }, "ServerDirectories": { - "ACCESS_CONTROL_CLUSTER": [ - "access-control-server" - ], - "ACCOUNT_LOGIN_CLUSTER": [ - "account-login-server" - ], + "ACCESS_CONTROL_CLUSTER": ["access-control-server"], + "ACCOUNT_LOGIN_CLUSTER": ["account-login-server"], "ACTIONS_CLUSTER": [], "ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER": [ "resource-monitoring-server" @@ -150,26 +144,14 @@ "ADMINISTRATOR_COMMISSIONING_CLUSTER": [ "administrator-commissioning-server" ], - "AIR_QUALITY_CLUSTER": [ - "air-quality-server" - ], + "AIR_QUALITY_CLUSTER": ["air-quality-server"], "ALARM_CLUSTER": [], - "APPLICATION_BASIC_CLUSTER": [ - "application-basic-server" - ], - "APPLICATION_LAUNCHER_CLUSTER": [ - "application-launcher-server" - ], - "AUDIO_OUTPUT_CLUSTER": [ - "audio-output-server" - ], + "APPLICATION_BASIC_CLUSTER": ["application-basic-server"], + "APPLICATION_LAUNCHER_CLUSTER": ["application-launcher-server"], + "AUDIO_OUTPUT_CLUSTER": ["audio-output-server"], "BALLAST_CONFIGURATION_CLUSTER": [], - "BASIC_INFORMATION_CLUSTER": [ - "basic-information" - ], - "BINDING_CLUSTER": [ - "bindings" - ], + "BASIC_INFORMATION_CLUSTER": ["basic-information"], + "BINDING_CLUSTER": ["bindings"], "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [ "boolean-state-configuration-server" @@ -183,177 +165,79 @@ "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "CHANNEL_CLUSTER": [ - "channel-server" - ], + "CHANNEL_CLUSTER": ["channel-server"], "CHIME_CLUSTER": [], - "COLOR_CONTROL_CLUSTER": [ - "color-control-server" - ], - "COMMISSIONER_CONTROL_CLUSTER": [ - "commissioner-control-server" - ], + "COLOR_CONTROL_CLUSTER": ["color-control-server"], + "COMMISSIONER_CONTROL_CLUSTER": ["commissioner-control-server"], "COMMISSIONING_CLUSTER": [], - "CONTENT_LAUNCHER_CLUSTER": [ - "content-launch-server" - ], - "CONTENT_CONTROL_CLUSTER": [ - "content-control-server" - ], - "CONTENT_APP_OBSERVER_CLUSTER": [ - "content-app-observer" - ], - "DESCRIPTOR_CLUSTER": [ - "descriptor" - ], - "DEVICE_ENERGY_MANAGEMENT_CLUSTER": [ - "device-energy-management-server" - ], - "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER": [ - "mode-base-server" - ], + "CONTENT_LAUNCHER_CLUSTER": ["content-launch-server"], + "CONTENT_CONTROL_CLUSTER": ["content-control-server"], + "CONTENT_APP_OBSERVER_CLUSTER": ["content-app-observer"], + "DESCRIPTOR_CLUSTER": ["descriptor"], + "DEVICE_ENERGY_MANAGEMENT_CLUSTER": ["device-energy-management-server"], + "DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER": ["mode-base-server"], "DEVICE_TEMP_CLUSTER": [], - "DIAGNOSTIC_LOGS_CLUSTER": [ - "diagnostic-logs-server" - ], - "DISHWASHER_ALARM_CLUSTER": [ - "dishwasher-alarm-server" - ], - "DISHWASHER_MODE_CLUSTER": [ - "mode-base-server" - ], - "MICROWAVE_OVEN_MODE_CLUSTER": [ - "mode-base-server" - ], - "DOOR_LOCK_CLUSTER": [ - "door-lock-server" - ], - "ECOSYSTEM_INFORMATION_CLUSTER": [ - "ecosystem-information-server" - ], + "DIAGNOSTIC_LOGS_CLUSTER": ["diagnostic-logs-server"], + "DISHWASHER_ALARM_CLUSTER": ["dishwasher-alarm-server"], + "DISHWASHER_MODE_CLUSTER": ["mode-base-server"], + "MICROWAVE_OVEN_MODE_CLUSTER": ["mode-base-server"], + "DOOR_LOCK_CLUSTER": ["door-lock-server"], + "ECOSYSTEM_INFORMATION_CLUSTER": ["ecosystem-information-server"], "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [ "electrical-energy-measurement-server" ], "ELECTRICAL_POWER_MEASUREMENT_CLUSTER": [ "electrical-power-measurement-server" ], - "ENERGY_EVSE_CLUSTER": [ - "energy-evse-server" - ], - "ENERGY_EVSE_MODE_CLUSTER": [ - "mode-base-server" - ], + "ENERGY_EVSE_CLUSTER": ["energy-evse-server"], + "ENERGY_EVSE_MODE_CLUSTER": ["mode-base-server"], "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER": [ "ethernet-network-diagnostics-server" ], - "ENERGY_PREFERENCE_CLUSTER": [ - "energy-preference-server" - ], - "FAN_CONTROL_CLUSTER": [ - "fan-control-server" - ], - "FAULT_INJECTION_CLUSTER": [ - "fault-injection-server" - ], - "FIXED_LABEL_CLUSTER": [ - "fixed-label-server" - ], + "ENERGY_PREFERENCE_CLUSTER": ["energy-preference-server"], + "FAN_CONTROL_CLUSTER": ["fan-control-server"], + "FAULT_INJECTION_CLUSTER": ["fault-injection-server"], + "FIXED_LABEL_CLUSTER": ["fixed-label-server"], "FLOW_MEASUREMENT_CLUSTER": [], "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "GENERAL_COMMISSIONING_CLUSTER": [ - "general-commissioning-server" - ], - "GENERAL_DIAGNOSTICS_CLUSTER": [ - "general-diagnostics-server" - ], - "GROUPS_CLUSTER": [ - "groups-server" - ], - "HEPA_FILTER_MONITORING_CLUSTER": [ - "resource-monitoring-server" - ], - "GROUP_KEY_MANAGEMENT_CLUSTER": [ - "group-key-mgmt-server" - ], - "ICD_MANAGEMENT_CLUSTER": [ - "icd-management-server" - ], - "IDENTIFY_CLUSTER": [ - "identify-server" - ], + "GENERAL_COMMISSIONING_CLUSTER": ["general-commissioning-server"], + "GENERAL_DIAGNOSTICS_CLUSTER": ["general-diagnostics-server"], + "GROUPS_CLUSTER": ["groups-server"], + "HEPA_FILTER_MONITORING_CLUSTER": ["resource-monitoring-server"], + "GROUP_KEY_MANAGEMENT_CLUSTER": ["group-key-mgmt-server"], + "ICD_MANAGEMENT_CLUSTER": ["icd-management-server"], + "IDENTIFY_CLUSTER": ["identify-server"], "ILLUMINANCE_MEASUREMENT_CLUSTER": [], - "KEYPAD_INPUT_CLUSTER": [ - "keypad-input-server" - ], - "LAUNDRY_WASHER_MODE_CLUSTER": [ - "mode-base-server" - ], - "LEVEL_CONTROL_CLUSTER": [ - "level-control" - ], + "KEYPAD_INPUT_CLUSTER": ["keypad-input-server"], + "LAUNDRY_WASHER_MODE_CLUSTER": ["mode-base-server"], + "LEVEL_CONTROL_CLUSTER": ["level-control"], "LOCALIZATION_CONFIGURATION_CLUSTER": [ "localization-configuration-server" ], - "LOW_POWER_CLUSTER": [ - "low-power-server" - ], - "MEDIA_INPUT_CLUSTER": [ - "media-input-server" - ], - "MEDIA_PLAYBACK_CLUSTER": [ - "media-playback-server" - ], - "MICROWAVE_OVEN_CONTROL_CLUSTER": [ - "microwave-oven-control-server" - ], - "MESSAGES_CLUSTER": [ - "messages-server" - ], - "MODE_SELECT_CLUSTER": [ - "mode-select-server" - ], - "NETWORK_COMMISSIONING_CLUSTER": [ - "network-commissioning" - ], + "LOW_POWER_CLUSTER": ["low-power-server"], + "MEDIA_INPUT_CLUSTER": ["media-input-server"], + "MEDIA_PLAYBACK_CLUSTER": ["media-playback-server"], + "MICROWAVE_OVEN_CONTROL_CLUSTER": ["microwave-oven-control-server"], + "MESSAGES_CLUSTER": ["messages-server"], + "MODE_SELECT_CLUSTER": ["mode-select-server"], + "NETWORK_COMMISSIONING_CLUSTER": ["network-commissioning"], "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "SAMPLE_MEI_CLUSTER": [ - "sample-mei-server" - ], - "OCCUPANCY_SENSING_CLUSTER": [ - "occupancy-sensor-server" - ], - "ON_OFF_CLUSTER": [ - "on-off-server" - ], - "POWER_TOPOLOGY_CLUSTER": [ - "power-topology-server" - ], - "OPERATIONAL_CREDENTIALS_CLUSTER": [ - "operational-credentials-server" - ], - "OPERATIONAL_STATE_CLUSTER": [ - "operational-state-server" - ], - "OPERATIONAL_STATE_OVEN_CLUSTER": [ - "operational-state-server" - ], - "OPERATIONAL_STATE_RVC_CLUSTER": [ - "operational-state-server" - ], + "SAMPLE_MEI_CLUSTER": ["sample-mei-server"], + "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], + "ON_OFF_CLUSTER": ["on-off-server"], + "POWER_TOPOLOGY_CLUSTER": ["power-topology-server"], + "OPERATIONAL_CREDENTIALS_CLUSTER": ["operational-credentials-server"], + "OPERATIONAL_STATE_CLUSTER": ["operational-state-server"], + "OPERATIONAL_STATE_OVEN_CLUSTER": ["operational-state-server"], + "OPERATIONAL_STATE_RVC_CLUSTER": ["operational-state-server"], "OTA_BOOTLOAD_CLUSTER": [], - "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": [ - "ota-provider" - ], - "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": [ - "ota-requestor" - ], - "OVEN_MODE_CLUSTER": [ - "mode-base-server" - ], + "OTA_SOFTWARE_UPDATE_PROVIDER_CLUSTER": ["ota-provider"], + "OTA_SOFTWARE_UPDATE_REQUESTOR_CLUSTER": ["ota-requestor"], + "OVEN_MODE_CLUSTER": ["mode-base-server"], "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], @@ -369,9 +253,7 @@ "POLL_CONTROL_CLUSTER": [], "POWER_CONFIG_CLUSTER": [], "POWER_PROFILE_CLUSTER": [], - "POWER_SOURCE_CLUSTER": [ - "power-source-server" - ], + "POWER_SOURCE_CLUSTER": ["power-source-server"], "POWER_SOURCE_CONFIGURATION_CLUSTER": [ "power-source-configuration-server" ], @@ -386,44 +268,22 @@ "RADON_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], - "REFRIGERATOR_ALARM_CLUSTER": [ - "refrigerator-alarm-server" - ], + "REFRIGERATOR_ALARM_CLUSTER": ["refrigerator-alarm-server"], "REFRIGERATOR_AND_TEMPERATURE_CONTROLLED_CABINET_MODE_CLUSTER": [ "mode-base-server" ], "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER": [], - "RVC_CLEAN_MODE_CLUSTER": [ - "mode-base-server" - ], - "RVC_RUN_MODE_CLUSTER": [ - "mode-base-server" - ], - "SCENES_CLUSTER": [ - "scenes-server" - ], - "SERVICE_AREA_CLUSTER": [ - "service-area-server" - ], - "SMOKE_CO_ALARM_CLUSTER": [ - "smoke-co-alarm-server" - ], - "SOFTWARE_DIAGNOSTICS_CLUSTER": [ - "software-diagnostics-server" - ], - "SWITCH_CLUSTER": [ - "switch-server" - ], - "TARGET_NAVIGATOR_CLUSTER": [ - "target-navigator-server" - ], - "TEMPERATURE_CONTROL_CLUSTER": [ - "temperature-control-server" - ], + "RVC_CLEAN_MODE_CLUSTER": ["mode-base-server"], + "RVC_RUN_MODE_CLUSTER": ["mode-base-server"], + "SCENES_CLUSTER": ["scenes-server"], + "SERVICE_AREA_CLUSTER": ["service-area-server"], + "SMOKE_CO_ALARM_CLUSTER": ["smoke-co-alarm-server"], + "SOFTWARE_DIAGNOSTICS_CLUSTER": ["software-diagnostics-server"], + "SWITCH_CLUSTER": ["switch-server"], + "TARGET_NAVIGATOR_CLUSTER": ["target-navigator-server"], + "TEMPERATURE_CONTROL_CLUSTER": ["temperature-control-server"], "TEMPERATURE_MEASUREMENT_CLUSTER": [], - "THERMOSTAT_CLUSTER": [ - "thermostat-server" - ], + "THERMOSTAT_CLUSTER": ["thermostat-server"], "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER": [ "thermostat-user-interface-configuration-server" ], @@ -433,55 +293,27 @@ "THREAD_NETWORK_DIAGNOSTICS_CLUSTER": [ "thread-network-diagnostics-server" ], - "THREAD_NETWORK_DIRECTORY_CLUSTER": [ - "thread-network-directory-server" - ], + "THREAD_NETWORK_DIRECTORY_CLUSTER": ["thread-network-directory-server"], "TIME_CLUSTER": [], - "TIME_FORMAT_LOCALIZATION_CLUSTER": [ - "time-format-localization-server" - ], - "TIME_SYNCHRONIZATION_CLUSTER": [ - "time-synchronization-server" - ], - "TIMER_CLUSTER": [ - "timer-server" - ], + "TIME_FORMAT_LOCALIZATION_CLUSTER": ["time-format-localization-server"], + "TIME_SYNCHRONIZATION_CLUSTER": ["time-synchronization-server"], + "TIMER_CLUSTER": ["timer-server"], "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER": [ "concentration-measurement-server" ], "UNIT_LOCALIZATION_CLUSTER": [], - "UNIT_TESTING_CLUSTER": [ - "test-cluster-server" - ], - "USER_LABEL_CLUSTER": [ - "user-label-server" - ], + "UNIT_TESTING_CLUSTER": ["test-cluster-server"], + "USER_LABEL_CLUSTER": ["user-label-server"], "VALVE_CONFIGURATION_AND_CONTROL_CLUSTER": [ "valve-configuration-and-control-server" ], - "WAKE_ON_LAN_CLUSTER": [ - "wake-on-lan-server" - ], - "LAUNDRY_WASHER_CONTROLS_CLUSTER": [ - "laundry-washer-controls-server" - ], - "LAUNDRY_DRYER_CONTROLS_CLUSTER": [ - "laundry-dryer-controls-server" - ], - "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [ - "wifi-network-diagnostics-server" - ], - "WIFI_NETWORK_MANAGEMENT_CLUSTER": [ - "wifi-network-management-server" - ], - "WINDOW_COVERING_CLUSTER": [ - "window-covering-server" - ], - "WATER_HEATER_MANAGEMENT_CLUSTER": [ - "water-heater-management-server" - ], - "WATER_HEATER_MODE_CLUSTER": [ - "mode-base-server" - ] + "WAKE_ON_LAN_CLUSTER": ["wake-on-lan-server"], + "LAUNDRY_WASHER_CONTROLS_CLUSTER": ["laundry-washer-controls-server"], + "LAUNDRY_DRYER_CONTROLS_CLUSTER": ["laundry-dryer-controls-server"], + "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": ["wifi-network-diagnostics-server"], + "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], + "WINDOW_COVERING_CLUSTER": ["window-covering-server"], + "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], + "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"] } } From 1e9ccfd301a19a7c836e48f93998739b0c829073 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:52:55 -0600 Subject: [PATCH 7/9] Generated using ./scripts/tools/zap_regen_all.py --- src/controller/data_model/controller-clusters.matter | 4 ++-- src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h | 2 +- src/darwin/Framework/CHIP/zap-generated/MTRClusters.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 9502c371cbf23c..b265d1d5f7380c 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9408,8 +9408,8 @@ provisional cluster ContentAppObserver = 1296 { command ContentAppMessage(ContentAppMessageRequest): ContentAppMessageResponse = 0; } -/** */ -cluster Chime = 1366 { +/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ +provisional cluster Chime = 1366 { revision 1; struct ChimeSoundStruct { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index cbc390c337da9e..76196a23b6bd02 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14759,7 +14759,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Cluster Chime * - * + * This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ MTR_PROVISIONALLY_AVAILABLE @interface MTRBaseClusterChime : MTRGenericBaseCluster diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 2b329ff43f23fe..f46e1d1be6c8d8 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6826,7 +6826,7 @@ MTR_PROVISIONALLY_AVAILABLE /** * Cluster Chime - * + * This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */ MTR_PROVISIONALLY_AVAILABLE @interface MTRClusterChime : MTRGenericCluster From 81d2859d5dca3781764252983034b079142f0090 Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:54:55 -0600 Subject: [PATCH 8/9] Re-generated using latest updates from https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/10004 --- .../zap-templates/zcl/data-model/chip/chime-cluster.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml index b24677652331e1..42a538e7a065a9 100644 --- a/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml +++ b/src/app/zap-templates/zcl/data-model/chip/chime-cluster.xml @@ -18,13 +18,13 @@ limitations under the License. XML generated by Alchemy; DO NOT EDIT. Source: src/app_clusters/Chime.adoc Parameters: in-progress -Git: 0.7-fall2024-ncr-1158-g413e195c2 +Git: 0.9-fall2024-225-g1da0e33be --> - + @@ -37,8 +37,8 @@ Git: 0.7-fall2024-ncr-1158-g413e195c2 true true - InstalledChimeSounds - ActiveChimeSoundId + InstalledChimeSounds + ActiveChimeID Enabled From a1c41d97f422f73ea6c79811d26f8de1e10ac90e Mon Sep 17 00:00:00 2001 From: marcos <15697303+gmarcosb@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:57:54 -0600 Subject: [PATCH 9/9] Generated using ./scripts/tools/zap_regen_all.py --- .../data_model/controller-clusters.matter | 4 +- .../chip/devicecontroller/ChipClusters.java | 22 ++++---- .../chip/devicecontroller/ChipStructs.java | 18 +++--- .../devicecontroller/ClusterIDMapping.java | 2 +- .../devicecontroller/ClusterReadMapping.java | 10 ++-- .../devicecontroller/ClusterWriteMapping.java | 16 +++--- .../structs/ChimeClusterChimeSoundStruct.kt | 10 ++-- .../cluster/clusters/ChimeCluster.kt | 12 ++-- .../structs/ChimeClusterChimeSoundStruct.kt | 10 ++-- .../CHIPAttributeTLVValueDecoder.cpp | 20 +++---- .../python/chip/clusters/CHIPClusters.py | 2 +- .../python/chip/clusters/Objects.py | 10 ++-- .../MTRAttributeSpecifiedCheck.mm | 2 +- .../MTRAttributeTLVValueDecoder.mm | 6 +- .../CHIP/zap-generated/MTRBaseClusters.h | 14 ++--- .../CHIP/zap-generated/MTRBaseClusters.mm | 24 ++++---- .../CHIP/zap-generated/MTRClusterConstants.h | 2 +- .../CHIP/zap-generated/MTRClusterNames.mm | 4 +- .../CHIP/zap-generated/MTRClusters.h | 6 +- .../CHIP/zap-generated/MTRClusters.mm | 12 ++-- .../CHIP/zap-generated/MTRStructsObjc.h | 2 +- .../CHIP/zap-generated/MTRStructsObjc.mm | 6 +- .../zap-generated/attributes/Accessors.cpp | 4 +- .../zap-generated/attributes/Accessors.h | 4 +- .../zap-generated/cluster-objects.cpp | 10 ++-- .../zap-generated/cluster-objects.h | 14 ++--- .../app-common/zap-generated/ids/Attributes.h | 4 +- .../zap-generated/cluster/Commands.h | 8 +-- .../cluster/ComplexArgumentParser.cpp | 10 ++-- .../cluster/logging/DataModelLogger.cpp | 8 +-- .../cluster/logging/EntryToText.cpp | 4 +- .../zap-generated/cluster/Commands.h | 56 +++++++++---------- 32 files changed, 167 insertions(+), 169 deletions(-) diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index b265d1d5f7380c..c6193200327590 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -9413,12 +9413,12 @@ provisional cluster Chime = 1366 { revision 1; struct ChimeSoundStruct { - int8u chimeId = 0; + int8u chimeID = 0; char_string<48> name = 1; } readonly attribute ChimeSoundStruct installedChimeSounds[] = 0; - attribute int8u activeChimeSoundId = 1; + attribute int8u activeChimeID = 1; attribute boolean enabled = 2; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index c8e56acda2f197..dbc26ae23c7a10 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -59495,7 +59495,7 @@ public static class ChimeCluster extends BaseChipCluster { public static final long CLUSTER_ID = 1366L; private static final long INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID = 0L; - private static final long ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID = 1L; + private static final long ACTIVE_CHIME_ID_ATTRIBUTE_ID = 1L; private static final long ENABLED_ATTRIBUTE_ID = 2L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; @@ -59576,9 +59576,9 @@ public void onSuccess(byte[] tlv) { }, INSTALLED_CHIME_SOUNDS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readActiveChimeSoundIdAttribute( + public void readActiveChimeIDAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_ID_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59586,21 +59586,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, true); + }, ACTIVE_CHIME_ID_ATTRIBUTE_ID, true); } - public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value) { - writeActiveChimeSoundIdAttribute(callback, value, 0); + public void writeActiveChimeIDAttribute(DefaultClusterCallback callback, Integer value) { + writeActiveChimeIDAttribute(callback, value, 0); } - public void writeActiveChimeSoundIdAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + public void writeActiveChimeIDAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_CHIME_ID_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeActiveChimeSoundIdAttribute( + public void subscribeActiveChimeIDAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CHIME_ID_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -59608,7 +59608,7 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, ACTIVE_CHIME_SOUND_ID_ATTRIBUTE_ID, minInterval, maxInterval); + }, ACTIVE_CHIME_ID_ATTRIBUTE_ID, minInterval, maxInterval); } public void readEnabledAttribute( diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index ad16b0792b13a3..dc9a94cae7cb37 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -12725,22 +12725,22 @@ public String toString() { } } public static class ChimeClusterChimeSoundStruct { - public Integer chimeId; + public Integer chimeID; public String name; private static final long CHIME_ID_ID = 0L; private static final long NAME_ID = 1L; public ChimeClusterChimeSoundStruct( - Integer chimeId, + Integer chimeID, String name ) { - this.chimeId = chimeId; + this.chimeID = chimeID; this.name = name; } public StructType encodeTlv() { ArrayList values = new ArrayList<>(); - values.add(new StructElement(CHIME_ID_ID, new UIntType(chimeId))); + values.add(new StructElement(CHIME_ID_ID, new UIntType(chimeID))); values.add(new StructElement(NAME_ID, new StringType(name))); return new StructType(values); @@ -12750,13 +12750,13 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) { if (tlvValue == null || tlvValue.type() != TLVType.Struct) { return null; } - Integer chimeId = null; + Integer chimeID = null; String name = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == CHIME_ID_ID) { if (element.value(BaseTLVType.class).type() == TLVType.UInt) { UIntType castingValue = element.value(UIntType.class); - chimeId = castingValue.value(Integer.class); + chimeID = castingValue.value(Integer.class); } } else if (element.contextTagNum() == NAME_ID) { if (element.value(BaseTLVType.class).type() == TLVType.String) { @@ -12766,7 +12766,7 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) { } } return new ChimeClusterChimeSoundStruct( - chimeId, + chimeID, name ); } @@ -12775,8 +12775,8 @@ public static ChimeClusterChimeSoundStruct decodeTlv(BaseTLVType tlvValue) { public String toString() { StringBuilder output = new StringBuilder(); output.append("ChimeClusterChimeSoundStruct {\n"); - output.append("\tchimeId: "); - output.append(chimeId); + output.append("\tchimeID: "); + output.append(chimeID); output.append("\n"); output.append("\tname: "); output.append(name); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index fb2070787cb1bb..56ed2c4629cff4 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -16889,7 +16889,7 @@ public long getID() { public enum Attribute { InstalledChimeSounds(0L), - ActiveChimeSoundId(1L), + ActiveChimeID(1L), Enabled(2L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index 76df1318c2cc1d..b4ef81d615022b 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -18248,17 +18248,17 @@ private static Map readChimeInteractionInfo() { readChimeInstalledChimeSoundsCommandParams ); result.put("readInstalledChimeSoundsAttribute", readChimeInstalledChimeSoundsAttributeInteractionInfo); - Map readChimeActiveChimeSoundIdCommandParams = new LinkedHashMap(); - InteractionInfo readChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo( + Map readChimeActiveChimeIDCommandParams = new LinkedHashMap(); + InteractionInfo readChimeActiveChimeIDAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChimeCluster) cluster).readActiveChimeSoundIdAttribute( + ((ChipClusters.ChimeCluster) cluster).readActiveChimeIDAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readChimeActiveChimeSoundIdCommandParams + readChimeActiveChimeIDCommandParams ); - result.put("readActiveChimeSoundIdAttribute", readChimeActiveChimeSoundIdAttributeInteractionInfo); + result.put("readActiveChimeIDAttribute", readChimeActiveChimeIDAttributeInteractionInfo); Map readChimeEnabledCommandParams = new LinkedHashMap(); InteractionInfo readChimeEnabledAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 1e8e72762bcd09..fce8cee5598ec6 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -3473,28 +3473,28 @@ public Map> getWriteAttributeMap() { Map writeContentAppObserverInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("contentAppObserver", writeContentAppObserverInteractionInfo); Map writeChimeInteractionInfo = new LinkedHashMap<>(); - Map writeChimeActiveChimeSoundIdCommandParams = new LinkedHashMap(); - CommandParameterInfo chimeactiveChimeSoundIdCommandParameterInfo = + Map writeChimeActiveChimeIDCommandParams = new LinkedHashMap(); + CommandParameterInfo chimeactiveChimeIDCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeChimeActiveChimeSoundIdCommandParams.put( + writeChimeActiveChimeIDCommandParams.put( "value", - chimeactiveChimeSoundIdCommandParameterInfo + chimeactiveChimeIDCommandParameterInfo ); - InteractionInfo writeChimeActiveChimeSoundIdAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeChimeActiveChimeIDAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ChimeCluster) cluster).writeActiveChimeSoundIdAttribute( + ((ChipClusters.ChimeCluster) cluster).writeActiveChimeIDAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeChimeActiveChimeSoundIdCommandParams + writeChimeActiveChimeIDCommandParams ); - writeChimeInteractionInfo.put("writeActiveChimeSoundIdAttribute", writeChimeActiveChimeSoundIdAttributeInteractionInfo); + writeChimeInteractionInfo.put("writeActiveChimeIDAttribute", writeChimeActiveChimeIDAttributeInteractionInfo); Map writeChimeEnabledCommandParams = new LinkedHashMap(); CommandParameterInfo chimeenabledCommandParameterInfo = new CommandParameterInfo( diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt index 586f6fcc2cb747..de860218ea1c7c 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ChimeClusterChimeSoundStruct.kt @@ -22,10 +22,10 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) { +class ChimeClusterChimeSoundStruct(val chimeID: UInt, val name: String) { override fun toString(): String = buildString { append("ChimeClusterChimeSoundStruct {\n") - append("\tchimeId : $chimeId\n") + append("\tchimeID : $chimeID\n") append("\tname : $name\n") append("}\n") } @@ -33,7 +33,7 @@ class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) { fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_CHIME_ID), chimeId) + put(ContextSpecificTag(TAG_CHIME_ID), chimeID) put(ContextSpecificTag(TAG_NAME), name) endStructure() } @@ -45,12 +45,12 @@ class ChimeClusterChimeSoundStruct(val chimeId: UInt, val name: String) { fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct { tlvReader.enterStructure(tlvTag) - val chimeId = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID)) + val chimeID = tlvReader.getUInt(ContextSpecificTag(TAG_CHIME_ID)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) tlvReader.exitContainer() - return ChimeClusterChimeSoundStruct(chimeId, name) + return ChimeClusterChimeSoundStruct(chimeID, name) } } } diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt index 2d6242b849d6f5..cd23c6d3598064 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ChimeCluster.kt @@ -210,7 +210,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin } } - suspend fun readActiveChimeSoundIdAttribute(): UByte { + suspend fun readActiveChimeIDAttribute(): UByte { val ATTRIBUTE_ID: UInt = 1u val attributePath = @@ -232,7 +232,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { "Activechimesoundid attribute not found in response" } + requireNotNull(attributeData) { "Activechimeid attribute not found in response" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) @@ -241,7 +241,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin return decodedValue } - suspend fun writeActiveChimeSoundIdAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + suspend fun writeActiveChimeIDAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 1u val tlvWriter = TlvWriter() @@ -281,7 +281,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin } } - suspend fun subscribeActiveChimeSoundIdAttribute( + suspend fun subscribeActiveChimeIDAttribute( minInterval: Int, maxInterval: Int, ): Flow { @@ -316,9 +316,7 @@ class ChimeCluster(private val controller: MatterController, private val endpoin .filterIsInstance() .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - requireNotNull(attributeData) { - "Activechimesoundid attribute not found in Node State update" - } + requireNotNull(attributeData) { "Activechimeid attribute not found in Node State update" } // Decode the TLV data into the appropriate type val tlvReader = TlvReader(attributeData.data) diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt index adc8cbb0db2d3e..49c892f8b9f661 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ChimeClusterChimeSoundStruct.kt @@ -22,10 +22,10 @@ import matter.tlv.Tag import matter.tlv.TlvReader import matter.tlv.TlvWriter -class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) { +class ChimeClusterChimeSoundStruct(val chimeID: UByte, val name: String) { override fun toString(): String = buildString { append("ChimeClusterChimeSoundStruct {\n") - append("\tchimeId : $chimeId\n") + append("\tchimeID : $chimeID\n") append("\tname : $name\n") append("}\n") } @@ -33,7 +33,7 @@ class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) { fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { tlvWriter.apply { startStructure(tlvTag) - put(ContextSpecificTag(TAG_CHIME_ID), chimeId) + put(ContextSpecificTag(TAG_CHIME_ID), chimeID) put(ContextSpecificTag(TAG_NAME), name) endStructure() } @@ -45,12 +45,12 @@ class ChimeClusterChimeSoundStruct(val chimeId: UByte, val name: String) { fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ChimeClusterChimeSoundStruct { tlvReader.enterStructure(tlvTag) - val chimeId = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID)) + val chimeID = tlvReader.getUByte(ContextSpecificTag(TAG_CHIME_ID)) val name = tlvReader.getString(ContextSpecificTag(TAG_NAME)) tlvReader.exitContainer() - return ChimeClusterChimeSoundStruct(chimeId, name) + return ChimeClusterChimeSoundStruct(chimeID, name) } } } diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index c272e8404c83e7..0cf7ce8b652c68 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -42240,13 +42240,13 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR { auto & entry_0 = iter_value_0.GetValue(); jobject newElement_0; - jobject newElement_0_chimeId; - std::string newElement_0_chimeIdClassName = "java/lang/Integer"; - std::string newElement_0_chimeIdCtorSignature = "(I)V"; - jint jninewElement_0_chimeId = static_cast(entry_0.chimeId); - chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_chimeIdClassName.c_str(), - newElement_0_chimeIdCtorSignature.c_str(), - jninewElement_0_chimeId, newElement_0_chimeId); + jobject newElement_0_chimeID; + std::string newElement_0_chimeIDClassName = "java/lang/Integer"; + std::string newElement_0_chimeIDCtorSignature = "(I)V"; + jint jninewElement_0_chimeID = static_cast(entry_0.chimeID); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_chimeIDClassName.c_str(), + newElement_0_chimeIDCtorSignature.c_str(), + jninewElement_0_chimeID, newElement_0_chimeID); jobject newElement_0_name; LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(entry_0.name, newElement_0_name)); @@ -42269,14 +42269,14 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR return nullptr; } - newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeId, + newElement_0 = env->NewObject(chimeSoundStructStructClass_1, chimeSoundStructStructCtor_1, newElement_0_chimeID, newElement_0_name); chip::JniReferences::GetInstance().AddToList(value, newElement_0); } return value; } - case Attributes::ActiveChimeSoundId::Id: { - using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo; + case Attributes::ActiveChimeID::Id: { + using TypeInfo = Attributes::ActiveChimeID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 1b5f2e6513fa1c..1105faa9caf211 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -13048,7 +13048,7 @@ class ChipClusters: "reportable": True, }, 0x00000001: { - "attributeName": "ActiveChimeSoundId", + "attributeName": "ActiveChimeID", "attributeId": 0x00000001, "type": "int", "reportable": True, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index c70def4c9eb2ec..b6e375cf2c97bc 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -46515,7 +46515,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ ClusterObjectFieldDescriptor(Label="installedChimeSounds", Tag=0x00000000, Type=typing.List[Chime.Structs.ChimeSoundStruct]), - ClusterObjectFieldDescriptor(Label="activeChimeSoundId", Tag=0x00000001, Type=uint), + ClusterObjectFieldDescriptor(Label="activeChimeID", Tag=0x00000001, Type=uint), ClusterObjectFieldDescriptor(Label="enabled", Tag=0x00000002, Type=bool), ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), @@ -46526,7 +46526,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ]) installedChimeSounds: 'typing.List[Chime.Structs.ChimeSoundStruct]' = None - activeChimeSoundId: 'uint' = None + activeChimeID: 'uint' = None enabled: 'bool' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None @@ -46542,11 +46542,11 @@ class ChimeSoundStruct(ClusterObject): def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="chimeId", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="chimeID", Tag=0, Type=uint), ClusterObjectFieldDescriptor(Label="name", Tag=1, Type=str), ]) - chimeId: 'uint' = 0 + chimeID: 'uint' = 0 name: 'str' = "" class Commands: @@ -46581,7 +46581,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.List[Chime.Structs.ChimeSoundStruct]' = field(default_factory=lambda: []) @dataclass - class ActiveChimeSoundId(ClusterAttributeDescriptor): + class ActiveChimeID(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x00000556 diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index f94445c21d3d3e..986f9776bab5d5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -5919,7 +5919,7 @@ static BOOL AttributeIsSpecifiedInChimeCluster(AttributeId aAttributeId) case Attributes::InstalledChimeSounds::Id: { return YES; } - case Attributes::ActiveChimeSoundId::Id: { + case Attributes::ActiveChimeID::Id: { return YES; } case Attributes::Enabled::Id: { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 3b8fff36f2efe3..630c612e707b41 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -16918,7 +16918,7 @@ static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId auto & entry_0 = iter_0.GetValue(); MTRChimeClusterChimeSoundStruct * newElement_0; newElement_0 = [MTRChimeClusterChimeSoundStruct new]; - newElement_0.chimeId = [NSNumber numberWithUnsignedChar:entry_0.chimeId]; + newElement_0.chimeID = [NSNumber numberWithUnsignedChar:entry_0.chimeID]; newElement_0.name = AsString(entry_0.name); if (newElement_0.name == nil) { CHIP_ERROR err = CHIP_ERROR_INVALID_ARGUMENT; @@ -16936,8 +16936,8 @@ static id _Nullable DecodeAttributeValueForChimeCluster(AttributeId aAttributeId } return value; } - case Attributes::ActiveChimeSoundId::Id: { - using TypeInfo = Attributes::ActiveChimeSoundId::TypeInfo; + case Attributes::ActiveChimeID::Id: { + using TypeInfo = Attributes::ActiveChimeID::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index 76196a23b6bd02..85307d9b9f1bae 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -14779,13 +14779,13 @@ MTR_PROVISIONALLY_AVAILABLE reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)readAttributeActiveChimeIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeActiveChimeIDWithParams:(MTRSubscribeParams *)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeActiveChimeIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeEnabledWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeEnabledWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index f129e16427af2b..f6899e092056a2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -102152,9 +102152,9 @@ + (void)readAttributeInstalledChimeSoundsWithClusterStateCache:(MTRClusterStateC completion:completion]; } -- (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeActiveChimeIDWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102163,11 +102163,11 @@ - (void)readAttributeActiveChimeSoundIdWithCompletion:(void (^)(NSNumber * _Null completion:completion]; } -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion { - [self writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + [self writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; } -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributeActiveChimeIDWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -102182,7 +102182,7 @@ - (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value par } ListFreer listFreer; - using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; TypeInfo::Type cppValue; cppValue = value.unsignedCharValue; @@ -102191,11 +102191,11 @@ - (void)writeAttributeActiveChimeSoundIdWithValue:(NSNumber * _Nonnull)value par std::move(*bridge).DispatchAction(self.device); } -- (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler +- (void)subscribeAttributeActiveChimeIDWithParams:(MTRSubscribeParams * _Nonnull)params + subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -102205,9 +102205,9 @@ - (void)subscribeAttributeActiveChimeSoundIdWithParams:(MTRSubscribeParams * _No subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeActiveChimeSoundIdWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeActiveChimeIDWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Chime::Attributes::ActiveChimeSoundId::TypeInfo; + using TypeInfo = Chime::Attributes::ActiveChimeID::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 72233c40c81bdc..2b1d5e5dbf8c0d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -4741,7 +4741,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { // Cluster Chime attributes MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID MTR_PROVISIONALLY_AVAILABLE = 0x00000000, - MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, + MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID MTR_PROVISIONALLY_AVAILABLE = 0x00000001, MTRAttributeIDTypeClusterChimeAttributeEnabledID MTR_PROVISIONALLY_AVAILABLE = 0x00000002, MTRAttributeIDTypeClusterChimeAttributeGeneratedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterChimeAttributeAcceptedCommandListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index 00c2db4a280021..e0a84841269762 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -8148,8 +8148,8 @@ result = @"InstalledChimeSounds"; break; - case MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID: - result = @"ActiveChimeSoundId"; + case MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID: + result = @"ActiveChimeID"; break; case MTRAttributeIDTypeClusterChimeAttributeEnabledID: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index f46e1d1be6c8d8..964282c1ceab8e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -6837,9 +6837,9 @@ MTR_PROVISIONALLY_AVAILABLE - (NSDictionary * _Nullable)readAttributeInstalledChimeSoundsWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (NSDictionary * _Nullable)readAttributeActiveChimeIDWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeIDWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeActiveChimeIDWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeEnabledWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index c745143f72507b..0e905297ab7702 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -19587,20 +19587,20 @@ - (void)playChimeSoundWithParams:(MTRChimeClusterPlayChimeSoundParams * _Nullabl return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeInstalledChimeSoundsID) params:params]; } -- (NSDictionary * _Nullable)readAttributeActiveChimeSoundIdWithParams:(MTRReadParams * _Nullable)params +- (NSDictionary * _Nullable)readAttributeActiveChimeIDWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) params:params]; + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID) params:params]; } -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +- (void)writeAttributeActiveChimeIDWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs { - [self writeAttributeActiveChimeSoundIdWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; + [self writeAttributeActiveChimeIDWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; } -- (void)writeAttributeActiveChimeSoundIdWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +- (void)writeAttributeActiveChimeIDWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params { NSNumber * timedWriteTimeout = params.timedWriteTimeout; - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeSoundIdID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeChimeID) attributeID:@(MTRAttributeIDTypeClusterChimeAttributeActiveChimeIDID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } - (NSDictionary * _Nullable)readAttributeEnabledWithParams:(MTRReadParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index 2aecf40b144cbf..42ee02b58d5abc 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -2119,7 +2119,7 @@ MTR_PROVISIONALLY_AVAILABLE MTR_PROVISIONALLY_AVAILABLE @interface MTRChimeClusterChimeSoundStruct : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull chimeId MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull chimeID MTR_PROVISIONALLY_AVAILABLE; @property (nonatomic, copy) NSString * _Nonnull name MTR_PROVISIONALLY_AVAILABLE; @end diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index 67b0774cc0f973..a632603cb5a79e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -8773,7 +8773,7 @@ - (instancetype)init { if (self = [super init]) { - _chimeId = @(0); + _chimeID = @(0); _name = @""; } @@ -8784,7 +8784,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone { auto other = [[MTRChimeClusterChimeSoundStruct alloc] init]; - other.chimeId = self.chimeId; + other.chimeID = self.chimeID; other.name = self.name; return other; @@ -8792,7 +8792,7 @@ - (id)copyWithZone:(NSZone * _Nullable)zone - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: chimeId:%@; name:%@; >", NSStringFromClass([self class]), _chimeId, _name]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: chimeID:%@; name:%@; >", NSStringFromClass([self class]), _chimeID, _name]; return descriptionString; } diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp index 2ccdf50a187413..fa1f9659ebe6e5 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.cpp @@ -36670,7 +36670,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) namespace Chime { namespace Attributes { -namespace ActiveChimeSoundId { +namespace ActiveChimeID { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) { @@ -36714,7 +36714,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) return emberAfWriteAttribute(endpoint, Clusters::Chime::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); } -} // namespace ActiveChimeSoundId +} // namespace ActiveChimeID namespace Enabled { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index 7d60e62564bfac..90d7d65ab75c51 100644 --- a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h +++ b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h @@ -5566,11 +5566,11 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar namespace Chime { namespace Attributes { -namespace ActiveChimeSoundId { +namespace ActiveChimeID { Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace ActiveChimeSoundId +} // namespace ActiveChimeID namespace Enabled { Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp index 9c7cad32717aa8..9612ff6aefd555 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp @@ -28483,7 +28483,7 @@ namespace ChimeSoundStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kChimeId), chimeId); + encoder.Encode(to_underlying(Fields::kChimeID), chimeID); encoder.Encode(to_underlying(Fields::kName), name); return encoder.Finalize(); } @@ -28502,9 +28502,9 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) CHIP_ERROR err = CHIP_NO_ERROR; const uint8_t __context_tag = std::get(__element); - if (__context_tag == to_underlying(Fields::kChimeId)) + if (__context_tag == to_underlying(Fields::kChimeID)) { - err = DataModel::Decode(reader, chimeId); + err = DataModel::Decode(reader, chimeID); } else if (__context_tag == to_underlying(Fields::kName)) { @@ -28551,8 +28551,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre { case Attributes::InstalledChimeSounds::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, installedChimeSounds); - case Attributes::ActiveChimeSoundId::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activeChimeSoundId); + case Attributes::ActiveChimeID::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, activeChimeID); case Attributes::Enabled::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, enabled); case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 59d48f7fd11eda..0cdb5fd2b2a281 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h @@ -41201,14 +41201,14 @@ namespace Structs { namespace ChimeSoundStruct { enum class Fields : uint8_t { - kChimeId = 0, + kChimeID = 0, kName = 1, }; struct Type { public: - uint8_t chimeId = static_cast(0); + uint8_t chimeID = static_cast(0); chip::CharSpan name; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -41279,7 +41279,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace InstalledChimeSounds -namespace ActiveChimeSoundId { +namespace ActiveChimeID { struct TypeInfo { using Type = uint8_t; @@ -41287,10 +41287,10 @@ struct TypeInfo using DecodableArgType = uint8_t; static constexpr ClusterId GetClusterId() { return Clusters::Chime::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveChimeSoundId::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ActiveChimeID::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace ActiveChimeSoundId +} // namespace ActiveChimeID namespace Enabled { struct TypeInfo { @@ -41349,8 +41349,8 @@ struct TypeInfo CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); Attributes::InstalledChimeSounds::TypeInfo::DecodableType installedChimeSounds; - Attributes::ActiveChimeSoundId::TypeInfo::DecodableType activeChimeSoundId = static_cast(0); - Attributes::Enabled::TypeInfo::DecodableType enabled = static_cast(0); + Attributes::ActiveChimeID::TypeInfo::DecodableType activeChimeID = static_cast(0); + Attributes::Enabled::TypeInfo::DecodableType enabled = static_cast(0); Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; Attributes::EventList::TypeInfo::DecodableType eventList; diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index a7703bd94c3c36..059dcab2defec1 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -7320,9 +7320,9 @@ namespace InstalledChimeSounds { static constexpr AttributeId Id = 0x00000000; } // namespace InstalledChimeSounds -namespace ActiveChimeSoundId { +namespace ActiveChimeID { static constexpr AttributeId Id = 0x00000001; -} // namespace ActiveChimeSoundId +} // namespace ActiveChimeID namespace Enabled { static constexpr AttributeId Id = 0x00000002; diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index eb8fe2243e37f2..90f59169fa6c86 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -13654,7 +13654,7 @@ class ContentAppObserverContentAppMessage : public ClusterCommand |------------------------------------------------------------------------------| | Attributes: | | | * InstalledChimeSounds | 0x0000 | -| * ActiveChimeSoundId | 0x0001 | +| * ActiveChimeID | 0x0001 | | * Enabled | 0x0002 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | @@ -26240,7 +26240,7 @@ void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsI // make_unique(Id, credsIssuerConfig), // make_unique(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), // - make_unique(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), // + make_unique(Id, "active-chime-id", Attributes::ActiveChimeID::Id, credsIssuerConfig), // make_unique(Id, "enabled", Attributes::Enabled::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // @@ -26253,7 +26253,7 @@ void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsI WriteAttributeAsComplex>>( Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-chime-sound-id", 0, UINT8_MAX, Attributes::ActiveChimeSoundId::Id, + make_unique>(Id, "active-chime-id", 0, UINT8_MAX, Attributes::ActiveChimeID::Id, WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "enabled", 0, 1, Attributes::Enabled::Id, WriteCommandType::kWrite, credsIssuerConfig), // @@ -26272,7 +26272,7 @@ void registerClusterChime(Commands & commands, CredentialIssuerCommands * credsI WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // make_unique(Id, "installed-chime-sounds", Attributes::InstalledChimeSounds::Id, credsIssuerConfig), // - make_unique(Id, "active-chime-sound-id", Attributes::ActiveChimeSoundId::Id, credsIssuerConfig), // + make_unique(Id, "active-chime-id", Attributes::ActiveChimeID::Id, credsIssuerConfig), // make_unique(Id, "enabled", Attributes::Enabled::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/ComplexArgumentParser.cpp b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp index 0c7234ded5e00a..159b3bdc5fc78e 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -5680,13 +5680,13 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: Json::Value valueCopy(value); ReturnErrorOnFailure( - ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.chimeId", "chimeId", value.isMember("chimeId"))); + ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.chimeID", "chimeID", value.isMember("chimeID"))); ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ChimeSoundStruct.name", "name", value.isMember("name"))); char labelWithMember[kMaxLabelLength]; - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chimeId"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chimeId, value["chimeId"])); - valueCopy.removeMember("chimeId"); + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "chimeID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.chimeID, value["chimeID"])); + valueCopy.removeMember("chimeID"); snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "name"); ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.name, value["name"])); @@ -5697,7 +5697,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters: void ComplexArgumentParser::Finalize(chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type & request) { - ComplexArgumentParser::Finalize(request.chimeId); + ComplexArgumentParser::Finalize(request.chimeID); ComplexArgumentParser::Finalize(request.name); } 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 4d998a0c8582f0..842863af83b9ac 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -5002,10 +5002,10 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, { DataModelLogger::LogString(label, indent, "{"); { - CHIP_ERROR err = LogValue("ChimeId", indent + 1, value.chimeId); + CHIP_ERROR err = LogValue("ChimeID", indent + 1, value.chimeID); if (err != CHIP_NO_ERROR) { - DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeId'"); + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'ChimeID'"); return err; } } @@ -17951,10 +17951,10 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("InstalledChimeSounds", 1, value); } - case Chime::Attributes::ActiveChimeSoundId::Id: { + case Chime::Attributes::ActiveChimeID::Id: { uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ActiveChimeSoundId", 1, value); + return DataModelLogger::LogValue("ActiveChimeID", 1, value); } case Chime::Attributes::Enabled::Id: { bool 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 7eb6aaafdcc4a2..47b4b54f811b6b 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -4382,8 +4382,8 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) { case chip::app::Clusters::Chime::Attributes::InstalledChimeSounds::Id: return "InstalledChimeSounds"; - case chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id: - return "ActiveChimeSoundId"; + case chip::app::Clusters::Chime::Attributes::ActiveChimeID::Id: + return "ActiveChimeID"; case chip::app::Clusters::Chime::Attributes::Enabled::Id: return "Enabled"; case chip::app::Clusters::Chime::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 f88caca98d927a..d1622366e52c6c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -160040,7 +160040,7 @@ class SubscribeAttributeContentAppObserverClusterRevision : public SubscribeAttr |------------------------------------------------------------------------------| | Attributes: | | | * InstalledChimeSounds | 0x0000 | -| * ActiveChimeSoundId | 0x0001 | +| * ActiveChimeID | 0x0001 | | * Enabled | 0x0002 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | @@ -160187,34 +160187,34 @@ class SubscribeAttributeChimeInstalledChimeSounds : public SubscribeAttribute { #if MTR_ENABLE_PROVISIONAL /* - * Attribute ActiveChimeSoundId + * Attribute ActiveChimeID */ -class ReadChimeActiveChimeSoundId : public ReadAttribute { +class ReadChimeActiveChimeID : public ReadAttribute { public: - ReadChimeActiveChimeSoundId() - : ReadAttribute("active-chime-sound-id") + ReadChimeActiveChimeID() + : ReadAttribute("active-chime-id") { } - ~ReadChimeActiveChimeSoundId() + ~ReadChimeActiveChimeID() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeID::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); __auto_type * cluster = [[MTRBaseClusterChime alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeActiveChimeSoundIdWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]); + [cluster readAttributeActiveChimeIDWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Chime.ActiveChimeID response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("Chime ActiveChimeSoundId read Error", error); + LogNSError("Chime ActiveChimeID read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160223,24 +160223,24 @@ class ReadChimeActiveChimeSoundId : public ReadAttribute { } }; -class WriteChimeActiveChimeSoundId : public WriteAttribute { +class WriteChimeActiveChimeID : public WriteAttribute { public: - WriteChimeActiveChimeSoundId() - : WriteAttribute("active-chime-sound-id") + WriteChimeActiveChimeID() + : WriteAttribute("active-chime-id") { - AddArgument("attr-name", "active-chime-sound-id"); + AddArgument("attr-name", "active-chime-id"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteChimeActiveChimeSoundId() + ~WriteChimeActiveChimeID() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeID::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); @@ -160250,9 +160250,9 @@ class WriteChimeActiveChimeSoundId : public WriteAttribute { params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeActiveChimeSoundIdWithValue:value params:params completion:^(NSError * _Nullable error) { + [cluster writeAttributeActiveChimeIDWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { - LogNSError("Chime ActiveChimeSoundId write Error", error); + LogNSError("Chime ActiveChimeID write Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -160264,21 +160264,21 @@ class WriteChimeActiveChimeSoundId : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeChimeActiveChimeSoundId : public SubscribeAttribute { +class SubscribeAttributeChimeActiveChimeID : public SubscribeAttribute { public: - SubscribeAttributeChimeActiveChimeSoundId() - : SubscribeAttribute("active-chime-sound-id") + SubscribeAttributeChimeActiveChimeID() + : SubscribeAttribute("active-chime-id") { } - ~SubscribeAttributeChimeActiveChimeSoundId() + ~SubscribeAttributeChimeActiveChimeID() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Chime::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeSoundId::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Chime::Attributes::ActiveChimeID::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); @@ -160293,10 +160293,10 @@ class SubscribeAttributeChimeActiveChimeSoundId : public SubscribeAttribute { if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeActiveChimeSoundIdWithParams:params + [cluster subscribeAttributeActiveChimeIDWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Chime.ActiveChimeSoundId response %@", [value description]); + NSLog(@"Chime.ActiveChimeID response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -183955,9 +183955,9 @@ void registerClusterChime(Commands & commands) make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique(), // - make_unique(), // - make_unique(), // + make_unique(), // + make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), //