diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter index b9daf0cb550080..ba0e91c3615ec2 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.matter @@ -1225,7 +1225,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1261,6 +1261,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1271,7 +1277,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1344,7 +1349,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1354,6 +1358,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1419,7 +1427,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1451,23 +1464,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1497,7 +1510,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1508,8 +1521,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1549,28 +1561,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 59886807143f6f..155fac83daad18 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -4954,7 +4954,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -4990,6 +4990,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5000,7 +5006,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -5073,7 +5078,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5083,6 +5087,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5148,7 +5156,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -5180,23 +5193,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5226,7 +5239,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5237,8 +5250,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5278,28 +5290,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ @@ -8586,8 +8602,7 @@ endpoint 1 { ram attribute activeScheduleHandle; callback attribute presets; callback attribute schedules; - ram attribute presetsSchedulesEditable; - ram attribute setpointHoldExpiryTimestamp default = 0; + ram attribute setpointHoldExpiryTimestamp; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute eventList; diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter index c8fa5ea7e1c6e1..43539889c68900 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.matter @@ -3499,7 +3499,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -3535,6 +3535,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -3545,7 +3551,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -3618,7 +3623,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -3628,6 +3632,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -3693,7 +3701,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -3725,23 +3738,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -3771,7 +3784,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -3782,8 +3795,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -3823,28 +3835,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter index 27e38141a4e1b6..7653880934305a 100644 --- a/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter +++ b/examples/chef/devices/rootnode_airpurifier_airqualitysensor_temperaturesensor_humiditysensor_thermostat_56de3d5f45.matter @@ -1148,7 +1148,7 @@ cluster ActivatedCarbonFilterMonitoring = 114 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1184,6 +1184,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1194,7 +1200,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1267,7 +1272,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1277,6 +1281,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1342,7 +1350,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1374,23 +1387,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1420,7 +1433,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1431,8 +1444,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1472,28 +1484,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter index 22111d45d62eab..e0a5f1326a33a9 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.matter @@ -1505,7 +1505,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1541,6 +1541,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1551,7 +1557,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1624,7 +1629,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1634,6 +1638,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1699,7 +1707,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1731,23 +1744,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1777,7 +1790,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1788,8 +1801,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1829,28 +1841,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter index 66d34c451a7f92..9aa1fa8c417970 100644 --- a/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter +++ b/examples/chef/devices/rootnode_roomairconditioner_9cf3607804.matter @@ -1088,7 +1088,7 @@ cluster GroupKeyManagement = 63 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1124,6 +1124,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1134,7 +1140,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1207,7 +1212,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1217,6 +1221,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1282,7 +1290,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1314,23 +1327,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1360,7 +1373,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1371,8 +1384,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1412,28 +1424,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter index eb6b301b559a3c..1e71b189ccdd39 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.matter @@ -1308,7 +1308,7 @@ cluster FixedLabel = 64 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1344,6 +1344,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1354,7 +1360,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1427,7 +1432,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1437,6 +1441,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1502,7 +1510,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1534,23 +1547,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1580,7 +1593,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1591,8 +1604,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1632,28 +1644,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/examples/placeholder/linux/apps/app1/config.matter b/examples/placeholder/linux/apps/app1/config.matter index 5b91706480d3f9..3b6c723ed690c8 100644 --- a/examples/placeholder/linux/apps/app1/config.matter +++ b/examples/placeholder/linux/apps/app1/config.matter @@ -4745,7 +4745,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -4781,6 +4781,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -4791,7 +4797,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -4864,7 +4869,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4874,6 +4878,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -4939,7 +4947,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -4971,23 +4984,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5017,7 +5030,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5028,8 +5041,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5069,33 +5081,37 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5131,6 +5147,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5141,7 +5163,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -5214,7 +5235,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5224,6 +5244,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5289,7 +5313,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -5321,23 +5350,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5367,7 +5396,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5378,8 +5407,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5419,28 +5447,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ @@ -8770,7 +8802,7 @@ endpoint 0 { callback attribute ACCompressorType default = 0x00; callback attribute ACLouverPosition default = 0x00; callback attribute ACCoilTemperature; - callback attribute ACCapacityformat default = 0x00; + callback attribute ACCapacityFormat default = 0x00; ram attribute featureMap default = 0x000b; ram attribute clusterRevision default = 6; } diff --git a/examples/placeholder/linux/apps/app2/config.matter b/examples/placeholder/linux/apps/app2/config.matter index 3499926c146506..ec42b8a0d96fb6 100644 --- a/examples/placeholder/linux/apps/app2/config.matter +++ b/examples/placeholder/linux/apps/app2/config.matter @@ -4702,7 +4702,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -4738,6 +4738,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -4748,7 +4754,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -4821,7 +4826,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -4831,6 +4835,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -4896,7 +4904,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -4928,23 +4941,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -4974,7 +4987,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -4985,8 +4998,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5026,33 +5038,37 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -5088,6 +5104,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -5098,7 +5120,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -5171,7 +5192,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -5181,6 +5201,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -5246,7 +5270,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -5278,23 +5307,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -5324,7 +5353,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -5335,8 +5364,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -5376,28 +5404,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ @@ -8734,7 +8766,7 @@ endpoint 0 { callback attribute ACCompressorType default = 0x00; callback attribute ACLouverPosition default = 0x00; callback attribute ACCoilTemperature; - callback attribute ACCapacityformat default = 0x00; + callback attribute ACCapacityFormat default = 0x00; ram attribute featureMap default = 0x000b; ram attribute clusterRevision default = 6; } diff --git a/examples/thermostat/linux/include/thermostat-delegate-impl.h b/examples/thermostat/linux/include/thermostat-delegate-impl.h index c4daef5fde1d6a..046f870d0520a3 100644 --- a/examples/thermostat/linux/include/thermostat-delegate-impl.h +++ b/examples/thermostat/linux/include/thermostat-delegate-impl.h @@ -50,6 +50,12 @@ class ThermostatDelegate : public Delegate CHIP_ERROR GetPresetAtIndex(size_t index, PresetStructWithOwnedMembers & preset) override; + void BeginPendingPresetList() override; + + int GetPendingPresetCount() override; + + CHIP_ERROR GetPendingPresetAtIndex(size_t index, PresetStructWithOwnedMembers & preset) override; + CHIP_ERROR GetActivePresetHandle(MutableByteSpan & activePresetHandle) override; CHIP_ERROR SetActivePresetHandle(const DataModel::Nullable & newActivePresetHandle) override; diff --git a/examples/thermostat/linux/thermostat-delegate-impl.cpp b/examples/thermostat/linux/thermostat-delegate-impl.cpp index fa7bd9a259a475..6f21bfbfa1cb7d 100644 --- a/examples/thermostat/linux/thermostat-delegate-impl.cpp +++ b/examples/thermostat/linux/thermostat-delegate-impl.cpp @@ -18,6 +18,7 @@ #include "include/thermostat-delegate-impl.h" +#include "thermostat-delegate-impl.h" #include #include #include @@ -134,6 +135,22 @@ CHIP_ERROR ThermostatDelegate::GetPresetAtIndex(size_t index, PresetStructWithOw return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; } +void ThermostatDelegate::BeginPendingPresetList() +{ + mNextFreeIndexInPendingPresetsList = 0; + for (uint8_t indexInPresets = 0; indexInPresets < mNextFreeIndexInPresetsList; indexInPresets++) + { + auto preset = mPresets[indexInPresets]; + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetHandle(preset.GetPresetHandle()); + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetScenario(preset.GetPresetScenario()); + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetName(preset.GetName()); + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetCoolingSetpoint(preset.GetCoolingSetpoint()); + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetHeatingSetpoint(preset.GetHeatingSetpoint()); + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetBuiltIn(preset.GetBuiltIn()); + mNextFreeIndexInPendingPresetsList++; + } +} + CHIP_ERROR ThermostatDelegate::GetActivePresetHandle(MutableByteSpan & activePresetHandle) { return CopySpanToMutableSpan(ByteSpan(mActivePresetHandleData, mActivePresetHandleDataSize), activePresetHandle); @@ -169,8 +186,19 @@ CHIP_ERROR ThermostatDelegate::AppendToPendingPresetList(const PresetStruct::Typ { if (mNextFreeIndexInPendingPresetsList < ArraySize(mPendingPresets)) { + if (preset.presetHandle.IsNull()) + { + // TODO: #34556 Since we support only one preset of each type, using the octet string containing the preset scenario + // suffices as the unique preset handle. Need to fix this to actually provide unique handles once multiple presets of + // each type are supported. + const uint8_t handle[] = { static_cast(preset.presetScenario) }; + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetHandle(DataModel::MakeNullable(ByteSpan(handle))); + } + else + { + mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetHandle(preset.presetHandle); + } mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetScenario(preset.presetScenario); - mPendingPresets[mNextFreeIndexInPendingPresetsList].SetPresetHandle(preset.presetHandle); mPendingPresets[mNextFreeIndexInPendingPresetsList].SetName(preset.name); mPendingPresets[mNextFreeIndexInPendingPresetsList].SetCoolingSetpoint(preset.coolingSetpoint); mPendingPresets[mNextFreeIndexInPendingPresetsList].SetHeatingSetpoint(preset.heatingSetpoint); @@ -193,7 +221,6 @@ CHIP_ERROR ThermostatDelegate::GetPendingPresetAtIndex(size_t index, PresetStruc CHIP_ERROR ThermostatDelegate::ApplyPendingPresets() { - // TODO: #34546 - Need to support deletion of presets that are removed from Presets. for (uint8_t indexInPendingPresets = 0; indexInPendingPresets < mNextFreeIndexInPendingPresetsList; indexInPendingPresets++) { @@ -214,14 +241,7 @@ CHIP_ERROR ThermostatDelegate::ApplyPendingPresets() // If pending preset was not found in the Presets list, append to the Presets list. if (!found) { - mPresets[mNextFreeIndexInPresetsList] = pendingPreset; - - // TODO: #34556 Since we support only one preset of each type, using the octet string containing the preset scenario - // suffices as the unique preset handle. Need to fix this to actually provide unique handles once multiple presets of - // each type are supported. - const uint8_t handle[] = { static_cast(pendingPreset.GetPresetScenario()) }; - mPresets[mNextFreeIndexInPresetsList].SetPresetHandle(DataModel::MakeNullable(ByteSpan(handle))); mNextFreeIndexInPresetsList++; } } diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter index 76dace386a25f2..b13d7370f01338 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.matter @@ -1899,7 +1899,7 @@ provisional cluster ScenesManagement = 98 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1935,6 +1935,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1945,7 +1951,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -2018,7 +2023,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -2028,6 +2032,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -2093,7 +2101,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -2125,23 +2138,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -2171,7 +2184,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -2182,8 +2195,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2223,28 +2235,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } endpoint 0 { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter index f8154996ad20e2..42e75ca83469e6 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.matter @@ -1810,7 +1810,7 @@ provisional cluster ScenesManagement = 98 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1846,6 +1846,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1856,7 +1862,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1929,7 +1934,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1939,6 +1943,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -2004,7 +2012,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -2036,23 +2049,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -2082,7 +2095,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -2093,8 +2106,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2134,28 +2146,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } endpoint 0 { diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter index 8060f63590c3c4..58db7a02c80874 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.matter @@ -1507,7 +1507,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1543,6 +1543,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1553,7 +1559,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1626,7 +1631,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1636,6 +1640,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1701,7 +1709,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1733,23 +1746,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1779,7 +1792,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1790,8 +1803,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -1831,28 +1843,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ diff --git a/examples/thermostat/thermostat-common/thermostat.matter b/examples/thermostat/thermostat-common/thermostat.matter index f7139b07b43595..0870d1fa6c16a6 100644 --- a/examples/thermostat/thermostat-common/thermostat.matter +++ b/examples/thermostat/thermostat-common/thermostat.matter @@ -1687,7 +1687,7 @@ cluster UserLabel = 65 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -1723,6 +1723,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -1733,7 +1739,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -1806,7 +1811,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -1816,6 +1820,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -1881,7 +1889,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -1913,23 +1926,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -1959,7 +1972,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -1970,8 +1983,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -2011,28 +2023,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for configuring the user interface of a thermostat (which may be remote from the thermostat). */ @@ -2481,7 +2497,7 @@ endpoint 1 { ram attribute numberOfPresets default = 0; ram attribute activePresetHandle; callback attribute presets; - ram attribute presetsSchedulesEditable; + ram attribute setpointHoldExpiryTimestamp; callback attribute generatedCommandList; callback attribute acceptedCommandList; callback attribute attributeList; @@ -2490,9 +2506,6 @@ endpoint 1 { handle command SetpointRaiseLower; handle command SetActivePresetRequest; - handle command StartPresetsSchedulesEditRequest; - handle command CancelPresetsSchedulesEditRequest; - handle command CommitPresetsSchedulesRequest; } server cluster ThermostatUserInterfaceConfiguration { diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index c60950077fb372..8cf4b1fc93a2df 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -307,7 +307,7 @@ { (uint16_t) 0xBB8, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxHeatSetpointLimit */ \ { (uint16_t) 0x640, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MinCoolSetpointLimit */ \ { (uint16_t) 0xC80, (uint16_t) -0x6AB3, (uint16_t) 0x7FFF }, /* MaxCoolSetpointLimit */ \ - { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x19 }, /* MinSetpointDeadBand */ \ + { (uint16_t) 0x19, (uint16_t) 0x0, (uint16_t) 0x7F }, /* MinSetpointDeadBand */ \ { (uint16_t) 0x4, (uint16_t) 0x0, (uint16_t) 0x5 }, /* ControlSequenceOfOperation */ \ { (uint16_t) 0x1, (uint16_t) 0x0, (uint16_t) 0x9 }, /* SystemMode */ \ \ @@ -355,7 +355,7 @@ } // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 1055 +#define GENERATED_ATTRIBUTE_COUNT 1054 #define GENERATED_ATTRIBUTES \ { \ \ @@ -1367,17 +1367,17 @@ { ZAP_SIMPLE_DEFAULT(0x0BB8), 0x00000004, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxHeatSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0640), 0x00000005, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMinCoolSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0C80), 0x00000006, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedCoolingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedHeatingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x00000019, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ @@ -1399,8 +1399,7 @@ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Presets */ \ { ZAP_EMPTY_DEFAULT(), 0x00000051, 0, ZAP_TYPE(ARRAY), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Schedules */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000052, 1, ZAP_TYPE(BOOLEAN), 0 }, /* PresetsSchedulesEditable */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x00000053, 4, ZAP_TYPE(EPOCH_S), \ + { ZAP_EMPTY_DEFAULT(), 0x00000052, 4, ZAP_TYPE(EPOCH_S), \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SetpointHoldExpiryTimestamp */ \ { ZAP_SIMPLE_DEFAULT(0x0023), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -3748,8 +3747,8 @@ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ .attributes = ZAP_ATTRIBUTE_INDEX(616), \ - .attributeCount = 27, \ - .clusterSize = 73, \ + .attributeCount = 26, \ + .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 241 ), \ @@ -3760,7 +3759,7 @@ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(643), \ + .attributes = ZAP_ATTRIBUTE_INDEX(642), \ .attributeCount = 14, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3773,7 +3772,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(657), \ + .attributes = ZAP_ATTRIBUTE_INDEX(656), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3786,7 +3785,7 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(662), \ + .attributes = ZAP_ATTRIBUTE_INDEX(661), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -3799,7 +3798,7 @@ { \ /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ .clusterId = 0x00000301, \ - .attributes = ZAP_ATTRIBUTE_INDEX(716), \ + .attributes = ZAP_ATTRIBUTE_INDEX(715), \ .attributeCount = 16, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3812,7 +3811,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(732), \ + .attributes = ZAP_ATTRIBUTE_INDEX(731), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3825,7 +3824,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(739), \ + .attributes = ZAP_ATTRIBUTE_INDEX(738), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3838,7 +3837,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(745), \ + .attributes = ZAP_ATTRIBUTE_INDEX(744), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3851,7 +3850,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(750), \ + .attributes = ZAP_ATTRIBUTE_INDEX(749), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3864,7 +3863,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(756), \ + .attributes = ZAP_ATTRIBUTE_INDEX(755), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3877,7 +3876,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(762), \ + .attributes = ZAP_ATTRIBUTE_INDEX(761), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3890,7 +3889,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Monoxide Concentration Measurement (server) */ \ .clusterId = 0x0000040C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(767), \ + .attributes = ZAP_ATTRIBUTE_INDEX(766), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3903,7 +3902,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Dioxide Concentration Measurement (server) */ \ .clusterId = 0x0000040D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(780), \ + .attributes = ZAP_ATTRIBUTE_INDEX(779), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3916,7 +3915,7 @@ { \ /* Endpoint: 1, Cluster: Nitrogen Dioxide Concentration Measurement (server) */ \ .clusterId = 0x00000413, \ - .attributes = ZAP_ATTRIBUTE_INDEX(793), \ + .attributes = ZAP_ATTRIBUTE_INDEX(792), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3929,7 +3928,7 @@ { \ /* Endpoint: 1, Cluster: Ozone Concentration Measurement (server) */ \ .clusterId = 0x00000415, \ - .attributes = ZAP_ATTRIBUTE_INDEX(806), \ + .attributes = ZAP_ATTRIBUTE_INDEX(805), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3942,7 +3941,7 @@ { \ /* Endpoint: 1, Cluster: PM2.5 Concentration Measurement (server) */ \ .clusterId = 0x0000042A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(819), \ + .attributes = ZAP_ATTRIBUTE_INDEX(818), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3955,7 +3954,7 @@ { \ /* Endpoint: 1, Cluster: Formaldehyde Concentration Measurement (server) */ \ .clusterId = 0x0000042B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(832), \ + .attributes = ZAP_ATTRIBUTE_INDEX(831), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3968,7 +3967,7 @@ { \ /* Endpoint: 1, Cluster: PM1 Concentration Measurement (server) */ \ .clusterId = 0x0000042C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(845), \ + .attributes = ZAP_ATTRIBUTE_INDEX(844), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3981,7 +3980,7 @@ { \ /* Endpoint: 1, Cluster: PM10 Concentration Measurement (server) */ \ .clusterId = 0x0000042D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(858), \ + .attributes = ZAP_ATTRIBUTE_INDEX(857), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3994,7 +3993,7 @@ { \ /* Endpoint: 1, Cluster: Total Volatile Organic Compounds Concentration Measurement (server) */ \ .clusterId = 0x0000042E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(871), \ + .attributes = ZAP_ATTRIBUTE_INDEX(870), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4007,7 +4006,7 @@ { \ /* Endpoint: 1, Cluster: Radon Concentration Measurement (server) */ \ .clusterId = 0x0000042F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(884), \ + .attributes = ZAP_ATTRIBUTE_INDEX(883), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4020,7 +4019,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(897), \ + .attributes = ZAP_ATTRIBUTE_INDEX(896), \ .attributeCount = 3, \ .clusterSize = 19, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4033,7 +4032,7 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(900), \ + .attributes = ZAP_ATTRIBUTE_INDEX(899), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4046,7 +4045,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(902), \ + .attributes = ZAP_ATTRIBUTE_INDEX(901), \ .attributeCount = 13, \ .clusterSize = 32, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4059,7 +4058,7 @@ { \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ .clusterId = 0xFFF1FC05, \ - .attributes = ZAP_ATTRIBUTE_INDEX(915), \ + .attributes = ZAP_ATTRIBUTE_INDEX(914), \ .attributeCount = 84, \ .clusterSize = 2290, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4072,7 +4071,7 @@ { \ /* Endpoint: 2, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(999), \ + .attributes = ZAP_ATTRIBUTE_INDEX(998), \ .attributeCount = 4, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -4085,7 +4084,7 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1003), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1002), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4098,7 +4097,7 @@ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1006), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1005), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -4111,7 +4110,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1013), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1012), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4124,7 +4123,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1020), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1019), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4137,7 +4136,7 @@ { \ /* Endpoint: 2, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1029), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1028), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -4150,7 +4149,7 @@ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1034), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1033), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4163,7 +4162,7 @@ { \ /* Endpoint: 65534, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1039), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1038), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4176,7 +4175,7 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1045), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1044), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4195,7 +4194,7 @@ // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 29, 349 }, { ZAP_CLUSTER_INDEX(29), 74, 3522 }, { ZAP_CLUSTER_INDEX(103), 7, 126 }, \ + { ZAP_CLUSTER_INDEX(0), 29, 349 }, { ZAP_CLUSTER_INDEX(29), 74, 3521 }, { ZAP_CLUSTER_INDEX(103), 7, 126 }, \ { ZAP_CLUSTER_INDEX(110), 2, 0 }, \ } @@ -4208,7 +4207,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (36) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3997) +#define ATTRIBUTE_MAX_SIZE (3996) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/src/app/clusters/thermostat-server/thermostat-delegate.h b/src/app/clusters/thermostat-server/thermostat-delegate.h index 86c1e532b92fc2..2f70ec615f178a 100644 --- a/src/app/clusters/thermostat-server/thermostat-delegate.h +++ b/src/app/clusters/thermostat-server/thermostat-delegate.h @@ -64,6 +64,12 @@ class Delegate */ virtual CHIP_ERROR GetPresetAtIndex(size_t index, PresetStructWithOwnedMembers & preset) = 0; + /** + * @brief Creates a new pending presets list. + * + */ + virtual void BeginPendingPresetList() = 0; + /** * @brief Get the ActivePresetHandle attribute value. * diff --git a/src/app/clusters/thermostat-server/thermostat-server.cpp b/src/app/clusters/thermostat-server/thermostat-server.cpp index fe6cbb28e7d5d3..d680d2f04cf830 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.cpp +++ b/src/app/clusters/thermostat-server/thermostat-server.cpp @@ -116,18 +116,19 @@ void TimerExpiredCallback(System::Layer * systemLayer, void * callbackContext) VerifyOrReturn(delegate != nullptr, ChipLogError(Zcl, "Delegate is null. Unable to handle timer expired")); delegate->ClearPendingPresetList(); - gThermostatAttrAccess.SetPresetsEditable(endpoint, false); + gThermostatAttrAccess.SetAtomicWrite(endpoint, false); + gThermostatAttrAccess.SetAtomicWriteScopedNodeId(endpoint, ScopedNodeId()); } /** - * @brief Schedules a timer for the given timeout in seconds. + * @brief Schedules a timer for the given timeout in milliseconds. * * @param[in] endpoint The endpoint to use. - * @param[in] timeoutSeconds The timeout in seconds. + * @param[in] timeoutMilliseconds The timeout in milliseconds. */ -void ScheduleTimer(EndpointId endpoint, uint16_t timeoutSeconds) +void ScheduleTimer(EndpointId endpoint, uint16_t timeoutMilliseconds) { - DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(timeoutSeconds), TimerExpiredCallback, + DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds16(timeoutMilliseconds), TimerExpiredCallback, reinterpret_cast(static_cast(endpoint))); } @@ -141,18 +142,6 @@ void ClearTimer(EndpointId endpoint) DeviceLayer::SystemLayer().CancelTimer(TimerExpiredCallback, reinterpret_cast(static_cast(endpoint))); } -/** - * @brief Extends the currently scheduled timer to a new timeout value in seconds - * - * @param[in] endpoint The endpoint to use. - * @param[in] timeoutSeconds The timeout in seconds to extend the timer to. - */ -void ExtendTimer(EndpointId endpoint, uint16_t timeoutSeconds) -{ - DeviceLayer::SystemLayer().ExtendTimerTo(System::Clock::Seconds16(timeoutSeconds), TimerExpiredCallback, - reinterpret_cast(static_cast(endpoint))); -} - /** * @brief Checks if the preset is built-in * @@ -216,8 +205,8 @@ void CleanUp(Delegate * delegate, EndpointId endpoint) delegate->ClearPendingPresetList(); } ClearTimer(endpoint); - gThermostatAttrAccess.SetPresetsEditable(endpoint, false); - gThermostatAttrAccess.SetOriginatorScopedNodeId(endpoint, ScopedNodeId()); + gThermostatAttrAccess.SetAtomicWrite(endpoint, false); + gThermostatAttrAccess.SetAtomicWriteScopedNodeId(endpoint, ScopedNodeId()); } /** @@ -661,50 +650,50 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate) } } -void ThermostatAttrAccess::SetPresetsEditable(EndpointId endpoint, bool presetEditable) +void ThermostatAttrAccess::SetAtomicWrite(EndpointId endpoint, bool inProgress) { uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, Thermostat::Id, MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT); - if (ep < ArraySize(mPresetsEditables)) + if (ep < ArraySize(mAtomicWriteState)) { - mPresetsEditables[ep] = presetEditable; + mAtomicWriteState[ep] = inProgress; } } -bool ThermostatAttrAccess::GetPresetsEditable(EndpointId endpoint) +bool ThermostatAttrAccess::InAtomicWrite(EndpointId endpoint) { - bool presetEditable = false; + bool inAtomicWrite = false; uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, Thermostat::Id, MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT); - if (ep < ArraySize(mPresetsEditables)) + if (ep < ArraySize(mAtomicWriteState)) { - presetEditable = mPresetsEditables[ep]; + inAtomicWrite = mAtomicWriteState[ep]; } - return presetEditable; + return inAtomicWrite; } -void ThermostatAttrAccess::SetOriginatorScopedNodeId(EndpointId endpoint, ScopedNodeId originatorNodeId) +void ThermostatAttrAccess::SetAtomicWriteScopedNodeId(EndpointId endpoint, ScopedNodeId originatorNodeId) { uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, Thermostat::Id, MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT); - if (ep < ArraySize(mPresetEditRequestOriginatorNodeIds)) + if (ep < ArraySize(mAtomicWriteNodeIds)) { - mPresetEditRequestOriginatorNodeIds[ep] = originatorNodeId; + mAtomicWriteNodeIds[ep] = originatorNodeId; } } -ScopedNodeId ThermostatAttrAccess::GetOriginatorScopedNodeId(EndpointId endpoint) +ScopedNodeId ThermostatAttrAccess::GetAtomicWriteScopedNodeId(EndpointId endpoint) { ScopedNodeId originatorNodeId = ScopedNodeId(); uint16_t ep = emberAfGetClusterServerEndpointIndex(endpoint, Thermostat::Id, MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT); - if (ep < ArraySize(mPresetEditRequestOriginatorNodeIds)) + if (ep < ArraySize(mAtomicWriteNodeIds)) { - originatorNodeId = mPresetEditRequestOriginatorNodeIds[ep]; + originatorNodeId = mAtomicWriteNodeIds[ep]; } return originatorNodeId; } @@ -743,6 +732,9 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A Delegate * delegate = GetDelegate(aPath.mEndpointId); VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INCORRECT_STATE, ChipLogError(Zcl, "Delegate is null")); + if (InAtomicWrite(aPath.mEndpointId)) + { + } return aEncoder.EncodeList([delegate](const auto & encoder) -> CHIP_ERROR { for (uint8_t i = 0; true; i++) { @@ -784,10 +776,6 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A }); } break; - case PresetsSchedulesEditable::Id: { - ReturnErrorOnFailure(aEncoder.Encode(GetPresetsEditable(aPath.mEndpointId))); - } - break; case ActivePresetHandle::Id: { Delegate * delegate = GetDelegate(aPath.mEndpointId); VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INCORRECT_STATE, ChipLogError(Zcl, "Delegate is null")); @@ -854,7 +842,7 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, VerifyOrReturnError(delegate != nullptr, CHIP_ERROR_INCORRECT_STATE, ChipLogError(Zcl, "Delegate is null")); // Presets are not editable, return INVALID_IN_STATE. - VerifyOrReturnError(GetPresetsEditable(endpoint), CHIP_IM_GLOBAL_STATUS(InvalidInState), + VerifyOrReturnError(InAtomicWrite(endpoint), CHIP_IM_GLOBAL_STATUS(InvalidInState), ChipLogError(Zcl, "Presets are not editable")); // Check if the OriginatorScopedNodeId at the endpoint is the same as the node editing the presets, @@ -868,7 +856,7 @@ CHIP_ERROR ThermostatAttrAccess::Write(const ConcreteDataAttributePath & aPath, scopedNodeId = ScopedNodeId(subjectDescriptor.subject, subjectDescriptor.fabricIndex); } - if (GetOriginatorScopedNodeId(endpoint) != scopedNodeId) + if (GetAtomicWriteScopedNodeId(endpoint) != scopedNodeId) { ChipLogError(Zcl, "Another node is editing presets. Server is busy. Try again later"); return CHIP_IM_GLOBAL_STATUS(Busy); @@ -1287,102 +1275,122 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback( return true; } -bool emberAfThermostatClusterStartPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::DecodableType & commandData) +bool validAtomicAttributes(const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) { - ScopedNodeId sourceNodeId = GetSourceScopedNodeId(commandObj); - - EndpointId endpoint = commandPath.mEndpointId; - - // If the presets are editable and the scoped node id of the client sending StartPresetsSchedulesEditRequest command - // is not the same as the one that previously originated a StartPresetsSchedulesEditRequest command, return BUSY. - if (gThermostatAttrAccess.GetPresetsEditable(endpoint) && - (gThermostatAttrAccess.GetOriginatorScopedNodeId(endpoint) != sourceNodeId)) + auto attributeIdsIter = commandData.attributeRequests.begin(); + bool requestedPresets, requestedSchedules; + while (attributeIdsIter.Next()) { - commandObj->AddStatus(commandPath, imcode::Busy); - return true; - } + auto & attributeId = attributeIdsIter.GetValue(); - // If presets are editable and the scoped node id of the client sending StartPresetsSchedulesEditRequest command - // is the same as the one that previously originated a StartPresetsSchedulesEditRequest command, extend the timer. - if (gThermostatAttrAccess.GetPresetsEditable(endpoint)) - { - ExtendTimer(endpoint, commandData.timeoutSeconds); - commandObj->AddStatus(commandPath, imcode::Success); - return true; + switch (attributeId) + { + case Presets::Id: + if (requestedPresets) + { + return false; + } + requestedPresets = true; + break; + case Schedules::Id: + if (requestedSchedules) + { + return false; + } + requestedSchedules = true; + break; + default: + return false; + } } - - // Set presets editable to true and the scoped originator node id to the source scoped node id, and start a timer with the - // timeout in seconds passed in the command args. Return success. - gThermostatAttrAccess.SetPresetsEditable(endpoint, true); - gThermostatAttrAccess.SetOriginatorScopedNodeId(endpoint, sourceNodeId); - ScheduleTimer(endpoint, commandData.timeoutSeconds); - commandObj->AddStatus(commandPath, imcode::Success); return true; } -bool emberAfThermostatClusterCancelPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::DecodableType & commandData) +bool handleAtomicBegin(chip::app::CommandHandler * commandObj, const ScopedNodeId & sourceNodeId, + const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) { EndpointId endpoint = commandPath.mEndpointId; - // If presets are not editable, return INVALID_IN_STATE. - if (!gThermostatAttrAccess.GetPresetsEditable(endpoint)) + if (!commandData.timeout.HasValue()) { - commandObj->AddStatus(commandPath, imcode::InvalidInState); + commandObj->AddStatus(commandPath, imcode::InvalidCommand); return true; } - ScopedNodeId sourceNodeId = GetSourceScopedNodeId(commandObj); + auto timeout = commandData.timeout.Value(); - // If the node id sending the CancelPresetsSchedulesRequest command is not the same as the one which send the - // previous StartPresetsSchedulesEditRequest, return UNSUPPORTED_ACCESS. - if (gThermostatAttrAccess.GetOriginatorScopedNodeId(endpoint) != sourceNodeId) + if (!validAtomicAttributes(commandData)) { - commandObj->AddStatus(commandPath, imcode::UnsupportedAccess); + commandObj->AddStatus(commandPath, imcode::InvalidCommand); return true; } - Delegate * delegate = GetDelegate(endpoint); - - if (delegate == nullptr) + bool inAtomicWrite = gThermostatAttrAccess.InAtomicWrite(endpoint); + if (inAtomicWrite) { - ChipLogError(Zcl, "Delegate is null"); - return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::InvalidInState); + chip::app::Clusters::Thermostat::Commands::AtomicResponse::Type response; + Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = { + { .attributeID = Presets::Id, .statusCode = static_cast(imcode::Busy) }, + { .attributeID = Schedules::Id, .statusCode = static_cast(imcode::Busy) } + }; + + response.statusCode = static_cast(imcode::Failure); + response.attributeStatus = attributeStatus; + commandObj->AddResponse(commandPath, response); + // commandObj->AddStatus(commandPath, imcode::Busy); + return true; } - // Clear the timer, discard the changes and set PresetsEditable to false. - return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::Success); + uint16_t maxTimeout = 5000; + timeout = std::min(timeout, maxTimeout); + + ScheduleTimer(endpoint, timeout); + gThermostatAttrAccess.SetAtomicWrite(endpoint, true); + gThermostatAttrAccess.SetAtomicWriteScopedNodeId(endpoint, GetSourceScopedNodeId(commandObj)); + chip::app::Clusters::Thermostat::Commands::AtomicResponse::Type response; + Structs::AtomicAttributeStatusStruct::Type attributeStatus[] = { + { .attributeID = Presets::Id, .statusCode = static_cast(imcode::Success) }, + { .attributeID = Schedules::Id, .statusCode = static_cast(imcode::Success) } + }; + + response.statusCode = static_cast(imcode::Failure); + response.attributeStatus = attributeStatus; + response.timeout.Emplace(timeout); + commandObj->AddResponse(commandPath, response); + + return true; } -bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::DecodableType & commandData) +bool handleAtomicCommit(chip::app::CommandHandler * commandObj, const ScopedNodeId & sourceNodeId, + const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) { + if (!validAtomicAttributes(commandData)) + { + commandObj->AddStatus(commandPath, imcode::InvalidCommand); + return true; + } EndpointId endpoint = commandPath.mEndpointId; - Delegate * delegate = GetDelegate(endpoint); - - if (delegate == nullptr) + bool inAtomicWrite = gThermostatAttrAccess.InAtomicWrite(endpoint); + if (!inAtomicWrite) { - ChipLogError(Zcl, "Delegate is null"); - return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::InvalidInState); + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; } - // If presets are not editable, return INVALID_IN_STATE. - if (!gThermostatAttrAccess.GetPresetsEditable(endpoint)) + if (gThermostatAttrAccess.GetAtomicWriteScopedNodeId(endpoint) != sourceNodeId) { - return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::InvalidInState); + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; } - ScopedNodeId sourceNodeId = GetSourceScopedNodeId(commandObj); + Delegate * delegate = GetDelegate(endpoint); - // If the node id sending the CommitPresetsSchedulesRequest command is not the same as the one which send the - // StartPresetsSchedulesEditRequest, return UNSUPPORTED_ACCESS. - if (gThermostatAttrAccess.GetOriginatorScopedNodeId(endpoint) != sourceNodeId) + if (delegate == nullptr) { - commandObj->AddStatus(commandPath, imcode::UnsupportedAccess); + ChipLogError(Zcl, "Delegate is null"); + commandObj->AddStatus(commandPath, imcode::InvalidInState); return true; } @@ -1439,7 +1447,6 @@ bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::InvalidInState); } } - // For each preset in the pending presets list, check that the preset does not violate any spec constraints. for (uint8_t i = 0; true; i++) { @@ -1561,6 +1568,64 @@ bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::Success); } +bool handleAtomicRollback(chip::app::CommandHandler * commandObj, const ScopedNodeId & sourceNodeId, + const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) +{ + if (!validAtomicAttributes(commandData)) + { + commandObj->AddStatus(commandPath, imcode::InvalidCommand); + return true; + } + EndpointId endpoint = commandPath.mEndpointId; + bool inAtomicWrite = gThermostatAttrAccess.InAtomicWrite(endpoint); + if (!inAtomicWrite) + { + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; + } + + if (gThermostatAttrAccess.GetAtomicWriteScopedNodeId(endpoint) != sourceNodeId) + { + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; + } + Delegate * delegate = GetDelegate(endpoint); + + if (delegate == nullptr) + { + ChipLogError(Zcl, "Delegate is null"); + commandObj->AddStatus(commandPath, imcode::InvalidInState); + return true; + } + return SendResponseAndCleanUp(delegate, endpoint, commandObj, commandPath, imcode::Success); +} + +bool emberAfThermostatClusterAtomicRequestCallback( + chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData) +{ + auto & requestType = commandData.requestType; + // auto & timeout = commandData.timeout; + + ScopedNodeId sourceNodeId = GetSourceScopedNodeId(commandObj); + + switch (requestType) + { + case AtomicRequestTypeEnum::kBeginWrite: + return handleAtomicBegin(commandObj, sourceNodeId, commandPath, commandData); + case AtomicRequestTypeEnum::kCommitWrite: + return handleAtomicCommit(commandObj, sourceNodeId, commandPath, commandData); + case AtomicRequestTypeEnum::kRollbackWrite: + return handleAtomicRollback(commandObj, sourceNodeId, commandPath, commandData); + case AtomicRequestTypeEnum::kUnknownEnumValue: + commandObj->AddStatus(commandPath, imcode::InvalidCommand); + return true; + } + + return false; +} + bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, const Commands::SetpointRaiseLower::DecodableType & commandData) @@ -1610,13 +1675,13 @@ bool emberAfThermostatClusterSetpointRaiseLowerCallback(app::CommandHandler * co { DesiredCoolingSetpoint = static_cast(CoolingSetpoint + amount * 10); CoolLimit = static_cast(DesiredCoolingSetpoint - - EnforceCoolingSetpointLimits(DesiredCoolingSetpoint, aEndpointId)); + EnforceCoolingSetpointLimits(DesiredCoolingSetpoint, aEndpointId)); { if (OccupiedHeatingSetpoint::Get(aEndpointId, &HeatingSetpoint) == imcode::Success) { DesiredHeatingSetpoint = static_cast(HeatingSetpoint + amount * 10); HeatLimit = static_cast(DesiredHeatingSetpoint - - EnforceHeatingSetpointLimits(DesiredHeatingSetpoint, aEndpointId)); + EnforceHeatingSetpointLimits(DesiredHeatingSetpoint, aEndpointId)); { if (CoolLimit != 0 || HeatLimit != 0) { diff --git a/src/app/clusters/thermostat-server/thermostat-server.h b/src/app/clusters/thermostat-server/thermostat-server.h index 955ab9e5c5a777..64e4bb7bce3c82 100644 --- a/src/app/clusters/thermostat-server/thermostat-server.h +++ b/src/app/clusters/thermostat-server/thermostat-server.h @@ -48,45 +48,44 @@ class ThermostatAttrAccess : public chip::app::AttributeAccessInterface CHIP_ERROR Write(const ConcreteDataAttributePath & aPath, chip::app::AttributeValueDecoder & aDecoder) override; /** - * @brief Sets the scoped node id of the originator that send the last successful - * StartPresetsSchedulesEditRequest for the given endpoint. + * @brief Sets the scoped node id of the originator that sent the last successful + * AtomicRequest of type BeginWrite for the given endpoint. * * @param[in] endpoint The endpoint. * @param[in] originatorNodeId The originator scoped node id. */ - void SetOriginatorScopedNodeId(EndpointId endpoint, ScopedNodeId originatorNodeId); + void SetAtomicWriteScopedNodeId(EndpointId endpoint, ScopedNodeId originatorNodeId); /** - * @brief Gets the scoped node id of the originator that send the last successful - * StartPresetsSchedulesEditRequest for the given endpoint. + * @brief Gets the scoped node id of the originator that sent the last successful + * AtomicRequest of type BeginWrite for the given endpoint. * * @param[in] endpoint The endpoint. * * @return the scoped node id for the given endpoint if set. Otherwise returns ScopedNodeId(). */ - ScopedNodeId GetOriginatorScopedNodeId(EndpointId endpoint); + ScopedNodeId GetAtomicWriteScopedNodeId(EndpointId endpoint); /** - * @brief Sets the presets editable flag for the given endpoint + * @brief Sets whether an atomic write is in progress for the given endpoint * * @param[in] endpoint The endpoint. - * @param[in] presetEditable The value of the presets editable. + * @param[in] inProgress Whether or not an atomic write is in progress. */ - void SetPresetsEditable(EndpointId endpoint, bool presetEditable); + void SetAtomicWrite(EndpointId endpoint, bool inProgress); /** - * @brief Gets the prests editable flag value for the given endpoint + * @brief Gets whether an atomic write is in progress for the given endpoint * * @param[in] endpoint The endpoint. * - * @return the presets editable flag value for the given endpoint if set. Otherwise returns false. + * @return Whether an atomic write is in progress for the given endpoint */ - bool GetPresetsEditable(EndpointId endpoint); + bool InAtomicWrite(EndpointId endpoint); private: - ScopedNodeId mPresetEditRequestOriginatorNodeIds[kThermostatEndpointCount]; - - bool mPresetsEditables[kThermostatEndpointCount]; + ScopedNodeId mAtomicWriteNodeIds[kThermostatEndpointCount]; + bool mAtomicWriteState[kThermostatEndpointCount]; }; /** diff --git a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml index 666b6df9f80322..c0c28197e69430 100644 --- a/src/app/zap-templates/zcl/data-model/chip/global-structs.xml +++ b/src/app/zap-templates/zcl/data-model/chip/global-structs.xml @@ -26,8 +26,8 @@ TODO: Make these structures global rather than defining them for each cluster. - - + + diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 626ebc5bcfa446..df435472592eaa 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -6537,7 +6537,7 @@ cluster PumpConfigurationAndControl = 512 { /** An interface for configuring and controlling the functionality of a thermostat. */ cluster Thermostat = 513 { - revision 6; + revision 7; enum ACCapacityFormatEnum : enum8 { kBTUh = 0; @@ -6573,6 +6573,12 @@ cluster Thermostat = 513 { kHeatPumpInverter = 4; } + enum AtomicRequestTypeEnum : enum8 { + kBeginWrite = 0; + kCommitWrite = 1; + kRollbackWrite = 2; + } + enum ControlSequenceOfOperationEnum : enum8 { kCoolingOnly = 0; kCoolingWithReheat = 1; @@ -6583,7 +6589,6 @@ cluster Thermostat = 513 { } enum PresetScenarioEnum : enum8 { - kUnspecified = 0; kOccupied = 1; kUnoccupied = 2; kSleep = 3; @@ -6656,7 +6661,6 @@ cluster Thermostat = 513 { kLocalTemperatureNotExposed = 0x40; kMatterScheduleConfiguration = 0x80; kPresets = 0x100; - kSetpoints = 0x200; } bitmap HVACSystemTypeBitmap : bitmap8 { @@ -6666,6 +6670,10 @@ cluster Thermostat = 513 { kHeatingUsesFuel = 0x20; } + bitmap OccupancyBitmap : bitmap8 { + kOccupied = 0x1; + } + bitmap PresetTypeFeaturesBitmap : bitmap16 { kAutomatic = 0x1; kSupportsNames = 0x2; @@ -6731,7 +6739,12 @@ cluster Thermostat = 513 { optional char_string<64> name = 2; optional octet_string<16> presetHandle = 3; ScheduleTransitionStruct transitions[] = 4; - optional nullable boolean builtIn = 5; + nullable boolean builtIn = 5; + } + + struct AtomicAttributeStatusStruct { + attrib_id attributeID = 0; + status statusCode = 1; } struct PresetStruct { @@ -6763,23 +6776,23 @@ cluster Thermostat = 513 { readonly attribute nullable temperature localTemperature = 0; readonly attribute optional nullable temperature outdoorTemperature = 1; - readonly attribute optional bitmap8 occupancy = 2; + readonly attribute optional OccupancyBitmap occupancy = 2; readonly attribute optional temperature absMinHeatSetpointLimit = 3; readonly attribute optional temperature absMaxHeatSetpointLimit = 4; readonly attribute optional temperature absMinCoolSetpointLimit = 5; readonly attribute optional temperature absMaxCoolSetpointLimit = 6; readonly attribute optional int8u PICoolingDemand = 7; readonly attribute optional int8u PIHeatingDemand = 8; - attribute access(write: manage) optional bitmap8 HVACSystemTypeConfiguration = 9; + attribute access(write: manage) optional HVACSystemTypeBitmap HVACSystemTypeConfiguration = 9; attribute access(write: manage) optional int8s localTemperatureCalibration = 16; - attribute optional int16s occupiedCoolingSetpoint = 17; - attribute optional int16s occupiedHeatingSetpoint = 18; - attribute optional int16s unoccupiedCoolingSetpoint = 19; - attribute optional int16s unoccupiedHeatingSetpoint = 20; - attribute access(write: manage) optional int16s minHeatSetpointLimit = 21; - attribute access(write: manage) optional int16s maxHeatSetpointLimit = 22; - attribute access(write: manage) optional int16s minCoolSetpointLimit = 23; - attribute access(write: manage) optional int16s maxCoolSetpointLimit = 24; + attribute optional temperature occupiedCoolingSetpoint = 17; + attribute optional temperature occupiedHeatingSetpoint = 18; + attribute optional temperature unoccupiedCoolingSetpoint = 19; + attribute optional temperature unoccupiedHeatingSetpoint = 20; + attribute access(write: manage) optional temperature minHeatSetpointLimit = 21; + attribute access(write: manage) optional temperature maxHeatSetpointLimit = 22; + attribute access(write: manage) optional temperature minCoolSetpointLimit = 23; + attribute access(write: manage) optional temperature maxCoolSetpointLimit = 24; attribute access(write: manage) optional int8s minSetpointDeadBand = 25; attribute access(write: manage) optional RemoteSensingBitmap remoteSensing = 26; attribute access(write: manage) ControlSequenceOfOperationEnum controlSequenceOfOperation = 27; @@ -6809,7 +6822,7 @@ cluster Thermostat = 513 { attribute access(write: manage) optional ACErrorCodeBitmap ACErrorCode = 68; attribute access(write: manage) optional ACLouverPositionEnum ACLouverPosition = 69; readonly attribute optional nullable temperature ACCoilTemperature = 70; - attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityformat = 71; + attribute access(write: manage) optional ACCapacityFormatEnum ACCapacityFormat = 71; readonly attribute optional PresetTypeStruct presetTypes[] = 72; readonly attribute optional ScheduleTypeStruct scheduleTypes[] = 73; readonly attribute optional int8u numberOfPresets = 74; @@ -6820,8 +6833,7 @@ cluster Thermostat = 513 { readonly attribute optional nullable octet_string<16> activeScheduleHandle = 79; attribute access(write: manage) optional PresetStruct presets[] = 80; attribute access(write: manage) optional ScheduleStruct schedules[] = 81; - readonly attribute optional boolean presetsSchedulesEditable = 82; - readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 83; + readonly attribute optional nullable epoch_s setpointHoldExpiryTimestamp = 82; readonly attribute command_id generatedCommandList[] = 65528; readonly attribute command_id acceptedCommandList[] = 65529; readonly attribute event_id eventList[] = 65530; @@ -6861,28 +6873,32 @@ cluster Thermostat = 513 { octet_string<16> presetHandle = 0; } - request struct StartPresetsSchedulesEditRequestRequest { - int16u timeoutSeconds = 0; + response struct AtomicResponse = 253 { + status statusCode = 0; + AtomicAttributeStatusStruct attributeStatus[] = 1; + optional int16u timeout = 2; + } + + request struct AtomicRequestRequest { + AtomicRequestTypeEnum requestType = 0; + attrib_id attributeRequests[] = 1; + optional int16u timeout = 2; } - /** Command description for SetpointRaiseLower */ + /** Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ command SetpointRaiseLower(SetpointRaiseLowerRequest): DefaultSuccess = 0; - /** Command description for SetWeeklySchedule */ + /** Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ command access(invoke: manage) SetWeeklySchedule(SetWeeklyScheduleRequest): DefaultSuccess = 1; - /** Command description for GetWeeklySchedule */ + /** Upon receipt, the unit SHOULD send in return the Get */ command GetWeeklySchedule(GetWeeklyScheduleRequest): GetWeeklyScheduleResponse = 2; - /** This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. */ + /** This command is used to clear the weekly schedule. */ command access(invoke: manage) ClearWeeklySchedule(): DefaultSuccess = 3; - /** This command is used to set the active schedule. */ + /** Upon receipt, if the */ command SetActiveScheduleRequest(SetActiveScheduleRequestRequest): DefaultSuccess = 5; - /** This command is used to set the active preset. */ + /** ID */ command SetActivePresetRequest(SetActivePresetRequestRequest): DefaultSuccess = 6; - /** This command is used to start editing the presets and schedules. */ - command access(invoke: manage) StartPresetsSchedulesEditRequest(StartPresetsSchedulesEditRequestRequest): DefaultSuccess = 7; - /** This command is used to cancel editing presets and schedules. */ - command access(invoke: manage) CancelPresetsSchedulesEditRequest(): DefaultSuccess = 8; - /** This command is used to notify the server that all edits are done and should be committed. */ - command access(invoke: manage) CommitPresetsSchedulesRequest(): DefaultSuccess = 9; + /** Begins, Commits or Cancels an atomic write */ + command access(invoke: manage) AtomicRequest(AtomicRequestRequest): AtomicResponse = 254; } /** An interface for controlling a fan in a heating/cooling system. */ diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index 7242afb7dac5f8..1c4f37b4650acd 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -40197,7 +40197,7 @@ public static class ThermostatCluster extends BaseChipCluster { private static final long A_C_ERROR_CODE_ATTRIBUTE_ID = 68L; private static final long A_C_LOUVER_POSITION_ATTRIBUTE_ID = 69L; private static final long A_C_COIL_TEMPERATURE_ATTRIBUTE_ID = 70L; - private static final long A_C_CAPACITYFORMAT_ATTRIBUTE_ID = 71L; + private static final long A_C_CAPACITY_FORMAT_ATTRIBUTE_ID = 71L; private static final long PRESET_TYPES_ATTRIBUTE_ID = 72L; private static final long SCHEDULE_TYPES_ATTRIBUTE_ID = 73L; private static final long NUMBER_OF_PRESETS_ATTRIBUTE_ID = 74L; @@ -40208,8 +40208,7 @@ public static class ThermostatCluster extends BaseChipCluster { private static final long ACTIVE_SCHEDULE_HANDLE_ATTRIBUTE_ID = 79L; private static final long PRESETS_ATTRIBUTE_ID = 80L; private static final long SCHEDULES_ATTRIBUTE_ID = 81L; - private static final long PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID = 82L; - private static final long SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID = 83L; + private static final long SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID = 82L; 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; @@ -40394,55 +40393,55 @@ public void onResponse(StructType invokeStructValue) { }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds) { - startPresetsSchedulesEditRequest(callback, timeoutSeconds, 0); + public void atomicRequest(AtomicResponseCallback callback, Integer requestType, ArrayList attributeRequests, Optional timeout) { + atomicRequest(callback, requestType, attributeRequests, timeout, 0); } - public void startPresetsSchedulesEditRequest(DefaultClusterCallback callback, Integer timeoutSeconds, int timedInvokeTimeoutMs) { - final long commandId = 7L; + public void atomicRequest(AtomicResponseCallback callback, Integer requestType, ArrayList attributeRequests, Optional timeout, int timedInvokeTimeoutMs) { + final long commandId = 254L; ArrayList elements = new ArrayList<>(); - final long timeoutSecondsFieldID = 0L; - BaseTLVType timeoutSecondstlvValue = new UIntType(timeoutSeconds); - elements.add(new StructElement(timeoutSecondsFieldID, timeoutSecondstlvValue)); + final long requestTypeFieldID = 0L; + BaseTLVType requestTypetlvValue = new UIntType(requestType); + elements.add(new StructElement(requestTypeFieldID, requestTypetlvValue)); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } + final long attributeRequestsFieldID = 1L; + BaseTLVType attributeRequeststlvValue = ArrayType.generateArrayType(attributeRequests, (elementattributeRequests) -> new UIntType(elementattributeRequests)); + elements.add(new StructElement(attributeRequestsFieldID, attributeRequeststlvValue)); - public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback) { - cancelPresetsSchedulesEditRequest(callback, 0); - } - - public void cancelPresetsSchedulesEditRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 8L; - - 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 void commitPresetsSchedulesRequest(DefaultClusterCallback callback) { - commitPresetsSchedulesRequest(callback, 0); - } - - public void commitPresetsSchedulesRequest(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 9L; + final long timeoutFieldID = 2L; + BaseTLVType timeouttlvValue = timeout.map((nonOptionaltimeout) -> new UIntType(nonOptionaltimeout)).orElse(new EmptyType()); + elements.add(new StructElement(timeoutFieldID, timeouttlvValue)); - ArrayList elements = new ArrayList<>(); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); + final long statusCodeFieldID = 0L; + Integer statusCode = null; + final long attributeStatusFieldID = 1L; + ArrayList attributeStatus = null; + final long timeoutFieldID = 2L; + Optional timeout = Optional.empty(); + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusCodeFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + statusCode = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == attributeStatusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.Array) { + ArrayType castingValue = element.value(ArrayType.class); + attributeStatus = castingValue.map((elementcastingValue) -> ChipStructs.ThermostatClusterAtomicAttributeStatusStruct.decodeTlv(elementcastingValue)); + } + } else if (element.contextTagNum() == timeoutFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + timeout = Optional.of(castingValue.value(Integer.class)); + } + } + } + callback.onSuccess(statusCode, attributeStatus, timeout); }}, commandId, commandArgs, timedInvokeTimeoutMs); } @@ -40450,6 +40449,10 @@ public interface GetWeeklyScheduleResponseCallback extends BaseClusterCallback { void onSuccess(Integer numberOfTransitionsForSequence, Integer dayOfWeekForSequence, Integer modeForSequence, ArrayList transitions); } + public interface AtomicResponseCallback extends BaseClusterCallback { + void onSuccess(Integer statusCode, ArrayList attributeStatus, Optional timeout); + } + public interface LocalTemperatureAttributeCallback extends BaseAttributeCallback { void onSuccess(@Nullable Integer value); } @@ -42024,9 +42027,9 @@ public void onSuccess(byte[] tlv) { }, A_C_COIL_TEMPERATURE_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readACCapacityformatAttribute( + public void readACCapacityFormatAttribute( IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITYFORMAT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -42034,21 +42037,21 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, A_C_CAPACITYFORMAT_ATTRIBUTE_ID, true); + }, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, true); } - public void writeACCapacityformatAttribute(DefaultClusterCallback callback, Integer value) { - writeACCapacityformatAttribute(callback, value, 0); + public void writeACCapacityFormatAttribute(DefaultClusterCallback callback, Integer value) { + writeACCapacityFormatAttribute(callback, value, 0); } - public void writeACCapacityformatAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { + public void writeACCapacityFormatAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), A_C_CAPACITYFORMAT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + writeAttribute(new WriteAttributesCallbackImpl(callback), A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); } - public void subscribeACCapacityformatAttribute( + public void subscribeACCapacityFormatAttribute( IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITYFORMAT_ATTRIBUTE_ID); + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override @@ -42056,7 +42059,7 @@ public void onSuccess(byte[] tlv) { Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, A_C_CAPACITYFORMAT_ATTRIBUTE_ID, minInterval, maxInterval); + }, A_C_CAPACITY_FORMAT_ATTRIBUTE_ID, minInterval, maxInterval); } public void readPresetTypesAttribute( @@ -42337,32 +42340,6 @@ public void onSuccess(byte[] tlv) { }, SCHEDULES_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readPresetsSchedulesEditableAttribute( - BooleanAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID, true); - } - - public void subscribePresetsSchedulesEditableAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESETS_SCHEDULES_EDITABLE_ATTRIBUTE_ID, minInterval, maxInterval); - } - public void readSetpointHoldExpiryTimestampAttribute( SetpointHoldExpiryTimestampAttributeCallback callback) { ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SETPOINT_HOLD_EXPIRY_TIMESTAMP_ATTRIBUTE_ID); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java index c62c3062fa3bc4..bd800063e9101f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipStructs.java @@ -9465,7 +9465,7 @@ public static class ThermostatClusterScheduleStruct { public Optional name; public Optional presetHandle; public ArrayList transitions; - public @Nullable Optional builtIn; + public @Nullable Boolean builtIn; private static final long SCHEDULE_HANDLE_ID = 0L; private static final long SYSTEM_MODE_ID = 1L; private static final long NAME_ID = 2L; @@ -9479,7 +9479,7 @@ public ThermostatClusterScheduleStruct( Optional name, Optional presetHandle, ArrayList transitions, - @Nullable Optional builtIn + @Nullable Boolean builtIn ) { this.scheduleHandle = scheduleHandle; this.systemMode = systemMode; @@ -9496,7 +9496,7 @@ public StructType encodeTlv() { values.add(new StructElement(NAME_ID, name.map((nonOptionalname) -> new StringType(nonOptionalname)).orElse(new EmptyType()))); values.add(new StructElement(PRESET_HANDLE_ID, presetHandle.map((nonOptionalpresetHandle) -> new ByteArrayType(nonOptionalpresetHandle)).orElse(new EmptyType()))); values.add(new StructElement(TRANSITIONS_ID, ArrayType.generateArrayType(transitions, (elementtransitions) -> elementtransitions.encodeTlv()))); - values.add(new StructElement(BUILT_IN_ID, builtIn != null ? builtIn.map((nonOptionalbuiltIn) -> new BooleanType(nonOptionalbuiltIn)).orElse(new EmptyType()) : new NullType())); + values.add(new StructElement(BUILT_IN_ID, builtIn != null ? new BooleanType(builtIn) : new NullType())); return new StructType(values); } @@ -9510,7 +9510,7 @@ public static ThermostatClusterScheduleStruct decodeTlv(BaseTLVType tlvValue) { Optional name = Optional.empty(); Optional presetHandle = Optional.empty(); ArrayList transitions = null; - @Nullable Optional builtIn = null; + @Nullable Boolean builtIn = null; for (StructElement element: ((StructType)tlvValue).value()) { if (element.contextTagNum() == SCHEDULE_HANDLE_ID) { if (element.value(BaseTLVType.class).type() == TLVType.ByteArray) { @@ -9540,7 +9540,7 @@ public static ThermostatClusterScheduleStruct decodeTlv(BaseTLVType tlvValue) { } else if (element.contextTagNum() == BUILT_IN_ID) { if (element.value(BaseTLVType.class).type() == TLVType.Boolean) { BooleanType castingValue = element.value(BooleanType.class); - builtIn = Optional.of(castingValue.value(Boolean.class)); + builtIn = castingValue.value(Boolean.class); } } } @@ -9580,6 +9580,67 @@ public String toString() { return output.toString(); } } +public static class ThermostatClusterAtomicAttributeStatusStruct { + public Long attributeID; + public Integer statusCode; + private static final long ATTRIBUTE_I_D_ID = 0L; + private static final long STATUS_CODE_ID = 1L; + + public ThermostatClusterAtomicAttributeStatusStruct( + Long attributeID, + Integer statusCode + ) { + this.attributeID = attributeID; + this.statusCode = statusCode; + } + + public StructType encodeTlv() { + ArrayList values = new ArrayList<>(); + values.add(new StructElement(ATTRIBUTE_I_D_ID, new UIntType(attributeID))); + values.add(new StructElement(STATUS_CODE_ID, new UIntType(statusCode))); + + return new StructType(values); + } + + public static ThermostatClusterAtomicAttributeStatusStruct decodeTlv(BaseTLVType tlvValue) { + if (tlvValue == null || tlvValue.type() != TLVType.Struct) { + return null; + } + Long attributeID = null; + Integer statusCode = null; + for (StructElement element: ((StructType)tlvValue).value()) { + if (element.contextTagNum() == ATTRIBUTE_I_D_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + attributeID = castingValue.value(Long.class); + } + } else if (element.contextTagNum() == STATUS_CODE_ID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + statusCode = castingValue.value(Integer.class); + } + } + } + return new ThermostatClusterAtomicAttributeStatusStruct( + attributeID, + statusCode + ); + } + + @Override + public String toString() { + StringBuilder output = new StringBuilder(); + output.append("ThermostatClusterAtomicAttributeStatusStruct {\n"); + output.append("\tattributeID: "); + output.append(attributeID); + output.append("\n"); + output.append("\tstatusCode: "); + output.append(statusCode); + output.append("\n"); + output.append("}\n"); + return output.toString(); + } +} public static class ThermostatClusterPresetStruct { public @Nullable byte[] presetHandle; public Integer presetScenario; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index fa7487aec8e28e..f4c71003ab4d16 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -11880,7 +11880,7 @@ public enum Attribute { ACErrorCode(68L), ACLouverPosition(69L), ACCoilTemperature(70L), - ACCapacityformat(71L), + ACCapacityFormat(71L), PresetTypes(72L), ScheduleTypes(73L), NumberOfPresets(74L), @@ -11891,8 +11891,7 @@ public enum Attribute { ActiveScheduleHandle(79L), Presets(80L), Schedules(81L), - PresetsSchedulesEditable(82L), - SetpointHoldExpiryTimestamp(83L), + SetpointHoldExpiryTimestamp(82L), GeneratedCommandList(65528L), AcceptedCommandList(65529L), EventList(65530L), @@ -11945,9 +11944,7 @@ public enum Command { ClearWeeklySchedule(3L), SetActiveScheduleRequest(5L), SetActivePresetRequest(6L), - StartPresetsSchedulesEditRequest(7L), - CancelPresetsSchedulesEditRequest(8L), - CommitPresetsSchedulesRequest(9L),; + AtomicRequest(254L),; private final long id; Command(long id) { this.id = id; @@ -12050,17 +12047,17 @@ public static SetActivePresetRequestCommandField value(int id) throws NoSuchFiel } throw new NoSuchFieldError(); } - }public enum StartPresetsSchedulesEditRequestCommandField {TimeoutSeconds(0),; + }public enum AtomicRequestCommandField {RequestType(0),AttributeRequests(1),Timeout(2),; private final int id; - StartPresetsSchedulesEditRequestCommandField(int id) { + AtomicRequestCommandField(int id) { this.id = id; } public int getID() { return id; } - public static StartPresetsSchedulesEditRequestCommandField value(int id) throws NoSuchFieldError { - for (StartPresetsSchedulesEditRequestCommandField field : StartPresetsSchedulesEditRequestCommandField.values()) { + public static AtomicRequestCommandField value(int id) throws NoSuchFieldError { + for (AtomicRequestCommandField field : AtomicRequestCommandField.values()) { if (field.getID() == id) { return field; } diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 70d351e0ef2751..6b94b9e80926f1 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -13801,6 +13801,33 @@ public void onError(Exception error) { callback.onFailure(error); } } + + public static class DelegatedThermostatClusterAtomicResponseCallback implements ChipClusters.ThermostatCluster.AtomicResponseCallback, DelegatedClusterCallback { + private ClusterCommandCallback callback; + @Override + public void setCallbackDelegate(ClusterCommandCallback callback) { + this.callback = callback; + } + + @Override + public void onSuccess(Integer statusCode, ArrayList attributeStatus, Optional timeout) { + Map responseValues = new LinkedHashMap<>(); + + CommandResponseInfo statusCodeResponseValue = new CommandResponseInfo("statusCode", "Integer"); + responseValues.put(statusCodeResponseValue, statusCode); + // attributeStatus: AtomicAttributeStatusStruct + // Conversion from this type to Java is not properly implemented yet + + CommandResponseInfo timeoutResponseValue = new CommandResponseInfo("timeout", "Optional"); + responseValues.put(timeoutResponseValue, timeout); + callback.onSuccess(responseValues); + } + + @Override + public void onError(Exception error) { + callback.onFailure(error); + } + } public static class DelegatedThermostatClusterLocalTemperatureAttributeCallback implements ChipClusters.ThermostatCluster.LocalTemperatureAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -26698,46 +26725,35 @@ public Map> getCommandMap() { ); thermostatClusterInteractionInfoMap.put("setActivePresetRequest", thermostatsetActivePresetRequestInteractionInfo); - Map thermostatstartPresetsSchedulesEditRequestCommandParams = new LinkedHashMap(); + Map thermostatatomicRequestCommandParams = new LinkedHashMap(); - CommandParameterInfo thermostatstartPresetsSchedulesEditRequesttimeoutSecondsCommandParameterInfo = new CommandParameterInfo("timeoutSeconds", Integer.class, Integer.class); - thermostatstartPresetsSchedulesEditRequestCommandParams.put("timeoutSeconds",thermostatstartPresetsSchedulesEditRequesttimeoutSecondsCommandParameterInfo); - InteractionInfo thermostatstartPresetsSchedulesEditRequestInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .startPresetsSchedulesEditRequest((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("timeoutSeconds") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatstartPresetsSchedulesEditRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("startPresetsSchedulesEditRequest", thermostatstartPresetsSchedulesEditRequestInteractionInfo); + CommandParameterInfo thermostatatomicRequestrequestTypeCommandParameterInfo = new CommandParameterInfo("requestType", Integer.class, Integer.class); + thermostatatomicRequestCommandParams.put("requestType",thermostatatomicRequestrequestTypeCommandParameterInfo); - Map thermostatcancelPresetsSchedulesEditRequestCommandParams = new LinkedHashMap(); - InteractionInfo thermostatcancelPresetsSchedulesEditRequestInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster) - .cancelPresetsSchedulesEditRequest((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatcancelPresetsSchedulesEditRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("cancelPresetsSchedulesEditRequest", thermostatcancelPresetsSchedulesEditRequestInteractionInfo); + CommandParameterInfo thermostatatomicRequestattributeRequestsCommandParameterInfo = new CommandParameterInfo("attributeRequests", ArrayList.class, ArrayList.class); + thermostatatomicRequestCommandParams.put("attributeRequests",thermostatatomicRequestattributeRequestsCommandParameterInfo); - Map thermostatcommitPresetsSchedulesRequestCommandParams = new LinkedHashMap(); - InteractionInfo thermostatcommitPresetsSchedulesRequestInteractionInfo = new InteractionInfo( + CommandParameterInfo thermostatatomicRequesttimeoutCommandParameterInfo = new CommandParameterInfo("timeout", Optional.class, Integer.class); + thermostatatomicRequestCommandParams.put("timeout",thermostatatomicRequesttimeoutCommandParameterInfo); + InteractionInfo thermostatatomicRequestInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { ((ChipClusters.ThermostatCluster) cluster) - .commitPresetsSchedulesRequest((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - thermostatcommitPresetsSchedulesRequestCommandParams - ); - thermostatClusterInteractionInfoMap.put("commitPresetsSchedulesRequest", thermostatcommitPresetsSchedulesRequestInteractionInfo); + .atomicRequest((ChipClusters.ThermostatCluster.AtomicResponseCallback) callback + , (Integer) + commandArguments.get("requestType") + + , (ArrayList) + commandArguments.get("attributeRequests") + + , (Optional) + commandArguments.get("timeout") + + ); + }, + () -> new DelegatedThermostatClusterAtomicResponseCallback(), + thermostatatomicRequestCommandParams + ); + thermostatClusterInteractionInfoMap.put("atomicRequest", thermostatatomicRequestInteractionInfo); commandMap.put("thermostat", thermostatClusterInteractionInfoMap); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index d18655ec6203d8..c7b465d726cf83 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -12773,17 +12773,17 @@ private static Map readThermostatInteractionInfo() { readThermostatACCoilTemperatureCommandParams ); result.put("readACCoilTemperatureAttribute", readThermostatACCoilTemperatureAttributeInteractionInfo); - Map readThermostatACCapacityformatCommandParams = new LinkedHashMap(); - InteractionInfo readThermostatACCapacityformatAttributeInteractionInfo = new InteractionInfo( + Map readThermostatACCapacityFormatCommandParams = new LinkedHashMap(); + InteractionInfo readThermostatACCapacityFormatAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).readACCapacityformatAttribute( + ((ChipClusters.ThermostatCluster) cluster).readACCapacityFormatAttribute( (ChipClusters.IntegerAttributeCallback) callback ); }, () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readThermostatACCapacityformatCommandParams + readThermostatACCapacityFormatCommandParams ); - result.put("readACCapacityformatAttribute", readThermostatACCapacityformatAttributeInteractionInfo); + result.put("readACCapacityFormatAttribute", readThermostatACCapacityFormatAttributeInteractionInfo); Map readThermostatPresetTypesCommandParams = new LinkedHashMap(); InteractionInfo readThermostatPresetTypesAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { @@ -12894,17 +12894,6 @@ private static Map readThermostatInteractionInfo() { readThermostatSchedulesCommandParams ); result.put("readSchedulesAttribute", readThermostatSchedulesAttributeInteractionInfo); - Map readThermostatPresetsSchedulesEditableCommandParams = new LinkedHashMap(); - InteractionInfo readThermostatPresetsSchedulesEditableAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).readPresetsSchedulesEditableAttribute( - (ChipClusters.BooleanAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), - readThermostatPresetsSchedulesEditableCommandParams - ); - result.put("readPresetsSchedulesEditableAttribute", readThermostatPresetsSchedulesEditableAttributeInteractionInfo); Map readThermostatSetpointHoldExpiryTimestampCommandParams = new LinkedHashMap(); InteractionInfo readThermostatSetpointHoldExpiryTimestampAttributeInteractionInfo = 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 28cba2abd728f8..b7c8bc28ffbe1e 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -2721,28 +2721,28 @@ public Map> getWriteAttributeMap() { writeThermostatACLouverPositionCommandParams ); writeThermostatInteractionInfo.put("writeACLouverPositionAttribute", writeThermostatACLouverPositionAttributeInteractionInfo); - Map writeThermostatACCapacityformatCommandParams = new LinkedHashMap(); - CommandParameterInfo thermostatACCapacityformatCommandParameterInfo = + Map writeThermostatACCapacityFormatCommandParams = new LinkedHashMap(); + CommandParameterInfo thermostatACCapacityFormatCommandParameterInfo = new CommandParameterInfo( "value", Integer.class, Integer.class ); - writeThermostatACCapacityformatCommandParams.put( + writeThermostatACCapacityFormatCommandParams.put( "value", - thermostatACCapacityformatCommandParameterInfo + thermostatACCapacityFormatCommandParameterInfo ); - InteractionInfo writeThermostatACCapacityformatAttributeInteractionInfo = new InteractionInfo( + InteractionInfo writeThermostatACCapacityFormatAttributeInteractionInfo = new InteractionInfo( (cluster, callback, commandArguments) -> { - ((ChipClusters.ThermostatCluster) cluster).writeACCapacityformatAttribute( + ((ChipClusters.ThermostatCluster) cluster).writeACCapacityFormatAttribute( (DefaultClusterCallback) callback, (Integer) commandArguments.get("value") ); }, () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeThermostatACCapacityformatCommandParams + writeThermostatACCapacityFormatCommandParams ); - writeThermostatInteractionInfo.put("writeACCapacityformatAttribute", writeThermostatACCapacityformatAttributeInteractionInfo); + writeThermostatInteractionInfo.put("writeACCapacityFormatAttribute", writeThermostatACCapacityFormatAttributeInteractionInfo); writeAttributeMap.put("thermostat", writeThermostatInteractionInfo); Map writeFanControlInteractionInfo = new LinkedHashMap<>(); Map writeFanControlFanModeCommandParams = 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 f50c3e2c82b56e..76b0c82fa08a43 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/files.gni @@ -123,6 +123,7 @@ structs_sources = [ "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ServiceAreaClusterProgressStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterPresetTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt", diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt new file mode 100644 index 00000000000000..7500a9619d6973 --- /dev/null +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.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 ThermostatClusterAtomicAttributeStatusStruct(val attributeID: ULong, val statusCode: UInt) { + override fun toString(): String = buildString { + append("ThermostatClusterAtomicAttributeStatusStruct {\n") + append("\tattributeID : $attributeID\n") + append("\tstatusCode : $statusCode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), attributeID) + put(ContextSpecificTag(TAG_STATUS_CODE), statusCode) + endStructure() + } + } + + companion object { + private const val TAG_ATTRIBUTE_I_D = 0 + private const val TAG_STATUS_CODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterAtomicAttributeStatusStruct { + tlvReader.enterStructure(tlvTag) + val attributeID = tlvReader.getULong(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) + val statusCode = tlvReader.getUInt(ContextSpecificTag(TAG_STATUS_CODE)) + + tlvReader.exitContainer() + + return ThermostatClusterAtomicAttributeStatusStruct(attributeID, statusCode) + } + } +} diff --git a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt index 6a3b8727c32860..e05123dd91f361 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt +++ b/src/controller/java/generated/java/chip/devicecontroller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -30,7 +30,7 @@ class ThermostatClusterScheduleStruct( val name: Optional, val presetHandle: Optional, val transitions: List, - val builtIn: Optional?, + val builtIn: Boolean?, ) { override fun toString(): String = buildString { append("ThermostatClusterScheduleStruct {\n") @@ -66,10 +66,7 @@ class ThermostatClusterScheduleStruct( } endArray() if (builtIn != null) { - if (builtIn.isPresent) { - val optbuiltIn = builtIn.get() - put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) - } + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) } else { putNull(ContextSpecificTag(TAG_BUILT_IN)) } @@ -117,11 +114,7 @@ class ThermostatClusterScheduleStruct( } val builtIn = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) - } else { - Optional.empty() - } + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) } else { tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) null diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt index 66db507eb79cd5..bd7dddda1c7cc9 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/clusters/ThermostatCluster.kt @@ -22,7 +22,6 @@ 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.ByteSubscriptionState import matter.controller.InvokeRequest import matter.controller.InvokeResponse @@ -54,6 +53,12 @@ class ThermostatCluster(private val controller: MatterController, private val en val transitions: List, ) + class AtomicResponse( + val statusCode: UByte, + val attributeStatus: List, + val timeout: UShort?, + ) + class LocalTemperatureAttribute(val value: Short?) sealed class LocalTemperatureAttributeSubscriptionState { @@ -522,17 +527,29 @@ class ThermostatCluster(private val controller: MatterController, private val en logger.log(Level.FINE, "Invoke command succeeded: ${response}") } - suspend fun startPresetsSchedulesEditRequest( - timeoutSeconds: UShort, + suspend fun atomicRequest( + requestType: UByte, + attributeRequests: List, + timeout: UShort?, timedInvokeTimeout: Duration? = null, - ) { - val commandId: UInt = 7u + ): AtomicResponse { + val commandId: UInt = 254u val tlvWriter = TlvWriter() tlvWriter.startStructure(AnonymousTag) - val TAG_TIMEOUT_SECONDS_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_TIMEOUT_SECONDS_REQ), timeoutSeconds) + val TAG_REQUEST_TYPE_REQ: Int = 0 + tlvWriter.put(ContextSpecificTag(TAG_REQUEST_TYPE_REQ), requestType) + + val TAG_ATTRIBUTE_REQUESTS_REQ: Int = 1 + tlvWriter.startArray(ContextSpecificTag(TAG_ATTRIBUTE_REQUESTS_REQ)) + for (item in attributeRequests.iterator()) { + tlvWriter.put(AnonymousTag, item) + } + tlvWriter.endArray() + + val TAG_TIMEOUT_REQ: Int = 2 + timeout?.let { tlvWriter.put(ContextSpecificTag(TAG_TIMEOUT_REQ), timeout) } tlvWriter.endStructure() val request: InvokeRequest = @@ -544,42 +561,64 @@ class ThermostatCluster(private val controller: MatterController, private val en val response: InvokeResponse = controller.invoke(request) logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - suspend fun cancelPresetsSchedulesEditRequest(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 8u + val tlvReader = TlvReader(response.payload) + tlvReader.enterStructure(AnonymousTag) + val TAG_STATUS_CODE: Int = 0 + var statusCode_decoded: UByte? = null - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - tlvWriter.endStructure() + val TAG_ATTRIBUTE_STATUS: Int = 1 + var attributeStatus_decoded: List? = null - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) + val TAG_TIMEOUT: Int = 2 + var timeout_decoded: UShort? = null - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } + while (!tlvReader.isEndOfContainer()) { + val tag = tlvReader.peekElement().tag - suspend fun commitPresetsSchedulesRequest(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 9u + if (tag == ContextSpecificTag(TAG_STATUS_CODE)) { + statusCode_decoded = tlvReader.getUByte(tag) + } - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - tlvWriter.endStructure() + if (tag == ContextSpecificTag(TAG_ATTRIBUTE_STATUS)) { + attributeStatus_decoded = + buildList { + tlvReader.enterArray(tag) + while (!tlvReader.isEndOfContainer()) { + add(ThermostatClusterAtomicAttributeStatusStruct.fromTlv(AnonymousTag, tlvReader)) + } + tlvReader.exitContainer() + } + } - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) + if (tag == ContextSpecificTag(TAG_TIMEOUT)) { + timeout_decoded = + if (tlvReader.isNull()) { + tlvReader.getNull(tag) + null + } else { + if (tlvReader.isNextTag(tag)) { + tlvReader.getUShort(tag) + } else { + null + } + } + } else { + tlvReader.skipElement() + } + } - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") + if (statusCode_decoded == null) { + throw IllegalStateException("statusCode not found in TLV") + } + + if (attributeStatus_decoded == null) { + throw IllegalStateException("attributeStatus not found in TLV") + } + + tlvReader.exitContainer() + + return AtomicResponse(statusCode_decoded, attributeStatus_decoded, timeout_decoded) } suspend fun readLocalTemperatureAttribute(): LocalTemperatureAttribute { @@ -6205,7 +6244,7 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun readACCapacityformatAttribute(): UByte? { + suspend fun readACCapacityFormatAttribute(): UByte? { val ATTRIBUTE_ID: UInt = 71u val attributePath = @@ -6241,7 +6280,7 @@ class ThermostatCluster(private val controller: MatterController, private val en return decodedValue } - suspend fun writeACCapacityformatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { + suspend fun writeACCapacityFormatAttribute(value: UByte, timedWriteTimeout: Duration? = null) { val ATTRIBUTE_ID: UInt = 71u val tlvWriter = TlvWriter() @@ -6281,7 +6320,7 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun subscribeACCapacityformatAttribute( + suspend fun subscribeACCapacityFormatAttribute( minInterval: Int, maxInterval: Int, ): Flow { @@ -7437,101 +7476,8 @@ class ThermostatCluster(private val controller: MatterController, private val en } } - suspend fun readPresetsSchedulesEditableAttribute(): Boolean? { - val ATTRIBUTE_ID: UInt = 82u - - 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) { "Presetsscheduleseditable attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePresetsSchedulesEditableAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 82u - 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) { - "Presetsscheduleseditable attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getBoolean(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(BooleanSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(BooleanSubscriptionState.SubscriptionEstablished) - } - } - } - } - suspend fun readSetpointHoldExpiryTimestampAttribute(): SetpointHoldExpiryTimestampAttribute { - val ATTRIBUTE_ID: UInt = 83u + val ATTRIBUTE_ID: UInt = 82u val attributePath = AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) @@ -7575,7 +7521,7 @@ class ThermostatCluster(private val controller: MatterController, private val en minInterval: Int, maxInterval: Int, ): Flow { - val ATTRIBUTE_ID: UInt = 83u + val ATTRIBUTE_ID: UInt = 82u val attributePaths = listOf( AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) 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 856e286c2a2e7d..082aa01c392f8f 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -123,6 +123,7 @@ matter_structs_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ServiceAreaClusterProgressStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/SoftwareDiagnosticsClusterThreadMetricsStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/TargetNavigatorClusterTargetInfoStruct.kt", + "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterPresetTypeStruct.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt", diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.kt new file mode 100644 index 00000000000000..2a67c0cccb8688 --- /dev/null +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterAtomicAttributeStatusStruct.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 ThermostatClusterAtomicAttributeStatusStruct(val attributeID: UInt, val statusCode: UByte) { + override fun toString(): String = buildString { + append("ThermostatClusterAtomicAttributeStatusStruct {\n") + append("\tattributeID : $attributeID\n") + append("\tstatusCode : $statusCode\n") + append("}\n") + } + + fun toTlv(tlvTag: Tag, tlvWriter: TlvWriter) { + tlvWriter.apply { + startStructure(tlvTag) + put(ContextSpecificTag(TAG_ATTRIBUTE_I_D), attributeID) + put(ContextSpecificTag(TAG_STATUS_CODE), statusCode) + endStructure() + } + } + + companion object { + private const val TAG_ATTRIBUTE_I_D = 0 + private const val TAG_STATUS_CODE = 1 + + fun fromTlv(tlvTag: Tag, tlvReader: TlvReader): ThermostatClusterAtomicAttributeStatusStruct { + tlvReader.enterStructure(tlvTag) + val attributeID = tlvReader.getUInt(ContextSpecificTag(TAG_ATTRIBUTE_I_D)) + val statusCode = tlvReader.getUByte(ContextSpecificTag(TAG_STATUS_CODE)) + + tlvReader.exitContainer() + + return ThermostatClusterAtomicAttributeStatusStruct(attributeID, statusCode) + } + } +} diff --git a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt index 720dfaf37afadd..90ca5ab50b6514 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt +++ b/src/controller/java/generated/java/matter/controller/cluster/structs/ThermostatClusterScheduleStruct.kt @@ -30,7 +30,7 @@ class ThermostatClusterScheduleStruct( val name: Optional, val presetHandle: Optional, val transitions: List, - val builtIn: Optional?, + val builtIn: Boolean?, ) { override fun toString(): String = buildString { append("ThermostatClusterScheduleStruct {\n") @@ -66,10 +66,7 @@ class ThermostatClusterScheduleStruct( } endArray() if (builtIn != null) { - if (builtIn.isPresent) { - val optbuiltIn = builtIn.get() - put(ContextSpecificTag(TAG_BUILT_IN), optbuiltIn) - } + put(ContextSpecificTag(TAG_BUILT_IN), builtIn) } else { putNull(ContextSpecificTag(TAG_BUILT_IN)) } @@ -117,11 +114,7 @@ class ThermostatClusterScheduleStruct( } val builtIn = if (!tlvReader.isNull()) { - if (tlvReader.isNextTag(ContextSpecificTag(TAG_BUILT_IN))) { - Optional.of(tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN))) - } else { - Optional.empty() - } + tlvReader.getBoolean(ContextSpecificTag(TAG_BUILT_IN)) } else { tlvReader.getNull(ContextSpecificTag(TAG_BUILT_IN)) null diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 0709c402c08071..3f294e84344688 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -29588,7 +29588,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -29700,7 +29700,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jobject value; std::string valueClassName = "java/lang/Integer"; std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); + jint jnivalue = static_cast(cppValue.Raw()); chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, value); return value; @@ -30376,8 +30376,8 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; + case Attributes::ACCapacityFormat::Id: { + using TypeInfo = Attributes::ACCapacityFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = app::DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) @@ -30958,28 +30958,18 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR chip::JniReferences::GetInstance().AddToList(newElement_0_transitions, newElement_2); } jobject newElement_0_builtIn; - if (!entry_0.builtIn.HasValue()) + if (entry_0.builtIn.IsNull()) { - chip::JniReferences::GetInstance().CreateOptional(nullptr, newElement_0_builtIn); + newElement_0_builtIn = nullptr; } else { - jobject newElement_0_builtInInsideOptional; - if (entry_0.builtIn.Value().IsNull()) - { - newElement_0_builtInInsideOptional = nullptr; - } - else - { - std::string newElement_0_builtInInsideOptionalClassName = "java/lang/Boolean"; - std::string newElement_0_builtInInsideOptionalCtorSignature = "(Z)V"; - jboolean jninewElement_0_builtInInsideOptional = static_cast(entry_0.builtIn.Value().Value()); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0_builtInInsideOptionalClassName.c_str(), - newElement_0_builtInInsideOptionalCtorSignature.c_str(), jninewElement_0_builtInInsideOptional, - newElement_0_builtInInsideOptional); - } - chip::JniReferences::GetInstance().CreateOptional(newElement_0_builtInInsideOptional, newElement_0_builtIn); + std::string newElement_0_builtInClassName = "java/lang/Boolean"; + std::string newElement_0_builtInCtorSignature = "(Z)V"; + jboolean jninewElement_0_builtIn = static_cast(entry_0.builtIn.Value()); + chip::JniReferences::GetInstance().CreateBoxedObject(newElement_0_builtInClassName.c_str(), + newElement_0_builtInCtorSignature.c_str(), + jninewElement_0_builtIn, newElement_0_builtIn); } jclass scheduleStructStructClass_1; @@ -30994,7 +30984,7 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR jmethodID scheduleStructStructCtor_1; err = chip::JniReferences::GetInstance().FindMethod( env, scheduleStructStructClass_1, "", - "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/util/Optional;)V", + "([BLjava/lang/Integer;Ljava/util/Optional;Ljava/util/Optional;Ljava/util/ArrayList;Ljava/lang/Boolean;)V", &scheduleStructStructCtor_1); if (err != CHIP_NO_ERROR || scheduleStructStructCtor_1 == nullptr) { @@ -31009,22 +30999,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } return value; } - case Attributes::PresetsSchedulesEditable::Id: { - using TypeInfo = Attributes::PresetsSchedulesEditable::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::SetpointHoldExpiryTimestamp::Id: { using TypeInfo = Attributes::SetpointHoldExpiryTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index fcf0683be36ac0..688a8fb1d7cf38 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -8821,23 +8821,13 @@ class ChipClusters: "presetHandle": "bytes", }, }, - 0x00000007: { - "commandId": 0x00000007, - "commandName": "StartPresetsSchedulesEditRequest", - "args": { - "timeoutSeconds": "int", - }, - }, - 0x00000008: { - "commandId": 0x00000008, - "commandName": "CancelPresetsSchedulesEditRequest", - "args": { - }, - }, - 0x00000009: { - "commandId": 0x00000009, - "commandName": "CommitPresetsSchedulesRequest", + 0x000000FE: { + "commandId": 0x000000FE, + "commandName": "AtomicRequest", "args": { + "requestType": "int", + "attributeRequests": "int", + "timeout": "int", }, }, }, @@ -9157,7 +9147,7 @@ class ChipClusters: "reportable": True, }, 0x00000047: { - "attributeName": "ACCapacityformat", + "attributeName": "ACCapacityFormat", "attributeId": 0x00000047, "type": "int", "reportable": True, @@ -9226,14 +9216,8 @@ class ChipClusters: "writable": True, }, 0x00000052: { - "attributeName": "PresetsSchedulesEditable", - "attributeId": 0x00000052, - "type": "bool", - "reportable": True, - }, - 0x00000053: { "attributeName": "SetpointHoldExpiryTimestamp", - "attributeId": 0x00000053, + "attributeId": 0x00000052, "type": "int", "reportable": True, }, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 480ab3e7d0226c..4375645030f044 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -32033,7 +32033,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="ACErrorCode", Tag=0x00000044, Type=typing.Optional[uint]), ClusterObjectFieldDescriptor(Label="ACLouverPosition", Tag=0x00000045, Type=typing.Optional[Thermostat.Enums.ACLouverPositionEnum]), ClusterObjectFieldDescriptor(Label="ACCoilTemperature", Tag=0x00000046, Type=typing.Union[None, Nullable, int]), - ClusterObjectFieldDescriptor(Label="ACCapacityformat", Tag=0x00000047, Type=typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]), + ClusterObjectFieldDescriptor(Label="ACCapacityFormat", Tag=0x00000047, Type=typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]), ClusterObjectFieldDescriptor(Label="presetTypes", Tag=0x00000048, Type=typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]), ClusterObjectFieldDescriptor(Label="scheduleTypes", Tag=0x00000049, Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]), ClusterObjectFieldDescriptor(Label="numberOfPresets", Tag=0x0000004A, Type=typing.Optional[uint]), @@ -32044,8 +32044,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="activeScheduleHandle", Tag=0x0000004F, Type=typing.Union[None, Nullable, bytes]), ClusterObjectFieldDescriptor(Label="presets", Tag=0x00000050, Type=typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]), ClusterObjectFieldDescriptor(Label="schedules", Tag=0x00000051, Type=typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]), - ClusterObjectFieldDescriptor(Label="presetsSchedulesEditable", Tag=0x00000052, Type=typing.Optional[bool]), - ClusterObjectFieldDescriptor(Label="setpointHoldExpiryTimestamp", Tag=0x00000053, Type=typing.Union[None, Nullable, uint]), + ClusterObjectFieldDescriptor(Label="setpointHoldExpiryTimestamp", Tag=0x00000052, Type=typing.Union[None, Nullable, uint]), 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]), @@ -32102,7 +32101,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ACErrorCode: 'typing.Optional[uint]' = None ACLouverPosition: 'typing.Optional[Thermostat.Enums.ACLouverPositionEnum]' = None ACCoilTemperature: 'typing.Union[None, Nullable, int]' = None - ACCapacityformat: 'typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]' = None + ACCapacityFormat: 'typing.Optional[Thermostat.Enums.ACCapacityFormatEnum]' = None presetTypes: 'typing.Optional[typing.List[Thermostat.Structs.PresetTypeStruct]]' = None scheduleTypes: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleTypeStruct]]' = None numberOfPresets: 'typing.Optional[uint]' = None @@ -32113,7 +32112,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: activeScheduleHandle: 'typing.Union[None, Nullable, bytes]' = None presets: 'typing.Optional[typing.List[Thermostat.Structs.PresetStruct]]' = None schedules: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]' = None - presetsSchedulesEditable: 'typing.Optional[bool]' = None setpointHoldExpiryTimestamp: 'typing.Union[None, Nullable, uint]' = None generatedCommandList: 'typing.List[uint]' = None acceptedCommandList: 'typing.List[uint]' = None @@ -32177,6 +32175,16 @@ class ACTypeEnum(MatterIntEnum): # enum value. This specific should never be transmitted. kUnknownEnumValue = 5, + class AtomicRequestTypeEnum(MatterIntEnum): + kBeginWrite = 0x00 + kCommitWrite = 0x01 + kRollbackWrite = 0x02 + # All received enum values that are not listed above will be mapped + # to kUnknownEnumValue. This is a helper enum value that should only + # be used by code to process how it handles receiving and unknown + # enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, + class ControlSequenceOfOperationEnum(MatterIntEnum): kCoolingOnly = 0x00 kCoolingWithReheat = 0x01 @@ -32191,7 +32199,6 @@ class ControlSequenceOfOperationEnum(MatterIntEnum): kUnknownEnumValue = 6, class PresetScenarioEnum(MatterIntEnum): - kUnspecified = 0x00 kOccupied = 0x01 kUnoccupied = 0x02 kSleep = 0x03 @@ -32203,7 +32210,7 @@ class PresetScenarioEnum(MatterIntEnum): # to kUnknownEnumValue. This is a helper enum value that should only # be used by code to process how it handles receiving and unknown # enum value. This specific should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 0, class SetpointChangeSourceEnum(MatterIntEnum): kManual = 0x00 @@ -32292,7 +32299,6 @@ class Feature(IntFlag): kLocalTemperatureNotExposed = 0x40 kMatterScheduleConfiguration = 0x80 kPresets = 0x100 - kSetpoints = 0x200 class HVACSystemTypeBitmap(IntFlag): kCoolingStage = 0x3 @@ -32300,6 +32306,9 @@ class HVACSystemTypeBitmap(IntFlag): kHeatingIsHeatPump = 0x10 kHeatingUsesFuel = 0x20 + class OccupancyBitmap(IntFlag): + kOccupied = 0x1 + class PresetTypeFeaturesBitmap(IntFlag): kAutomatic = 0x1 kSupportsNames = 0x2 @@ -32376,7 +32385,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor(Label="name", Tag=2, Type=typing.Optional[str]), ClusterObjectFieldDescriptor(Label="presetHandle", Tag=3, Type=typing.Optional[bytes]), ClusterObjectFieldDescriptor(Label="transitions", Tag=4, Type=typing.List[Thermostat.Structs.ScheduleTransitionStruct]), - ClusterObjectFieldDescriptor(Label="builtIn", Tag=5, Type=typing.Union[None, Nullable, bool]), + ClusterObjectFieldDescriptor(Label="builtIn", Tag=5, Type=typing.Union[Nullable, bool]), ]) scheduleHandle: 'typing.Union[Nullable, bytes]' = NullValue @@ -32384,7 +32393,20 @@ def descriptor(cls) -> ClusterObjectDescriptor: name: 'typing.Optional[str]' = None presetHandle: 'typing.Optional[bytes]' = None transitions: 'typing.List[Thermostat.Structs.ScheduleTransitionStruct]' = field(default_factory=lambda: []) - builtIn: 'typing.Union[None, Nullable, bool]' = None + builtIn: 'typing.Union[Nullable, bool]' = NullValue + + @dataclass + class AtomicAttributeStatusStruct(ClusterObject): + @ChipUtility.classproperty + def descriptor(cls) -> ClusterObjectDescriptor: + return ClusterObjectDescriptor( + Fields=[ + ClusterObjectFieldDescriptor(Label="attributeID", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="statusCode", Tag=1, Type=uint), + ]) + + attributeID: 'uint' = 0 + statusCode: 'uint' = 0 @dataclass class PresetStruct(ClusterObject): @@ -32579,46 +32601,44 @@ def descriptor(cls) -> ClusterObjectDescriptor: presetHandle: 'bytes' = b"" @dataclass - class StartPresetsSchedulesEditRequest(ClusterCommand): + class AtomicResponse(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000007 - is_client: typing.ClassVar[bool] = True + command_id: typing.ClassVar[int] = 0x000000FD + is_client: typing.ClassVar[bool] = False response_type: typing.ClassVar[str] = None @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ - ClusterObjectFieldDescriptor(Label="timeoutSeconds", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="statusCode", Tag=0, Type=uint), + ClusterObjectFieldDescriptor(Label="attributeStatus", Tag=1, Type=typing.List[Thermostat.Structs.AtomicAttributeStatusStruct]), + ClusterObjectFieldDescriptor(Label="timeout", Tag=2, Type=typing.Optional[uint]), ]) - timeoutSeconds: 'uint' = 0 + statusCode: 'uint' = 0 + attributeStatus: 'typing.List[Thermostat.Structs.AtomicAttributeStatusStruct]' = field(default_factory=lambda: []) + timeout: 'typing.Optional[uint]' = None @dataclass - class CancelPresetsSchedulesEditRequest(ClusterCommand): + class AtomicRequest(ClusterCommand): cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000008 + command_id: typing.ClassVar[int] = 0x000000FE is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None + response_type: typing.ClassVar[str] = 'AtomicResponse' @ChipUtility.classproperty def descriptor(cls) -> ClusterObjectDescriptor: return ClusterObjectDescriptor( Fields=[ + ClusterObjectFieldDescriptor(Label="requestType", Tag=0, Type=Thermostat.Enums.AtomicRequestTypeEnum), + ClusterObjectFieldDescriptor(Label="attributeRequests", Tag=1, Type=typing.List[uint]), + ClusterObjectFieldDescriptor(Label="timeout", Tag=2, Type=typing.Optional[uint]), ]) - @dataclass - class CommitPresetsSchedulesRequest(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000201 - command_id: typing.ClassVar[int] = 0x00000009 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) + requestType: 'Thermostat.Enums.AtomicRequestTypeEnum' = 0 + attributeRequests: 'typing.List[uint]' = field(default_factory=lambda: []) + timeout: 'typing.Optional[uint]' = None class Attributes: @dataclass @@ -33390,7 +33410,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Union[None, Nullable, int]' = None @dataclass - class ACCapacityformat(ClusterAttributeDescriptor): + class ACCapacityFormat(ClusterAttributeDescriptor): @ChipUtility.classproperty def cluster_id(cls) -> int: return 0x00000201 @@ -33565,22 +33585,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'typing.Optional[typing.List[Thermostat.Structs.ScheduleStruct]]' = None - @dataclass - class PresetsSchedulesEditable(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000201 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000052 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[bool]) - - value: 'typing.Optional[bool]' = None - @dataclass class SetpointHoldExpiryTimestamp(ClusterAttributeDescriptor): @ChipUtility.classproperty @@ -33589,7 +33593,7 @@ def cluster_id(cls) -> int: @ChipUtility.classproperty def attribute_id(cls) -> int: - return 0x00000053 + return 0x00000052 @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm index 1f8b78979c8798..c5c8fec5c1f1b3 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeSpecifiedCheck.mm @@ -4125,7 +4125,7 @@ static BOOL AttributeIsSpecifiedInThermostatCluster(AttributeId aAttributeId) case Attributes::ACCoilTemperature::Id: { return YES; } - case Attributes::ACCapacityformat::Id: { + case Attributes::ACCapacityFormat::Id: { return YES; } case Attributes::PresetTypes::Id: { @@ -4158,9 +4158,6 @@ static BOOL AttributeIsSpecifiedInThermostatCluster(AttributeId aAttributeId) case Attributes::Schedules::Id: { return YES; } - case Attributes::PresetsSchedulesEditable::Id: { - return YES; - } case Attributes::SetpointHoldExpiryTimestamp::Id: { return YES; } diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm index 70d282af25401f..bfb6730d56dd48 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRAttributeTLVValueDecoder.mm @@ -11623,7 +11623,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::AbsMinHeatSetpointLimit::Id: { @@ -11700,7 +11700,7 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib return nil; } NSNumber * _Nonnull value; - value = [NSNumber numberWithUnsignedChar:cppValue]; + value = [NSNumber numberWithUnsignedChar:cppValue.Raw()]; return value; } case Attributes::LocalTemperatureCalibration::Id: { @@ -12157,8 +12157,8 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } return value; } - case Attributes::ACCapacityformat::Id: { - using TypeInfo = Attributes::ACCapacityformat::TypeInfo; + case Attributes::ACCapacityFormat::Id: { + using TypeInfo = Attributes::ACCapacityFormat::TypeInfo; TypeInfo::DecodableType cppValue; *aError = DataModel::Decode(aReader, cppValue); if (*aError != CHIP_NO_ERROR) { @@ -12439,14 +12439,10 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } newElement_0.transitions = array_2; } - if (entry_0.builtIn.HasValue()) { - if (entry_0.builtIn.Value().IsNull()) { - newElement_0.builtIn = nil; - } else { - newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value().Value()]; - } - } else { + if (entry_0.builtIn.IsNull()) { newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; } [array_0 addObject:newElement_0]; } @@ -12459,17 +12455,6 @@ static id _Nullable DecodeAttributeValueForThermostatCluster(AttributeId aAttrib } return value; } - case Attributes::PresetsSchedulesEditable::Id: { - using TypeInfo = Attributes::PresetsSchedulesEditable::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; - } case Attributes::SetpointHoldExpiryTimestamp::Id: { using TypeInfo = Attributes::SetpointHoldExpiryTimestamp::TypeInfo; TypeInfo::DecodableType cppValue; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h index bcdee4fc6798b6..f6aa72f72db1c5 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.h @@ -9955,25 +9955,25 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command SetpointRaiseLower * - * Command description for SetpointRaiseLower + * Upon receipt, the attributes for the indicated setpoint(s) SHALL have the amount specified in the Amount field added to them. */ - (void)setpointRaiseLowerWithParams:(MTRThermostatClusterSetpointRaiseLowerParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command SetWeeklySchedule * - * Command description for SetWeeklySchedule + * Upon receipt, the weekly schedule for updating setpoints SHALL be stored in the */ - (void)setWeeklyScheduleWithParams:(MTRThermostatClusterSetWeeklyScheduleParams *)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command GetWeeklySchedule * - * Command description for GetWeeklySchedule + * Upon receipt, the unit SHOULD send in return the Get */ - (void)getWeeklyScheduleWithParams:(MTRThermostatClusterGetWeeklyScheduleParams *)params completion:(void (^)(MTRThermostatClusterGetWeeklyScheduleResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); /** * Command ClearWeeklySchedule * - * This command is used to clear the weekly schedule. The ClearWeeklySchedule command has no payload. + * This command is used to clear the weekly schedule. */ - (void)clearWeeklyScheduleWithParams:(MTRThermostatClusterClearWeeklyScheduleParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)clearWeeklyScheduleWithCompletion:(MTRStatusCompletion)completion @@ -9981,37 +9981,21 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) /** * Command SetActiveScheduleRequest * - * This command is used to set the active schedule. + * Upon receipt, if the */ - (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** * Command SetActivePresetRequest * - * This command is used to set the active preset. + * ID */ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; /** - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest * - * This command is used to start editing the presets and schedules. + * Begins, Commits or Cancels an atomic write */ -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -/** - * Command CancelPresetsSchedulesEditRequest - * - * This command is used to cancel editing presets and schedules. - */ -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithCompletion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -/** - * Command CommitPresetsSchedulesRequest - * - * This command is used to notify the server that all edits are done and should be committed. - */ -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithCompletion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributeLocalTemperatureWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)subscribeAttributeLocalTemperatureWithParams:(MTRSubscribeParams *)params @@ -10353,13 +10337,13 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + (void)readAttributeACCoilTemperatureWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -- (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams *)params +- (void)readAttributeACCapacityFormatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; +- (void)subscribeAttributeACCapacityFormatWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); -+ (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); + reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; ++ (void)readAttributeACCapacityFormatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)readAttributePresetTypesWithCompletion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributePresetTypesWithParams:(MTRSubscribeParams *)params @@ -10425,12 +10409,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) reportHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; + (void)readAttributeSchedulesWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)readAttributePresetsSchedulesEditableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; -- (void)subscribeAttributePresetsSchedulesEditableWithParams:(MTRSubscribeParams *)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_PROVISIONALLY_AVAILABLE; -+ (void)readAttributePresetsSchedulesEditableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - - (void)readAttributeSetpointHoldExpiryTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (void)subscribeAttributeSetpointHoldExpiryTimestampWithParams:(MTRSubscribeParams *)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished @@ -19717,6 +19695,12 @@ typedef NS_ENUM(uint8_t, MTRThermostatACType) { MTRThermostatACTypeHeatPumpInverter MTR_PROVISIONALLY_AVAILABLE = 0x04, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_ENUM(uint8_t, MTRThermostatAtomicRequestType) { + MTRThermostatAtomicRequestTypeBeginWrite MTR_PROVISIONALLY_AVAILABLE = 0x00, + MTRThermostatAtomicRequestTypeCommitWrite MTR_PROVISIONALLY_AVAILABLE = 0x01, + MTRThermostatAtomicRequestTypeRollbackWrite MTR_PROVISIONALLY_AVAILABLE = 0x02, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_ENUM(uint8_t, MTRThermostatControlSequenceOfOperation) { MTRThermostatControlSequenceOfOperationCoolingOnly MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) = 0x00, MTRThermostatControlSequenceOfOperationCoolingWithReheat MTR_AVAILABLE(ios(17.4), macos(14.4), watchos(10.4), tvos(17.4)) = 0x01, @@ -19736,7 +19720,6 @@ typedef NS_ENUM(uint8_t, MTRThermostatControlSequence) { } MTR_DEPRECATED("Please use MTRThermostatControlSequenceOfOperation", ios(16.1, 17.4), macos(13.0, 14.4), watchos(9.1, 10.4), tvos(16.1, 17.4)); typedef NS_ENUM(uint8_t, MTRThermostatPresetScenario) { - MTRThermostatPresetScenarioUnspecified MTR_PROVISIONALLY_AVAILABLE = 0x00, MTRThermostatPresetScenarioOccupied MTR_PROVISIONALLY_AVAILABLE = 0x01, MTRThermostatPresetScenarioUnoccupied MTR_PROVISIONALLY_AVAILABLE = 0x02, MTRThermostatPresetScenarioSleep MTR_PROVISIONALLY_AVAILABLE = 0x03, @@ -19821,7 +19804,6 @@ typedef NS_OPTIONS(uint32_t, MTRThermostatFeature) { MTRThermostatFeatureLocalTemperatureNotExposed MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)) = 0x40, MTRThermostatFeatureMatterScheduleConfiguration MTR_PROVISIONALLY_AVAILABLE = 0x80, MTRThermostatFeaturePresets MTR_PROVISIONALLY_AVAILABLE = 0x100, - MTRThermostatFeatureSetpoints MTR_PROVISIONALLY_AVAILABLE = 0x200, } MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { @@ -19831,6 +19813,10 @@ typedef NS_OPTIONS(uint8_t, MTRThermostatHVACSystemTypeBitmap) { MTRThermostatHVACSystemTypeBitmapHeatingUsesFuel MTR_PROVISIONALLY_AVAILABLE = 0x20, } MTR_PROVISIONALLY_AVAILABLE; +typedef NS_OPTIONS(uint8_t, MTRThermostatOccupancyBitmap) { + MTRThermostatOccupancyBitmapOccupied MTR_PROVISIONALLY_AVAILABLE = 0x1, +} MTR_PROVISIONALLY_AVAILABLE; + typedef NS_OPTIONS(uint16_t, MTRThermostatPresetTypeFeaturesBitmap) { MTRThermostatPresetTypeFeaturesBitmapAutomatic MTR_PROVISIONALLY_AVAILABLE = 0x1, MTRThermostatPresetTypeFeaturesBitmapSupportsNames MTR_PROVISIONALLY_AVAILABLE = 0x2, @@ -25882,15 +25868,6 @@ typedef NS_OPTIONS(uint8_t, MTRTestClusterSimpleBitmap) { reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_DEPRECATED("Please use subscribeAttributeACCoilTemperatureWithParams:subscriptionEstablished:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); + (void)readAttributeACCoilTemperatureWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCoilTemperatureWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)readAttributeACCapacityformatWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCapacityformatWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeACCapacityformatWithValue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler MTR_DEPRECATED("Please use writeAttributeACCapacityformatWithValue:params:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (void)subscribeAttributeACCapacityformatWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler MTR_DEPRECATED("Please use subscribeAttributeACCapacityformatWithParams:subscriptionEstablished:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -+ (void)readAttributeACCapacityformatWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeACCapacityformatWithAttributeCache:endpoint:queue:completion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler MTR_DEPRECATED("Please use readAttributeGeneratedCommandListWithCompletion:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - (void)subscribeAttributeGeneratedCommandListWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval params:(MTRSubscribeParams * _Nullable)params diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm index 10a6bf8fe0eab8..a7d2433c901d78 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRBaseClusters.mm @@ -67868,83 +67868,27 @@ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetReq queue:self.callbackQueue completion:responseHandler]; } -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params completion:(MTRStatusCompletion)completion +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::StartPresetsSchedulesEditRequest::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)cancelPresetsSchedulesEditRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self cancelPresetsSchedulesEditRequestWithParams:nil completion:completion]; -} -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CancelPresetsSchedulesEditRequest::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)commitPresetsSchedulesRequestWithCompletion:(MTRStatusCompletion)completion -{ - [self commitPresetsSchedulesRequestWithParams:nil completion:completion]; -} -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = Thermostat::Commands::CommitPresetsSchedulesRequest::Type; + using RequestType = Thermostat::Commands::AtomicRequest::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) commandPayload:params timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRThermostatClusterAtomicResponseParams.class queue:self.callbackQueue completion:responseHandler]; } @@ -68305,7 +68249,7 @@ - (void)writeAttributeHVACSystemTypeConfigurationWithValue:(NSNumber * _Nonnull) ListFreer listFreer; using TypeInfo = Thermostat::Attributes::HVACSystemTypeConfiguration::TypeInfo; TypeInfo::Type cppValue; - cppValue = value.unsignedCharValue; + cppValue = static_cast>(value.unsignedCharValue); chip::Controller::ClusterBase cppCluster(exchangeManager, session, self.endpointID.unsignedShortValue); return cppCluster.WriteAttribute(cppValue, bridge, successCb, failureCb, timedWriteTimeout); }); @@ -70420,9 +70364,9 @@ + (void)readAttributeACCoilTemperatureWithClusterStateCache:(MTRClusterStateCach completion:completion]; } -- (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion +- (void)readAttributeACCapacityFormatWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [self.device _readKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -70431,11 +70375,11 @@ - (void)readAttributeACCapacityformatWithCompletion:(void (^)(NSNumber * _Nullab completion:completion]; } -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value completion:(MTRStatusCompletion)completion { - [self writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; + [self writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull) value params:nil completion:completion]; } -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion +- (void)writeAttributeACCapacityFormatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completion:(MTRStatusCompletion)completion { // Make a copy of params before we go async. params = [params copy]; @@ -70450,7 +70394,7 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param } ListFreer listFreer; - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; TypeInfo::Type cppValue; cppValue = static_cast>(value.unsignedCharValue); @@ -70459,11 +70403,11 @@ - (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value param std::move(*bridge).DispatchAction(self.device); } -- (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams * _Nonnull)params +- (void)subscribeAttributeACCapacityFormatWithParams:(MTRSubscribeParams * _Nonnull)params subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID clusterID:@(TypeInfo::GetClusterId()) attributeID:@(TypeInfo::GetAttributeId()) @@ -70473,9 +70417,9 @@ - (void)subscribeAttributeACCapacityformatWithParams:(MTRSubscribeParams * _Nonn subscriptionEstablished:subscriptionEstablished]; } -+ (void)readAttributeACCapacityformatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion ++ (void)readAttributeACCapacityFormatWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { - using TypeInfo = Thermostat::Attributes::ACCapacityformat::TypeInfo; + using TypeInfo = Thermostat::Attributes::ACCapacityFormat::TypeInfo; [clusterStateCacheContainer _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) clusterID:TypeInfo::GetClusterId() @@ -70987,15 +70931,12 @@ - (void)writeAttributeSchedulesWithValue:(NSArray * _Nonnull)value params:(MTRWr listHolder_0->mList[i_0].transitions = ListType_2(); } } - if (element_0.builtIn != nil) { - auto & definedValue_2 = listHolder_0->mList[i_0].builtIn.Emplace(); - if (element_0.builtIn == nil) { - definedValue_2.SetNull(); - } else { - auto & nonNullValue_3 = definedValue_2.SetNonNull(); - nonNullValue_3 = element_0.builtIn.boolValue; + if (element_0.builtIn == nil) { + listHolder_0->mList[i_0].builtIn.SetNull(); + } else { + auto & nonNullValue_2 = listHolder_0->mList[i_0].builtIn.SetNonNull(); + nonNullValue_2 = element_0.builtIn.boolValue; } - } } cppValue = ListType_0(listHolder_0->mList, value.count); } else { @@ -71033,42 +70974,6 @@ + (void)readAttributeSchedulesWithClusterStateCache:(MTRClusterStateCacheContain completion:completion]; } -- (void)readAttributePresetsSchedulesEditableWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [self.device _readKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:nil - queue:self.callbackQueue - completion:completion]; -} - -- (void)subscribeAttributePresetsSchedulesEditableWithParams:(MTRSubscribeParams * _Nonnull)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablished - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [self.device _subscribeToKnownAttributeWithEndpointID:self.endpointID - clusterID:@(TypeInfo::GetClusterId()) - attributeID:@(TypeInfo::GetAttributeId()) - params:params - queue:self.callbackQueue - reportHandler:reportHandler - subscriptionEstablished:subscriptionEstablished]; -} - -+ (void)readAttributePresetsSchedulesEditableWithClusterStateCache:(MTRClusterStateCacheContainer *)clusterStateCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion -{ - using TypeInfo = Thermostat::Attributes::PresetsSchedulesEditable::TypeInfo; - [clusterStateCacheContainer - _readKnownCachedAttributeWithEndpointID:static_cast([endpoint unsignedShortValue]) - clusterID:TypeInfo::GetClusterId() - attributeID:TypeInfo::GetAttributeId() - queue:queue - completion:completion]; -} - - (void)readAttributeSetpointHoldExpiryTimestampWithCompletion:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completion { using TypeInfo = Thermostat::Attributes::SetpointHoldExpiryTimestamp::TypeInfo; @@ -73241,49 +73146,6 @@ + (void)readAttributeACCoilTemperatureWithAttributeCache:(MTRAttributeCacheConta }]; } -- (void)readAttributeACCapacityformatWithCompletionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - [self readAttributeACCapacityformatWithCompletion: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast(value), error); - }]; -} -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeACCapacityformatWithValue:value params:nil completion:completionHandler]; -} -- (void)writeAttributeACCapacityformatWithValue:(NSNumber * _Nonnull)value params:(MTRWriteParams * _Nullable)params completionHandler:(MTRStatusCompletion)completionHandler -{ - [self writeAttributeACCapacityformatWithValue:value params:params completion:completionHandler]; -} -- (void)subscribeAttributeACCapacityformatWithMinInterval:(NSNumber * _Nonnull)minInterval maxInterval:(NSNumber * _Nonnull)maxInterval - params:(MTRSubscribeParams * _Nullable)params - subscriptionEstablished:(MTRSubscriptionEstablishedHandler _Nullable)subscriptionEstablishedHandler - reportHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))reportHandler -{ - MTRSubscribeParams * _Nullable subscribeParams = [params copy]; - if (subscribeParams == nil) { - subscribeParams = [[MTRSubscribeParams alloc] initWithMinInterval:minInterval maxInterval:maxInterval]; - } else { - subscribeParams.minInterval = minInterval; - subscribeParams.maxInterval = maxInterval; - } - [self subscribeAttributeACCapacityformatWithParams:subscribeParams subscriptionEstablished:subscriptionEstablishedHandler reportHandler: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - reportHandler(static_cast(value), error); - }]; -} -+ (void)readAttributeACCapacityformatWithAttributeCache:(MTRAttributeCacheContainer *)attributeCacheContainer endpoint:(NSNumber *)endpoint queue:(dispatch_queue_t)queue completionHandler:(void (^)(NSNumber * _Nullable value, NSError * _Nullable error))completionHandler -{ - [self readAttributeACCapacityformatWithClusterStateCache:attributeCacheContainer.realContainer endpoint:endpoint queue:queue completion: - ^(NSNumber * _Nullable value, NSError * _Nullable error) { - // Cast is safe because subclass does not add any selectors. - completionHandler(static_cast(value), error); - }]; -} - - (void)readAttributeGeneratedCommandListWithCompletionHandler:(void (^)(NSArray * _Nullable value, NSError * _Nullable error))completionHandler { [self readAttributeGeneratedCommandListWithCompletion: diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h index 7cc4515e6553f2..ed78b777c82b8e 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterConstants.h @@ -3406,9 +3406,6 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRClusterThermostatAttributeACCoilTemperatureID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = 0x00000046, - MTRClusterThermostatAttributeACCapacityformatID - MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) - = 0x00000047, MTRClusterThermostatAttributeGeneratedCommandListID MTR_DEPRECATED("Please use MTRAttributeIDTypeClusterThermostatAttributeGeneratedCommandListID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) = MTRClusterGlobalAttributeGeneratedCommandListID, @@ -3474,7 +3471,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterThermostatAttributeACErrorCodeID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000044, MTRAttributeIDTypeClusterThermostatAttributeACLouverPositionID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000045, MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000046, - MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000047, + MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID MTR_PROVISIONALLY_AVAILABLE = 0x00000047, MTRAttributeIDTypeClusterThermostatAttributePresetTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000048, MTRAttributeIDTypeClusterThermostatAttributeScheduleTypesID MTR_PROVISIONALLY_AVAILABLE = 0x00000049, MTRAttributeIDTypeClusterThermostatAttributeNumberOfPresetsID MTR_PROVISIONALLY_AVAILABLE = 0x0000004A, @@ -3485,8 +3482,7 @@ typedef NS_ENUM(uint32_t, MTRAttributeIDType) { MTRAttributeIDTypeClusterThermostatAttributeActiveScheduleHandleID MTR_PROVISIONALLY_AVAILABLE = 0x0000004F, MTRAttributeIDTypeClusterThermostatAttributePresetsID MTR_PROVISIONALLY_AVAILABLE = 0x00000050, MTRAttributeIDTypeClusterThermostatAttributeSchedulesID MTR_PROVISIONALLY_AVAILABLE = 0x00000051, - MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID MTR_PROVISIONALLY_AVAILABLE = 0x00000052, - MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID MTR_PROVISIONALLY_AVAILABLE = 0x00000053, + MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID MTR_PROVISIONALLY_AVAILABLE = 0x00000052, MTRAttributeIDTypeClusterThermostatAttributeGeneratedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeGeneratedCommandListID, MTRAttributeIDTypeClusterThermostatAttributeAcceptedCommandListID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID, MTRAttributeIDTypeClusterThermostatAttributeEventListID MTR_PROVISIONALLY_AVAILABLE = MTRAttributeIDTypeGlobalAttributeEventListID, @@ -6588,9 +6584,8 @@ typedef NS_ENUM(uint32_t, MTRCommandIDType) { MTRCommandIDTypeClusterThermostatCommandClearWeeklyScheduleID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)) = 0x00000003, MTRCommandIDTypeClusterThermostatCommandSetActiveScheduleRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000005, MTRCommandIDTypeClusterThermostatCommandSetActivePresetRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000006, - MTRCommandIDTypeClusterThermostatCommandStartPresetsSchedulesEditRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000007, - MTRCommandIDTypeClusterThermostatCommandCancelPresetsSchedulesEditRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000008, - MTRCommandIDTypeClusterThermostatCommandCommitPresetsSchedulesRequestID MTR_PROVISIONALLY_AVAILABLE = 0x00000009, + MTRCommandIDTypeClusterThermostatCommandAtomicResponseID MTR_PROVISIONALLY_AVAILABLE = 0x000000FD, + MTRCommandIDTypeClusterThermostatCommandAtomicRequestID MTR_PROVISIONALLY_AVAILABLE = 0x000000FE, // Cluster FanControl deprecated command id names diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm index a3531034733201..97806a694fbc3b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusterNames.mm @@ -5718,8 +5718,8 @@ result = @"ACCoilTemperature"; break; - case MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID: - result = @"ACCapacityformat"; + case MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID: + result = @"ACCapacityFormat"; break; case MTRAttributeIDTypeClusterThermostatAttributePresetTypesID: @@ -5762,10 +5762,6 @@ result = @"Schedules"; break; - case MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID: - result = @"PresetsSchedulesEditable"; - break; - case MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID: result = @"SetpointHoldExpiryTimestamp"; break; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h index 27b2a92f132369..89233d8f4a0db9 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.h @@ -4642,13 +4642,7 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - (void)setActiveScheduleRequestWithParams:(MTRThermostatClusterSetActiveScheduleRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)cancelPresetsSchedulesEditRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion MTR_PROVISIONALLY_AVAILABLE; -- (void)commitPresetsSchedulesRequestWithExpectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion - MTR_PROVISIONALLY_AVAILABLE; +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedDataValueDictionaries expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeLocalTemperatureWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); @@ -4798,9 +4792,9 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (NSDictionary * _Nullable)readAttributeACCoilTemperatureWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (NSDictionary * _Nullable)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); +- (NSDictionary * _Nullable)readAttributeACCapacityFormatWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; @@ -4826,8 +4820,6 @@ MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)) - (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs MTR_PROVISIONALLY_AVAILABLE; - (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; -- (NSDictionary * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - - (NSDictionary * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params MTR_PROVISIONALLY_AVAILABLE; - (NSDictionary * _Nullable)readAttributeGeneratedCommandListWithParams:(MTRReadParams * _Nullable)params MTR_AVAILABLE(ios(16.1), macos(13.0), watchos(9.1), tvos(16.1)); diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm index 322daa4e9a0524..3bb172bc860c7b 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRClusters.mm @@ -13211,82 +13211,20 @@ - (void)setActivePresetRequestWithParams:(MTRThermostatClusterSetActivePresetReq completion:responseHandler]; } -- (void)startPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterStartPresetsSchedulesEditRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion +- (void)atomicRequestWithParams:(MTRThermostatClusterAtomicRequestParams *)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(void (^)(MTRThermostatClusterAtomicResponseParams * _Nullable data, NSError * _Nullable error))completion { if (params == nil) { - params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams + params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; } auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::StartPresetsSchedulesEditRequest::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]; -} - -- (void)cancelPresetsSchedulesEditRequestWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self cancelPresetsSchedulesEditRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)cancelPresetsSchedulesEditRequestWithParams:(MTRThermostatClusterCancelPresetsSchedulesEditRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); - }; - - auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - - using RequestType = Thermostat::Commands::CancelPresetsSchedulesEditRequest::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]; -} - -- (void)commitPresetsSchedulesRequestWithExpectedValues:(NSArray *> *)expectedValues expectedValueInterval:(NSNumber *)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - [self commitPresetsSchedulesRequestWithParams:nil expectedValues:expectedValues expectedValueInterval:expectedValueIntervalMs completion:completion]; -} -- (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPresetsSchedulesRequestParams * _Nullable)params expectedValues:(NSArray *> * _Nullable)expectedValues expectedValueInterval:(NSNumber * _Nullable)expectedValueIntervalMs completion:(MTRStatusCompletion)completion -{ - if (params == nil) { - params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams - alloc] init]; - } - - auto responseHandler = ^(id _Nullable response, NSError * _Nullable error) { - completion(error); + completion(response, error); }; auto * timedInvokeTimeoutMs = params.timedInvokeTimeoutMs; - using RequestType = Thermostat::Commands::CommitPresetsSchedulesRequest::Type; + using RequestType = Thermostat::Commands::AtomicRequest::Type; [self.device _invokeKnownCommandWithEndpointID:self.endpointID clusterID:@(RequestType::GetClusterId()) commandID:@(RequestType::GetCommandId()) @@ -13295,7 +13233,7 @@ - (void)commitPresetsSchedulesRequestWithParams:(MTRThermostatClusterCommitPrese expectedValueInterval:expectedValueIntervalMs timedInvokeTimeout:timedInvokeTimeoutMs serverSideProcessingTimeout:params.serverSideProcessingTimeout - responseClass:nil + responseClass:MTRThermostatClusterAtomicResponseParams.class queue:self.callbackQueue completion:responseHandler]; } @@ -13826,20 +13764,20 @@ - (void)writeAttributeACLouverPositionWithValue:(NSDictionary *) return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCoilTemperatureID) params:params]; } -- (NSDictionary * _Nullable)readAttributeACCapacityformatWithParams:(MTRReadParams * _Nullable)params +- (NSDictionary * _Nullable)readAttributeACCapacityFormatWithParams:(MTRReadParams * _Nullable)params { - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID) params:params]; + return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID) params:params]; } -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs { - [self writeAttributeACCapacityformatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; + [self writeAttributeACCapacityFormatWithValue:dataValueDictionary expectedValueInterval:expectedValueIntervalMs params:nil]; } -- (void)writeAttributeACCapacityformatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params +- (void)writeAttributeACCapacityFormatWithValue:(NSDictionary *)dataValueDictionary expectedValueInterval:(NSNumber *)expectedValueIntervalMs params:(MTRWriteParams * _Nullable)params { NSNumber * timedWriteTimeout = params.timedWriteTimeout; - [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityformatID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; + [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeACCapacityFormatID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } - (NSDictionary * _Nullable)readAttributePresetTypesWithParams:(MTRReadParams * _Nullable)params @@ -13914,11 +13852,6 @@ - (void)writeAttributeSchedulesWithValue:(NSDictionary *)dataVal [self.device writeAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSchedulesID) value:dataValueDictionary expectedValueInterval:expectedValueIntervalMs timedWriteTimeout:timedWriteTimeout]; } -- (NSDictionary * _Nullable)readAttributePresetsSchedulesEditableWithParams:(MTRReadParams * _Nullable)params -{ - return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributePresetsSchedulesEditableID) params:params]; -} - - (NSDictionary * _Nullable)readAttributeSetpointHoldExpiryTimestampWithParams:(MTRReadParams * _Nullable)params { return [self.device readAttributeWithEndpointID:self.endpointID clusterID:@(MTRClusterIDTypeThermostatID) attributeID:@(MTRAttributeIDTypeClusterThermostatAttributeSetpointHoldExpiryTimestampID) params:params]; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h index 7cf6b74ee856e2..ecf7e859d2daef 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.h @@ -7835,65 +7835,36 @@ MTR_PROVISIONALLY_AVAILABLE @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams : NSObject +@interface MTRThermostatClusterAtomicResponseParams : NSObject -@property (nonatomic, copy) NSNumber * _Nonnull timeoutSeconds MTR_PROVISIONALLY_AVAILABLE; -/** - * 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; +@property (nonatomic, copy) NSNumber * _Nonnull statusCode MTR_PROVISIONALLY_AVAILABLE; -/** - * 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 +@property (nonatomic, copy) NSArray * _Nonnull attributeStatus MTR_PROVISIONALLY_AVAILABLE; -MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams : 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; +@property (nonatomic, copy) NSNumber * _Nullable timeout MTR_PROVISIONALLY_AVAILABLE; /** - * Controls how much time, in seconds, we will allow for the server to process the command. + * Initialize an MTRThermostatClusterAtomicResponseParams with a response-value dictionary + * of the sort that MTRDeviceResponseHandler would receive. * - * The command will then time out if that much time, plus an allowance for retransmits due to network failures, passes. + * Will return nil and hand out an error if the response-value dictionary is not + * a command data response or is not the right command response. * - * If nil, the framework will try to select an appropriate timeout value itself. + * Will return nil and hand out an error if the data response does not match the known + * schema for this command. */ -@property (nonatomic, copy, nullable) NSNumber * serverSideProcessingTimeout; +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error MTR_PROVISIONALLY_AVAILABLE; @end MTR_PROVISIONALLY_AVAILABLE -@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams : NSObject +@interface MTRThermostatClusterAtomicRequestParams : NSObject + +@property (nonatomic, copy) NSNumber * _Nonnull requestType MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSArray * _Nonnull attributeRequests MTR_PROVISIONALLY_AVAILABLE; + +@property (nonatomic, copy) NSNumber * _Nullable timeout MTR_PROVISIONALLY_AVAILABLE; /** * Controls whether the command is a timed command (using Timed Invoke). * diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm index bdeea4de027e6e..42b2061492aa4d 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloadsObjc.mm @@ -22352,162 +22352,127 @@ - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader } @end -@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams +@implementation MTRThermostatClusterAtomicResponseParams - (instancetype)init { if (self = [super init]) { - _timeoutSeconds = @(0); - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; + _statusCode = @(0); + + _attributeStatus = [NSArray array]; + + _timeout = nil; } return self; } - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams alloc] init]; + auto other = [[MTRThermostatClusterAtomicResponseParams alloc] init]; - other.timeoutSeconds = self.timeoutSeconds; - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; + other.statusCode = self.statusCode; + other.attributeStatus = self.attributeStatus; + other.timeout = self.timeout; return other; } - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: timeoutSeconds:%@; >", NSStringFromClass([self class]), _timeoutSeconds]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: statusCode:%@; attributeStatus:%@; timeout:%@; >", NSStringFromClass([self class]), _statusCode, _attributeStatus, _timeout]; return descriptionString; } -@end - -@implementation MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) - -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +- (nullable instancetype)initWithResponseValue:(NSDictionary *)responseValue + error:(NSError * __autoreleasing *)error { - chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type encodableStruct; - ListFreer listFreer; - { - encodableStruct.timeoutSeconds = self.timeoutSeconds.unsignedShortValue; + if (!(self = [super init])) { + return nil; } - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); + using DecodableType = chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType; + chip::System::PacketBufferHandle buffer = [MTRBaseDevice _responseDataForCommand:responseValue + clusterID:DecodableType::GetClusterId() + commandID:DecodableType::GetCommandId() + error:error]; 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]; + chip::TLV::TLVReader reader; + reader.Init(buffer->Start(), buffer->DataLength()); + + CHIP_ERROR err = reader.Next(chip::TLV::AnonymousTag()); + if (err == CHIP_NO_ERROR) { + DecodableType decodedStruct; + err = chip::app::DataModel::Decode(reader, decodedStruct); + if (err == CHIP_NO_ERROR) { + err = [self _setFieldsFromDecodableStruct:decodedStruct]; + if (err == CHIP_NO_ERROR) { + return self; + } } } - return decodedObj; -} -@end -@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams -- (instancetype)init -{ - if (self = [super init]) { - _timedInvokeTimeoutMs = nil; - _serverSideProcessingTimeout = nil; + NSString * errorStr = [NSString stringWithFormat:@"Command payload decoding failed: %s", err.AsString()]; + MTR_LOG_ERROR("%s", errorStr.UTF8String); + if (error != nil) { + NSDictionary * userInfo = @{ NSLocalizedFailureReasonErrorKey : NSLocalizedString(errorStr, nil) }; + *error = [NSError errorWithDomain:MTRErrorDomain code:MTRErrorCodeSchemaMismatch userInfo:userInfo]; } - return self; -} - -- (id)copyWithZone:(NSZone * _Nullable)zone; -{ - auto other = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams alloc] init]; - - other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; - other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; - - return other; -} - -- (NSString *)description -{ - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; - return descriptionString; + return nil; } @end -@implementation MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) +@implementation MTRThermostatClusterAtomicResponseParams (InternalMethods) -- (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType &)decodableStruct { - chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type encodableStruct; - ListFreer listFreer; - - auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); - if (buffer.IsNull()) { - return CHIP_ERROR_NO_MEMORY; + { + self.statusCode = [NSNumber numberWithUnsignedChar:decodableStruct.statusCode]; } - - 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]; + { + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + auto iter_0 = decodableStruct.attributeStatus.begin(); + while (iter_0.Next()) { + auto & entry_0 = iter_0.GetValue(); + MTRThermostatClusterAtomicAttributeStatusStruct * newElement_0; + newElement_0 = [MTRThermostatClusterAtomicAttributeStatusStruct new]; + newElement_0.attributeID = [NSNumber numberWithUnsignedInt:entry_0.attributeID]; + newElement_0.statusCode = [NSNumber numberWithUnsignedChar:entry_0.statusCode]; + [array_0 addObject:newElement_0]; + } + CHIP_ERROR err = iter_0.GetStatus(); + if (err != CHIP_NO_ERROR) { + return err; + } + self.attributeStatus = array_0; } - return nil; } - - auto decodedObj = MTRDecodeDataValueDictionaryFromCHIPTLV(&reader); - if (decodedObj == nil) { - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INCORRECT_STATE]; + { + if (decodableStruct.timeout.HasValue()) { + self.timeout = [NSNumber numberWithUnsignedShort:decodableStruct.timeout.Value()]; + } else { + self.timeout = nil; } } - return decodedObj; + return CHIP_NO_ERROR; } + @end -@implementation MTRThermostatClusterCommitPresetsSchedulesRequestParams +@implementation MTRThermostatClusterAtomicRequestParams - (instancetype)init { if (self = [super init]) { + + _requestType = @(0); + + _attributeRequests = [NSArray array]; + + _timeout = nil; _timedInvokeTimeoutMs = nil; _serverSideProcessingTimeout = nil; } @@ -22516,8 +22481,11 @@ - (instancetype)init - (id)copyWithZone:(NSZone * _Nullable)zone; { - auto other = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams alloc] init]; + auto other = [[MTRThermostatClusterAtomicRequestParams alloc] init]; + other.requestType = self.requestType; + other.attributeRequests = self.attributeRequests; + other.timeout = self.timeout; other.timedInvokeTimeoutMs = self.timedInvokeTimeoutMs; other.serverSideProcessingTimeout = self.serverSideProcessingTimeout; @@ -22526,18 +22494,51 @@ - (id)copyWithZone:(NSZone * _Nullable)zone; - (NSString *)description { - NSString * descriptionString = [NSString stringWithFormat:@"<%@: >", NSStringFromClass([self class])]; + NSString * descriptionString = [NSString stringWithFormat:@"<%@: requestType:%@; attributeRequests:%@; timeout:%@; >", NSStringFromClass([self class]), _requestType, _attributeRequests, _timeout]; return descriptionString; } @end -@implementation MTRThermostatClusterCommitPresetsSchedulesRequestParams (InternalMethods) +@implementation MTRThermostatClusterAtomicRequestParams (InternalMethods) - (CHIP_ERROR)_encodeToTLVReader:(chip::System::PacketBufferTLVReader &)reader { - chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Type encodableStruct; + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type encodableStruct; ListFreer listFreer; + { + encodableStruct.requestType = static_cast>(self.requestType.unsignedCharValue); + } + { + { + using ListType_0 = std::remove_reference_t; + using ListMemberType_0 = ListMemberTypeGetter::Type; + if (self.attributeRequests.count != 0) { + auto * listHolder_0 = new ListHolder(self.attributeRequests.count); + if (listHolder_0 == nullptr || listHolder_0->mList == nullptr) { + return CHIP_ERROR_INVALID_ARGUMENT; + } + listFreer.add(listHolder_0); + for (size_t i_0 = 0; i_0 < self.attributeRequests.count; ++i_0) { + if (![self.attributeRequests[i_0] isKindOfClass:[NSNumber class]]) { + // Wrong kind of value. + return CHIP_ERROR_INVALID_ARGUMENT; + } + auto element_0 = (NSNumber *) self.attributeRequests[i_0]; + listHolder_0->mList[i_0] = element_0.unsignedIntValue; + } + encodableStruct.attributeRequests = ListType_0(listHolder_0->mList, self.attributeRequests.count); + } else { + encodableStruct.attributeRequests = ListType_0(); + } + } + } + { + if (self.timeout != nil) { + auto & definedValue_0 = encodableStruct.timeout.Emplace(); + definedValue_0 = self.timeout.unsignedShortValue; + } + } auto buffer = chip::System::PacketBufferHandle::New(chip::System::PacketBuffer::kMaxSizeWithoutReserve, 0); if (buffer.IsNull()) { diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h index db7e9dab35cdf5..9fb75ced469d96 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRCommandPayloads_Internal.h @@ -1468,19 +1468,13 @@ NS_ASSUME_NONNULL_BEGIN @end -@interface MTRThermostatClusterStartPresetsSchedulesEditRequestParams (InternalMethods) +@interface MTRThermostatClusterAtomicResponseParams (InternalMethods) -- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; - -@end - -@interface MTRThermostatClusterCancelPresetsSchedulesEditRequestParams (InternalMethods) - -- (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; +- (CHIP_ERROR)_setFieldsFromDecodableStruct:(const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType &)decodableStruct; @end -@interface MTRThermostatClusterCommitPresetsSchedulesRequestParams (InternalMethods) +@interface MTRThermostatClusterAtomicRequestParams (InternalMethods) - (NSDictionary * _Nullable)_encodeAsDataValue:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h index b804aee8b5ace1..dfbd00cd0cb370 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.h @@ -1658,6 +1658,12 @@ MTR_PROVISIONALLY_AVAILABLE @property (nonatomic, copy) NSNumber * _Nullable builtIn MTR_PROVISIONALLY_AVAILABLE; @end +MTR_PROVISIONALLY_AVAILABLE +@interface MTRThermostatClusterAtomicAttributeStatusStruct : NSObject +@property (nonatomic, copy) NSNumber * _Nonnull attributeID MTR_PROVISIONALLY_AVAILABLE; +@property (nonatomic, copy) NSNumber * _Nonnull statusCode MTR_PROVISIONALLY_AVAILABLE; +@end + MTR_PROVISIONALLY_AVAILABLE @interface MTRThermostatClusterPresetStruct : NSObject @property (nonatomic, copy) NSData * _Nullable presetHandle MTR_PROVISIONALLY_AVAILABLE; diff --git a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm index d3182118beb89c..42e90761a728c2 100644 --- a/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm +++ b/src/darwin/Framework/CHIP/zap-generated/MTRStructsObjc.mm @@ -6998,6 +6998,36 @@ - (NSString *)description @end +@implementation MTRThermostatClusterAtomicAttributeStatusStruct +- (instancetype)init +{ + if (self = [super init]) { + + _attributeID = @(0); + + _statusCode = @(0); + } + return self; +} + +- (id)copyWithZone:(NSZone * _Nullable)zone +{ + auto other = [[MTRThermostatClusterAtomicAttributeStatusStruct alloc] init]; + + other.attributeID = self.attributeID; + other.statusCode = self.statusCode; + + return other; +} + +- (NSString *)description +{ + NSString * descriptionString = [NSString stringWithFormat:@"<%@: attributeID:%@; statusCode:%@; >", NSStringFromClass([self class]), _attributeID, _statusCode]; + return descriptionString; +} + +@end + @implementation MTRThermostatClusterPresetStruct - (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 98e66215739e93..9469b2f0c33e05 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 @@ -23623,9 +23623,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a namespace Occupancy { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -23639,9 +23640,10 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23652,9 +23654,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23945,9 +23948,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value namespace HVACSystemTypeConfiguration { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = @@ -23961,9 +23965,11 @@ Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * val return status; } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -23974,9 +23980,10 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE, markDirty); } -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits>; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -24063,7 +24070,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24076,7 +24083,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace OccupiedCoolingSetpoint @@ -24109,7 +24116,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24122,7 +24129,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace OccupiedHeatingSetpoint @@ -24155,7 +24162,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24168,7 +24175,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace UnoccupiedCoolingSetpoint @@ -24201,7 +24208,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24214,7 +24221,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace UnoccupiedHeatingSetpoint @@ -24247,7 +24254,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24260,7 +24267,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MinHeatSetpointLimit @@ -24293,7 +24300,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24306,7 +24313,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MaxHeatSetpointLimit @@ -24339,7 +24346,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24352,7 +24359,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MinCoolSetpointLimit @@ -24385,7 +24392,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE, markDirty); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE, markDirty); } Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value) @@ -24398,7 +24405,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_TEMPERATURE_ATTRIBUTE_TYPE); } } // namespace MaxCoolSetpointLimit @@ -26146,7 +26153,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum * value) { @@ -26191,7 +26198,7 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Cl return emberAfWriteAttribute(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); } -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace NumberOfPresets { @@ -26593,52 +26600,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace ActiveScheduleHandle -namespace PresetsSchedulesEditable { - -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::Thermostat::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(chip::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(endpoint, Clusters::Thermostat::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE, markDirty); -} - -Protocols::InteractionModel::Status Set(chip::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::Thermostat::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); -} - -} // namespace PresetsSchedulesEditable - namespace SetpointHoldExpiryTimestamp { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value) 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 d7048f05fc93e5..76c3498d10216f 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 @@ -3734,9 +3734,12 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a } // namespace OutdoorTemperature namespace Occupancy { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, + chip::BitMask * value); // OccupancyBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status +Set(chip::EndpointId endpoint, chip::BitMask value, MarkAttributeDirty markDirty); } // namespace Occupancy namespace AbsMinHeatSetpointLimit { @@ -3776,9 +3779,14 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value } // namespace PIHeatingDemand namespace HVACSystemTypeConfiguration { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); +Protocols::InteractionModel::Status +Get(chip::EndpointId endpoint, + chip::BitMask * value); // HVACSystemTypeBitmap +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value); +Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, + chip::BitMask value, + MarkAttributeDirty markDirty); } // namespace HVACSystemTypeConfiguration namespace LocalTemperatureCalibration { @@ -3788,49 +3796,49 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int8_t value, } // namespace LocalTemperatureCalibration namespace OccupiedCoolingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace OccupiedCoolingSetpoint namespace OccupiedHeatingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace OccupiedHeatingSetpoint namespace UnoccupiedCoolingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace UnoccupiedCoolingSetpoint namespace UnoccupiedHeatingSetpoint { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace UnoccupiedHeatingSetpoint namespace MinHeatSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MinHeatSetpointLimit namespace MaxHeatSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MaxHeatSetpointLimit namespace MinCoolSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MinCoolSetpointLimit namespace MaxCoolSetpointLimit { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // int16s +Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, int16_t * value); // temperature Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); } // namespace MaxCoolSetpointLimit @@ -4095,13 +4103,13 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a MarkAttributeDirty markDirty); } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum * value); // ACCapacityFormatEnum Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value); Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, chip::app::Clusters::Thermostat::ACCapacityFormatEnum value, MarkAttributeDirty markDirty); -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace NumberOfPresets { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, uint8_t * value); // int8u @@ -4156,12 +4164,6 @@ Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, const chip::a MarkAttributeDirty markDirty); } // namespace ActiveScheduleHandle -namespace PresetsSchedulesEditable { -Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace PresetsSchedulesEditable - namespace SetpointHoldExpiryTimestamp { Protocols::InteractionModel::Status Get(chip::EndpointId endpoint, DataModel::Nullable & value); // epoch_s Protocols::InteractionModel::Status Set(chip::EndpointId endpoint, uint32_t value); 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 e77faa965f192a..2ec4284f1ddc12 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -6300,23 +6300,11 @@ bool emberAfThermostatClusterSetActivePresetRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::Thermostat::Commands::SetActivePresetRequest::DecodableType & commandData); /** - * @brief Thermostat Cluster StartPresetsSchedulesEditRequest Command callback (from client) + * @brief Thermostat Cluster AtomicRequest Command callback (from client) */ -bool emberAfThermostatClusterStartPresetsSchedulesEditRequestCallback( +bool emberAfThermostatClusterAtomicRequestCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::DecodableType & commandData); -/** - * @brief Thermostat Cluster CancelPresetsSchedulesEditRequest Command callback (from client) - */ -bool emberAfThermostatClusterCancelPresetsSchedulesEditRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::DecodableType & commandData); -/** - * @brief Thermostat Cluster CommitPresetsSchedulesRequest Command callback (from client) - */ -bool emberAfThermostatClusterCommitPresetsSchedulesRequestCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::DecodableType & commandData); + const chip::app::Clusters::Thermostat::Commands::AtomicRequest::DecodableType & commandData); /** * @brief Fan Control Cluster Step Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h index d4a4bdd1909eb4..9368740f7fc463 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums-check.h @@ -2675,6 +2675,19 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::ACTypeEnum return EnumType::kUnknownEnumValue; } } +static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::AtomicRequestTypeEnum val) +{ + using EnumType = Thermostat::AtomicRequestTypeEnum; + switch (val) + { + case EnumType::kBeginWrite: + case EnumType::kCommitWrite: + case EnumType::kRollbackWrite: + return val; + default: + return EnumType::kUnknownEnumValue; + } +} static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::ControlSequenceOfOperationEnum val) { using EnumType = Thermostat::ControlSequenceOfOperationEnum; @@ -2696,7 +2709,6 @@ static auto __attribute__((unused)) EnsureKnownEnumValue(Thermostat::PresetScena using EnumType = Thermostat::PresetScenarioEnum; switch (val) { - case EnumType::kUnspecified: case EnumType::kOccupied: case EnumType::kUnoccupied: case EnumType::kSleep: 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 d8092bee42e3ea..305ebd2b27d689 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 @@ -3910,6 +3910,19 @@ enum class ACTypeEnum : uint8_t kUnknownEnumValue = 5, }; +// Enum for AtomicRequestTypeEnum +enum class AtomicRequestTypeEnum : uint8_t +{ + kBeginWrite = 0x00, + kCommitWrite = 0x01, + kRollbackWrite = 0x02, + // All received enum values that are not listed above will be mapped + // to kUnknownEnumValue. This is a helper enum value that should only + // be used by code to process how it handles receiving and unknown + // enum value. This specific should never be transmitted. + kUnknownEnumValue = 3, +}; + // Enum for ControlSequenceOfOperationEnum enum class ControlSequenceOfOperationEnum : uint8_t { @@ -3929,7 +3942,6 @@ enum class ControlSequenceOfOperationEnum : uint8_t // Enum for PresetScenarioEnum enum class PresetScenarioEnum : uint8_t { - kUnspecified = 0x00, kOccupied = 0x01, kUnoccupied = 0x02, kSleep = 0x03, @@ -3941,7 +3953,7 @@ enum class PresetScenarioEnum : uint8_t // to kUnknownEnumValue. This is a helper enum value that should only // be used by code to process how it handles receiving and unknown // enum value. This specific should never be transmitted. - kUnknownEnumValue = 7, + kUnknownEnumValue = 0, }; // Enum for SetpointChangeSourceEnum @@ -4053,7 +4065,6 @@ enum class Feature : uint32_t kLocalTemperatureNotExposed = 0x40, kMatterScheduleConfiguration = 0x80, kPresets = 0x100, - kSetpoints = 0x200, }; // Bitmap for HVACSystemTypeBitmap @@ -4065,6 +4076,12 @@ enum class HVACSystemTypeBitmap : uint8_t kHeatingUsesFuel = 0x20, }; +// Bitmap for OccupancyBitmap +enum class OccupancyBitmap : uint8_t +{ + kOccupied = 0x1, +}; + // Bitmap for PresetTypeFeaturesBitmap enum class PresetTypeFeaturesBitmap : uint16_t { 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 f06eb2cc350702..95146178ab8c9f 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 @@ -20710,6 +20710,47 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace ScheduleStruct +namespace AtomicAttributeStatusStruct { +CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const +{ + DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kAttributeID), attributeID); + encoder.Encode(to_underlying(Fields::kStatusCode), statusCode); + 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::kAttributeID)) + { + err = DataModel::Decode(reader, attributeID); + } + else if (__context_tag == to_underlying(Fields::kStatusCode)) + { + err = DataModel::Decode(reader, statusCode); + } + else + { + } + + ReturnErrorOnFailure(err); + } +} + +} // namespace AtomicAttributeStatusStruct + namespace PresetStruct { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { @@ -21175,11 +21216,13 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } } } // namespace SetActivePresetRequest. -namespace StartPresetsSchedulesEditRequest { +namespace AtomicResponse { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kTimeoutSeconds), timeoutSeconds); + encoder.Encode(to_underlying(Fields::kStatusCode), statusCode); + encoder.Encode(to_underlying(Fields::kAttributeStatus), attributeStatus); + encoder.Encode(to_underlying(Fields::kTimeout), timeout); return encoder.Finalize(); } @@ -21197,9 +21240,17 @@ 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::kTimeoutSeconds)) + if (__context_tag == to_underlying(Fields::kStatusCode)) + { + err = DataModel::Decode(reader, statusCode); + } + else if (__context_tag == to_underlying(Fields::kAttributeStatus)) { - err = DataModel::Decode(reader, timeoutSeconds); + err = DataModel::Decode(reader, attributeStatus); + } + else if (__context_tag == to_underlying(Fields::kTimeout)) + { + err = DataModel::Decode(reader, timeout); } else { @@ -21208,11 +21259,14 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) ReturnErrorOnFailure(err); } } -} // namespace StartPresetsSchedulesEditRequest. -namespace CancelPresetsSchedulesEditRequest { +} // namespace AtomicResponse. +namespace AtomicRequest { CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const { DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; + encoder.Encode(to_underlying(Fields::kRequestType), requestType); + encoder.Encode(to_underlying(Fields::kAttributeRequests), attributeRequests); + encoder.Encode(to_underlying(Fields::kTimeout), timeout); return encoder.Finalize(); } @@ -21226,29 +21280,30 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) { return std::get(__element); } - } -} -} // namespace CancelPresetsSchedulesEditRequest. -namespace CommitPresetsSchedulesRequest { -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)) + CHIP_ERROR err = CHIP_NO_ERROR; + const uint8_t __context_tag = std::get(__element); + + if (__context_tag == to_underlying(Fields::kRequestType)) { - return std::get(__element); + err = DataModel::Decode(reader, requestType); } + else if (__context_tag == to_underlying(Fields::kAttributeRequests)) + { + err = DataModel::Decode(reader, attributeRequests); + } + else if (__context_tag == to_underlying(Fields::kTimeout)) + { + err = DataModel::Decode(reader, timeout); + } + else + { + } + + ReturnErrorOnFailure(err); } } -} // namespace CommitPresetsSchedulesRequest. +} // namespace AtomicRequest. } // namespace Commands namespace Attributes { @@ -21352,8 +21407,8 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, ACLouverPosition); case Attributes::ACCoilTemperature::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, ACCoilTemperature); - case Attributes::ACCapacityformat::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, ACCapacityformat); + case Attributes::ACCapacityFormat::TypeInfo::GetAttributeId(): + return DataModel::Decode(reader, ACCapacityFormat); case Attributes::PresetTypes::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, presetTypes); case Attributes::ScheduleTypes::TypeInfo::GetAttributeId(): @@ -21374,8 +21429,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre return DataModel::Decode(reader, presets); case Attributes::Schedules::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, schedules); - case Attributes::PresetsSchedulesEditable::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, presetsSchedulesEditable); case Attributes::SetpointHoldExpiryTimestamp::TypeInfo::GetAttributeId(): return DataModel::Decode(reader, setpointHoldExpiryTimestamp); 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 cbd58c57f444d7..fdf9956572a5ad 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 @@ -29068,7 +29068,7 @@ struct Type Optional name; Optional presetHandle; DataModel::List transitions; - Optional> builtIn; + DataModel::Nullable builtIn; static constexpr bool kIsFabricScoped = false; @@ -29083,7 +29083,7 @@ struct DecodableType Optional name; Optional presetHandle; DataModel::DecodableList transitions; - Optional> builtIn; + DataModel::Nullable builtIn; CHIP_ERROR Decode(TLV::TLVReader & reader); @@ -29091,6 +29091,29 @@ struct DecodableType }; } // namespace ScheduleStruct +namespace AtomicAttributeStatusStruct { +enum class Fields : uint8_t +{ + kAttributeID = 0, + kStatusCode = 1, +}; + +struct Type +{ +public: + chip::AttributeId attributeID = static_cast(0); + uint8_t statusCode = static_cast(0); + + 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 AtomicAttributeStatusStruct namespace PresetStruct { enum class Fields : uint8_t { @@ -29237,20 +29260,15 @@ struct Type; struct DecodableType; } // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { -struct Type; -struct DecodableType; -} // namespace StartPresetsSchedulesEditRequest - -namespace CancelPresetsSchedulesEditRequest { +namespace AtomicResponse { struct Type; struct DecodableType; -} // namespace CancelPresetsSchedulesEditRequest +} // namespace AtomicResponse -namespace CommitPresetsSchedulesRequest { +namespace AtomicRequest { struct Type; struct DecodableType; -} // namespace CommitPresetsSchedulesRequest +} // namespace AtomicRequest } // namespace Commands @@ -29499,20 +29517,24 @@ struct DecodableType CHIP_ERROR Decode(TLV::TLVReader & reader); }; }; // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { +namespace AtomicResponse { enum class Fields : uint8_t { - kTimeoutSeconds = 0, + kStatusCode = 0, + kAttributeStatus = 1, + kTimeout = 2, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::StartPresetsSchedulesEditRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint16_t timeoutSeconds = static_cast(0); + uint8_t statusCode = static_cast(0); + DataModel::List attributeStatus; + Optional timeout; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; @@ -29524,56 +29546,37 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::StartPresetsSchedulesEditRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicResponse::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - uint16_t timeoutSeconds = static_cast(0); + uint8_t statusCode = static_cast(0); + DataModel::DecodableList attributeStatus; + Optional timeout; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace StartPresetsSchedulesEditRequest -namespace CancelPresetsSchedulesEditRequest { +}; // namespace AtomicResponse +namespace AtomicRequest { enum class Fields : uint8_t { + kRequestType = 0, + kAttributeRequests = 1, + kTimeout = 2, }; struct Type { public: // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::CancelPresetsSchedulesEditRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::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::CancelPresetsSchedulesEditRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace CancelPresetsSchedulesEditRequest -namespace CommitPresetsSchedulesRequest { -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::CommitPresetsSchedulesRequest::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + AtomicRequestTypeEnum requestType = static_cast(0); + DataModel::List attributeRequests; + Optional timeout; CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - using ResponseType = DataModel::NullObjectType; + using ResponseType = Clusters::Thermostat::Commands::AtomicResponse::DecodableType; static constexpr bool MustUseTimedInvoke() { return false; } }; @@ -29581,12 +29584,15 @@ struct Type struct DecodableType { public: - static constexpr CommandId GetCommandId() { return Commands::CommitPresetsSchedulesRequest::Id; } + static constexpr CommandId GetCommandId() { return Commands::AtomicRequest::Id; } static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } + AtomicRequestTypeEnum requestType = static_cast(0); + DataModel::DecodableList attributeRequests; + Optional timeout; CHIP_ERROR Decode(TLV::TLVReader & reader); }; -}; // namespace CommitPresetsSchedulesRequest +}; // namespace AtomicRequest } // namespace Commands namespace Attributes { @@ -29618,9 +29624,9 @@ struct TypeInfo namespace Occupancy { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::Occupancy::Id; } @@ -29702,9 +29708,9 @@ struct TypeInfo namespace HVACSystemTypeConfiguration { struct TypeInfo { - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; + using Type = chip::BitMask; + using DecodableType = chip::BitMask; + using DecodableArgType = chip::BitMask; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } static constexpr AttributeId GetAttributeId() { return Attributes::HVACSystemTypeConfiguration::Id; } @@ -30167,7 +30173,7 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { struct TypeInfo { using Type = chip::app::Clusters::Thermostat::ACCapacityFormatEnum; @@ -30175,10 +30181,10 @@ struct TypeInfo using DecodableArgType = chip::app::Clusters::Thermostat::ACCapacityFormatEnum; static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ACCapacityformat::Id; } + static constexpr AttributeId GetAttributeId() { return Attributes::ACCapacityFormat::Id; } static constexpr bool MustUseTimedWrite() { return false; } }; -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace PresetTypes { struct TypeInfo { @@ -30309,18 +30315,6 @@ struct TypeInfo static constexpr bool MustUseTimedWrite() { return false; } }; } // namespace Schedules -namespace PresetsSchedulesEditable { -struct TypeInfo -{ - using Type = bool; - using DecodableType = bool; - using DecodableArgType = bool; - - static constexpr ClusterId GetClusterId() { return Clusters::Thermostat::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PresetsSchedulesEditable::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PresetsSchedulesEditable namespace SetpointHoldExpiryTimestamp { struct TypeInfo { @@ -30380,14 +30374,16 @@ struct TypeInfo Attributes::LocalTemperature::TypeInfo::DecodableType localTemperature; Attributes::OutdoorTemperature::TypeInfo::DecodableType outdoorTemperature; - Attributes::Occupancy::TypeInfo::DecodableType occupancy = static_cast(0); - Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableType absMinHeatSetpointLimit = static_cast(0); - Attributes::AbsMaxHeatSetpointLimit::TypeInfo::DecodableType absMaxHeatSetpointLimit = static_cast(0); - Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableType absMinCoolSetpointLimit = static_cast(0); - Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableType absMaxCoolSetpointLimit = static_cast(0); - Attributes::PICoolingDemand::TypeInfo::DecodableType PICoolingDemand = static_cast(0); - Attributes::PIHeatingDemand::TypeInfo::DecodableType PIHeatingDemand = static_cast(0); - Attributes::HVACSystemTypeConfiguration::TypeInfo::DecodableType HVACSystemTypeConfiguration = static_cast(0); + Attributes::Occupancy::TypeInfo::DecodableType occupancy = + static_cast>(0); + Attributes::AbsMinHeatSetpointLimit::TypeInfo::DecodableType absMinHeatSetpointLimit = static_cast(0); + Attributes::AbsMaxHeatSetpointLimit::TypeInfo::DecodableType absMaxHeatSetpointLimit = static_cast(0); + Attributes::AbsMinCoolSetpointLimit::TypeInfo::DecodableType absMinCoolSetpointLimit = static_cast(0); + Attributes::AbsMaxCoolSetpointLimit::TypeInfo::DecodableType absMaxCoolSetpointLimit = static_cast(0); + Attributes::PICoolingDemand::TypeInfo::DecodableType PICoolingDemand = static_cast(0); + Attributes::PIHeatingDemand::TypeInfo::DecodableType PIHeatingDemand = static_cast(0); + Attributes::HVACSystemTypeConfiguration::TypeInfo::DecodableType HVACSystemTypeConfiguration = + static_cast>(0); Attributes::LocalTemperatureCalibration::TypeInfo::DecodableType localTemperatureCalibration = static_cast(0); Attributes::OccupiedCoolingSetpoint::TypeInfo::DecodableType occupiedCoolingSetpoint = static_cast(0); Attributes::OccupiedHeatingSetpoint::TypeInfo::DecodableType occupiedHeatingSetpoint = static_cast(0); @@ -30439,7 +30435,7 @@ struct TypeInfo Attributes::ACLouverPosition::TypeInfo::DecodableType ACLouverPosition = static_cast(0); Attributes::ACCoilTemperature::TypeInfo::DecodableType ACCoilTemperature; - Attributes::ACCapacityformat::TypeInfo::DecodableType ACCapacityformat = + Attributes::ACCapacityFormat::TypeInfo::DecodableType ACCapacityFormat = static_cast(0); Attributes::PresetTypes::TypeInfo::DecodableType presetTypes; Attributes::ScheduleTypes::TypeInfo::DecodableType scheduleTypes; @@ -30451,7 +30447,6 @@ struct TypeInfo Attributes::ActiveScheduleHandle::TypeInfo::DecodableType activeScheduleHandle; Attributes::Presets::TypeInfo::DecodableType presets; Attributes::Schedules::TypeInfo::DecodableType schedules; - Attributes::PresetsSchedulesEditable::TypeInfo::DecodableType presetsSchedulesEditable = static_cast(0); Attributes::SetpointHoldExpiryTimestamp::TypeInfo::DecodableType setpointHoldExpiryTimestamp; Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; 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 4bca1b13d93867..b021accb0a82d2 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 @@ -5138,9 +5138,9 @@ namespace ACCoilTemperature { static constexpr AttributeId Id = 0x00000046; } // namespace ACCoilTemperature -namespace ACCapacityformat { +namespace ACCapacityFormat { static constexpr AttributeId Id = 0x00000047; -} // namespace ACCapacityformat +} // namespace ACCapacityFormat namespace PresetTypes { static constexpr AttributeId Id = 0x00000048; @@ -5182,12 +5182,8 @@ namespace Schedules { static constexpr AttributeId Id = 0x00000051; } // namespace Schedules -namespace PresetsSchedulesEditable { -static constexpr AttributeId Id = 0x00000052; -} // namespace PresetsSchedulesEditable - namespace SetpointHoldExpiryTimestamp { -static constexpr AttributeId Id = 0x00000053; +static constexpr AttributeId Id = 0x00000052; } // namespace SetpointHoldExpiryTimestamp namespace GeneratedCommandList { 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 015e613cdd6f29..9eca7cfa5f4153 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 @@ -1316,17 +1316,13 @@ namespace SetActivePresetRequest { static constexpr CommandId Id = 0x00000006; } // namespace SetActivePresetRequest -namespace StartPresetsSchedulesEditRequest { -static constexpr CommandId Id = 0x00000007; -} // namespace StartPresetsSchedulesEditRequest - -namespace CancelPresetsSchedulesEditRequest { -static constexpr CommandId Id = 0x00000008; -} // namespace CancelPresetsSchedulesEditRequest +namespace AtomicResponse { +static constexpr CommandId Id = 0x000000FD; +} // namespace AtomicResponse -namespace CommitPresetsSchedulesRequest { -static constexpr CommandId Id = 0x00000009; -} // namespace CommitPresetsSchedulesRequest +namespace AtomicRequest { +static constexpr CommandId Id = 0x000000FE; +} // namespace AtomicRequest } // namespace Commands } // namespace Thermostat diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index 8bc86e168d8c66..07fc15c629b45f 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -9392,9 +9392,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ClearWeeklySchedule | 0x03 | | * SetActiveScheduleRequest | 0x05 | | * SetActivePresetRequest | 0x06 | -| * StartPresetsSchedulesEditRequest | 0x07 | -| * CancelPresetsSchedulesEditRequest | 0x08 | -| * CommitPresetsSchedulesRequest | 0x09 | +| * AtomicRequest | 0xFE | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -9445,7 +9443,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ACErrorCode | 0x0044 | | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | -| * ACCapacityformat | 0x0047 | +| * ACCapacityFormat | 0x0047 | | * PresetTypes | 0x0048 | | * ScheduleTypes | 0x0049 | | * NumberOfPresets | 0x004A | @@ -9456,8 +9454,7 @@ class ServiceAreaSkipCurrentLocation : public ClusterCommand | * ActiveScheduleHandle | 0x004F | | * Presets | 0x0050 | | * Schedules | 0x0051 | -| * PresetsSchedulesEditable | 0x0052 | -| * SetpointHoldExpiryTimestamp | 0x0053 | +| * SetpointHoldExpiryTimestamp | 0x0052 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -9704,96 +9701,24 @@ class ThermostatSetActivePresetRequest : public ClusterCommand }; /* - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest */ -class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand +class ThermostatAtomicRequest : public ClusterCommand { public: - ThermostatStartPresetsSchedulesEditRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("start-presets-schedules-edit-request", credsIssuerConfig) - { - AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::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::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::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::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type mRequest; -}; - -/* - * Command CancelPresetsSchedulesEditRequest - */ -class ThermostatCancelPresetsSchedulesEditRequest : public ClusterCommand -{ -public: - ThermostatCancelPresetsSchedulesEditRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("cancel-presets-schedules-edit-request", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::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::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::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::Thermostat::Commands::CancelPresetsSchedulesEditRequest::Type mRequest; -}; - -/* - * Command CommitPresetsSchedulesRequest - */ -class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand -{ -public: - ThermostatCommitPresetsSchedulesRequest(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("commit-presets-schedules-request", credsIssuerConfig) + ThermostatAtomicRequest(CredentialIssuerCommands * credsIssuerConfig) : + ClusterCommand("atomic-request", credsIssuerConfig), mComplex_AttributeRequests(&mRequest.attributeRequests) { + AddArgument("RequestType", 0, UINT8_MAX, &mRequest.requestType); + AddArgument("AttributeRequests", &mComplex_AttributeRequests); + AddArgument("Timeout", 0, UINT16_MAX, &mRequest.timeout); ClusterCommand::AddArguments(); } CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, commandId, endpointIds.at(0)); @@ -9803,7 +9728,7 @@ class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::Id; ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, groupId); @@ -9812,7 +9737,8 @@ class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand } private: - chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::Type mRequest; + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type mRequest; + TypedComplexArgument> mComplex_AttributeRequests; }; /*----------------------------------------------------------------------------*\ @@ -22879,16 +22805,14 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c // // Commands // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // + make_unique(Id, credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // + make_unique(credsIssuerConfig), // // // Attributes // @@ -22955,7 +22879,7 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "acerror-code", Attributes::ACErrorCode::Id, credsIssuerConfig), // make_unique(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // - make_unique(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique(Id, "accapacity-format", Attributes::ACCapacityFormat::Id, credsIssuerConfig), // make_unique(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // make_unique(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // make_unique(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // @@ -22968,8 +22892,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // make_unique(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // make_unique(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // - make_unique(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, - credsIssuerConfig), // make_unique(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // @@ -22985,8 +22907,8 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique>>(Id, "outdoor-temperature", INT16_MIN, INT16_MAX, Attributes::OutdoorTemperature::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "occupancy", 0, UINT8_MAX, Attributes::Occupancy::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // + make_unique>>( + Id, "occupancy", 0, UINT8_MAX, Attributes::Occupancy::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "abs-min-heat-setpoint-limit", INT16_MIN, INT16_MAX, Attributes::AbsMinHeatSetpointLimit::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23003,9 +22925,9 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>(Id, "piheating-demand", 0, UINT8_MAX, Attributes::PIHeatingDemand::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "hvacsystem-type-configuration", 0, UINT8_MAX, - Attributes::HVACSystemTypeConfiguration::Id, WriteCommandType::kWrite, - credsIssuerConfig), // + make_unique>>( + Id, "hvacsystem-type-configuration", 0, UINT8_MAX, Attributes::HVACSystemTypeConfiguration::Id, + WriteCommandType::kWrite, credsIssuerConfig), // make_unique>(Id, "local-temperature-calibration", INT8_MIN, INT8_MAX, Attributes::LocalTemperatureCalibration::Id, WriteCommandType::kWrite, credsIssuerConfig), // @@ -23108,7 +23030,8 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c Attributes::ACCoilTemperature::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>( - Id, "accapacityformat", 0, UINT8_MAX, Attributes::ACCapacityformat::Id, WriteCommandType::kWrite, credsIssuerConfig), // + Id, "accapacity-format", 0, UINT8_MAX, Attributes::ACCapacityFormat::Id, WriteCommandType::kWrite, + credsIssuerConfig), // make_unique>>( Id, "preset-types", Attributes::PresetTypes::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23136,8 +23059,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique>>( Id, "schedules", Attributes::Schedules::Id, WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "presets-schedules-editable", 0, 1, Attributes::PresetsSchedulesEditable::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>(Id, "setpoint-hold-expiry-timestamp", 0, UINT32_MAX, Attributes::SetpointHoldExpiryTimestamp::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -23221,7 +23142,7 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "acerror-code", Attributes::ACErrorCode::Id, credsIssuerConfig), // make_unique(Id, "aclouver-position", Attributes::ACLouverPosition::Id, credsIssuerConfig), // make_unique(Id, "accoil-temperature", Attributes::ACCoilTemperature::Id, credsIssuerConfig), // - make_unique(Id, "accapacityformat", Attributes::ACCapacityformat::Id, credsIssuerConfig), // + make_unique(Id, "accapacity-format", Attributes::ACCapacityFormat::Id, credsIssuerConfig), // make_unique(Id, "preset-types", Attributes::PresetTypes::Id, credsIssuerConfig), // make_unique(Id, "schedule-types", Attributes::ScheduleTypes::Id, credsIssuerConfig), // make_unique(Id, "number-of-presets", Attributes::NumberOfPresets::Id, credsIssuerConfig), // @@ -23234,8 +23155,6 @@ void registerClusterThermostat(Commands & commands, CredentialIssuerCommands * c make_unique(Id, "active-schedule-handle", Attributes::ActiveScheduleHandle::Id, credsIssuerConfig), // make_unique(Id, "presets", Attributes::Presets::Id, credsIssuerConfig), // make_unique(Id, "schedules", Attributes::Schedules::Id, credsIssuerConfig), // - make_unique(Id, "presets-schedules-editable", Attributes::PresetsSchedulesEditable::Id, - credsIssuerConfig), // make_unique(Id, "setpoint-hold-expiry-timestamp", Attributes::SetpointHoldExpiryTimestamp::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::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 c6d7864443fafe..5f967fc503c67d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.cpp @@ -4027,6 +4027,7 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.systemMode", "systemMode", value.isMember("systemMode"))); ReturnErrorOnFailure( ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.transitions", "transitions", value.isMember("transitions"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("ScheduleStruct.builtIn", "builtIn", value.isMember("builtIn"))); char labelWithMember[kMaxLabelLength]; snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "scheduleHandle"); @@ -4055,11 +4056,8 @@ CHIP_ERROR ComplexArgumentParser::Setup(const char * label, ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.transitions, value["transitions"])); valueCopy.removeMember("transitions"); - if (value.isMember("builtIn")) - { - snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "builtIn"); - ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.builtIn, value["builtIn"])); - } + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "builtIn"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.builtIn, value["builtIn"])); valueCopy.removeMember("builtIn"); return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); @@ -4075,6 +4073,38 @@ void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::S ComplexArgumentParser::Finalize(request.builtIn); } +CHIP_ERROR ComplexArgumentParser::Setup(const char * label, + chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::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("AtomicAttributeStatusStruct.attributeID", "attributeID", + value.isMember("attributeID"))); + ReturnErrorOnFailure(ComplexArgumentParser::EnsureMemberExist("AtomicAttributeStatusStruct.statusCode", "statusCode", + value.isMember("statusCode"))); + + char labelWithMember[kMaxLabelLength]; + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "attributeID"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.attributeID, value["attributeID"])); + valueCopy.removeMember("attributeID"); + + snprintf(labelWithMember, sizeof(labelWithMember), "%s.%s", label, "statusCode"); + ReturnErrorOnFailure(ComplexArgumentParser::Setup(labelWithMember, request.statusCode, value["statusCode"])); + valueCopy.removeMember("statusCode"); + + return ComplexArgumentParser::EnsureNoMembersRemaining(label, valueCopy); +} + +void ComplexArgumentParser::Finalize(chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request) +{ + ComplexArgumentParser::Finalize(request.attributeID); + ComplexArgumentParser::Finalize(request.statusCode); +} + CHIP_ERROR ComplexArgumentParser::Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::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 c258467efab2a6..5a82e7c35f8148 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/ComplexArgumentParser.h @@ -461,6 +461,11 @@ static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Str static void Finalize(chip::app::Clusters::Thermostat::Structs::ScheduleStruct::Type & request); +static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request, + Json::Value & value); + +static void Finalize(chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::Type & request); + static CHIP_ERROR Setup(const char * label, chip::app::Clusters::Thermostat::Structs::PresetStruct::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 e88c7d0b0d7737..f7a589c085097d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -3609,6 +3609,32 @@ 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::Thermostat::Structs::AtomicAttributeStatusStruct::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + { + CHIP_ERROR err = LogValue("AttributeID", indent + 1, value.attributeID); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'AttributeID'"); + return err; + } + } + { + CHIP_ERROR err = LogValue("StatusCode", indent + 1, value.statusCode); + if (err != CHIP_NO_ERROR) + { + DataModelLogger::LogString(indent + 1, "Struct truncated due to invalid value for 'StatusCode'"); + return err; + } + } + DataModelLogger::LogString(indent, "}"); + + return CHIP_NO_ERROR; +} + CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::PresetStruct::DecodableType & value) { @@ -8116,6 +8142,16 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } +CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, + const Thermostat::Commands::AtomicResponse::DecodableType & value) +{ + DataModelLogger::LogString(label, indent, "{"); + ReturnErrorOnFailure(DataModelLogger::LogValue("statusCode", indent + 1, value.statusCode)); + ReturnErrorOnFailure(DataModelLogger::LogValue("attributeStatus", indent + 1, value.attributeStatus)); + ReturnErrorOnFailure(DataModelLogger::LogValue("timeout", indent + 1, value.timeout)); + DataModelLogger::LogString(indent, "}"); + return CHIP_NO_ERROR; +} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value) { @@ -14526,7 +14562,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("OutdoorTemperature", 1, value); } case Thermostat::Attributes::Occupancy::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Occupancy", 1, value); } @@ -14561,7 +14597,7 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP return DataModelLogger::LogValue("PIHeatingDemand", 1, value); } case Thermostat::Attributes::HVACSystemTypeConfiguration::Id: { - uint8_t value; + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("HVACSystemTypeConfiguration", 1, value); } @@ -14755,10 +14791,10 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("ACCoilTemperature", 1, value); } - case Thermostat::Attributes::ACCapacityformat::Id: { + case Thermostat::Attributes::ACCapacityFormat::Id: { chip::app::Clusters::Thermostat::ACCapacityFormatEnum value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ACCapacityformat", 1, value); + return DataModelLogger::LogValue("ACCapacityFormat", 1, value); } case Thermostat::Attributes::PresetTypes::Id: { chip::app::DataModel::DecodableList value; @@ -14810,11 +14846,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("Schedules", 1, value); } - case Thermostat::Attributes::PresetsSchedulesEditable::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("PresetsSchedulesEditable", 1, value); - } case Thermostat::Attributes::SetpointHoldExpiryTimestamp::Id: { chip::app::DataModel::Nullable value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); @@ -19297,6 +19328,11 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); return DataModelLogger::LogValue("GetWeeklyScheduleResponse", 1, value); } + case Thermostat::Commands::AtomicResponse::Id: { + Thermostat::Commands::AtomicResponse::DecodableType value; + ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); + return DataModelLogger::LogValue("AtomicResponse", 1, value); + } } break; } 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 8a74b57e503b30..62e8cae7cc7839 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -288,6 +288,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::Thermostat::Structs::ScheduleStruct::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Structs::AtomicAttributeStatusStruct::DecodableType & value); + static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Structs::PresetStruct::DecodableType & value); @@ -766,6 +769,8 @@ static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::ServiceArea::Commands::SkipCurrentLocationResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::Thermostat::Commands::GetWeeklyScheduleResponse::DecodableType & value); +static CHIP_ERROR LogValue(const char * label, size_t indent, + const chip::app::Clusters::Thermostat::Commands::AtomicResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::WiFiNetworkManagement::Commands::NetworkPassphraseResponse::DecodableType & value); 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 543bfe1e3e8f4f..416597a3bdd38d 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -106820,9 +106820,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ClearWeeklySchedule | 0x03 | | * SetActiveScheduleRequest | 0x05 | | * SetActivePresetRequest | 0x06 | -| * StartPresetsSchedulesEditRequest | 0x07 | -| * CancelPresetsSchedulesEditRequest | 0x08 | -| * CommitPresetsSchedulesRequest | 0x09 | +| * AtomicRequest | 0xFE | |------------------------------------------------------------------------------| | Attributes: | | | * LocalTemperature | 0x0000 | @@ -106873,7 +106871,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ACErrorCode | 0x0044 | | * ACLouverPosition | 0x0045 | | * ACCoilTemperature | 0x0046 | -| * ACCapacityformat | 0x0047 | +| * ACCapacityFormat | 0x0047 | | * PresetTypes | 0x0048 | | * ScheduleTypes | 0x0049 | | * NumberOfPresets | 0x004A | @@ -106884,8 +106882,7 @@ class SubscribeAttributePumpConfigurationAndControlClusterRevision : public Subs | * ActiveScheduleHandle | 0x004F | | * Presets | 0x0050 | | * Schedules | 0x0051 | -| * PresetsSchedulesEditable | 0x0052 | -| * SetpointHoldExpiryTimestamp | 0x0053 | +| * SetpointHoldExpiryTimestamp | 0x0052 | | * GeneratedCommandList | 0xFFF8 | | * AcceptedCommandList | 0xFFF9 | | * EventList | 0xFFFA | @@ -107226,15 +107223,22 @@ class ThermostatSetActivePresetRequest : public ClusterCommand { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* - * Command StartPresetsSchedulesEditRequest + * Command AtomicRequest */ -class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand { +class ThermostatAtomicRequest : public ClusterCommand { public: - ThermostatStartPresetsSchedulesEditRequest() - : ClusterCommand("start-presets-schedules-edit-request") + ThermostatAtomicRequest() + : ClusterCommand("atomic-request") + , mComplex_AttributeRequests(&mRequest.attributeRequests) { #if MTR_ENABLE_PROVISIONAL - AddArgument("TimeoutSeconds", 0, UINT16_MAX, &mRequest.timeoutSeconds); + AddArgument("RequestType", 0, UINT8_MAX, &mRequest.requestType); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("AttributeRequests", &mComplex_AttributeRequests); +#endif // MTR_ENABLE_PROVISIONAL +#if MTR_ENABLE_PROVISIONAL + AddArgument("Timeout", 0, UINT16_MAX, &mRequest.timeout); #endif // MTR_ENABLE_PROVISIONAL ClusterCommand::AddArguments(); } @@ -107242,130 +107246,63 @@ class ThermostatStartPresetsSchedulesEditRequest : public ClusterCommand { CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Id; + constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::AtomicRequest::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 = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterStartPresetsSchedulesEditRequestParams alloc] init]; + __auto_type * params = [[MTRThermostatClusterAtomicRequestParams alloc] init]; params.timedInvokeTimeoutMs = mTimedInteractionTimeoutMs.HasValue() ? [NSNumber numberWithUnsignedShort:mTimedInteractionTimeoutMs.Value()] : nil; #if MTR_ENABLE_PROVISIONAL - params.timeoutSeconds = [NSNumber numberWithUnsignedShort:mRequest.timeoutSeconds]; + params.requestType = [NSNumber numberWithUnsignedChar:chip::to_underlying(mRequest.requestType)]; #endif // MTR_ENABLE_PROVISIONAL - uint16_t repeatCount = mRepeatCount.ValueOr(1); - uint16_t __block responsesNeeded = repeatCount; - while (repeatCount--) { - [cluster startPresetsSchedulesEditRequestWithParams: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); - } - }]; +#if MTR_ENABLE_PROVISIONAL + { // Scope for our temporary variables + auto * array_0 = [NSMutableArray new]; + for (auto & entry_0 : mRequest.attributeRequests) { + NSNumber * newElement_0; + newElement_0 = [NSNumber numberWithUnsignedInt:entry_0]; + [array_0 addObject:newElement_0]; + } + params.attributeRequests = array_0; } - return CHIP_NO_ERROR; - } - -private: - chip::app::Clusters::Thermostat::Commands::StartPresetsSchedulesEditRequest::Type mRequest; -}; - #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Command CancelPresetsSchedulesEditRequest - */ -class ThermostatCancelPresetsSchedulesEditRequest : public ClusterCommand { -public: - ThermostatCancelPresetsSchedulesEditRequest() - : ClusterCommand("cancel-presets-schedules-edit-request") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CancelPresetsSchedulesEditRequest::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 = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterCancelPresetsSchedulesEditRequestParams 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 cancelPresetsSchedulesEditRequestWithParams: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); - } - }]; + if (mRequest.timeout.HasValue()) { + params.timeout = [NSNumber numberWithUnsignedShort:mRequest.timeout.Value()]; + } else { + params.timeout = nil; } - return CHIP_NO_ERROR; - } - -private: -}; - #endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL -/* - * Command CommitPresetsSchedulesRequest - */ -class ThermostatCommitPresetsSchedulesRequest : public ClusterCommand { -public: - ThermostatCommitPresetsSchedulesRequest() - : ClusterCommand("commit-presets-schedules-request") - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::Thermostat::Commands::CommitPresetsSchedulesRequest::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 = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - __auto_type * params = [[MTRThermostatClusterCommitPresetsSchedulesRequestParams 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 commitPresetsSchedulesRequestWithParams: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); - } - }]; + [cluster atomicRequestWithParams:params completion: + ^(MTRThermostatClusterAtomicResponseParams * _Nullable values, NSError * _Nullable error) { + NSLog(@"Values: %@", values); + if (error == nil) { + constexpr chip::CommandId responseId = chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id; + RemoteDataModelLogger::LogCommandAsJSON(@(endpointId), @(clusterId), @(responseId), values); + } + responsesNeeded--; + if (error != nil) { + mError = error; + LogNSError("Error", error); + constexpr chip::CommandId responseId = chip::app::Clusters::Thermostat::Commands::AtomicResponse::Id; + RemoteDataModelLogger::LogCommandErrorAsJSON(@(endpointId), @(clusterId), @(responseId), error); + } + if (responsesNeeded == 0) { + SetCommandExitStatus(mError); + } + }]; } return CHIP_NO_ERROR; } private: + chip::app::Clusters::Thermostat::Commands::AtomicRequest::Type mRequest; + TypedComplexArgument> mComplex_AttributeRequests; }; #endif // MTR_ENABLE_PROVISIONAL @@ -112381,35 +112318,37 @@ class SubscribeAttributeThermostatACCoilTemperature : public SubscribeAttribute } }; +#if MTR_ENABLE_PROVISIONAL + /* - * Attribute ACCapacityformat + * Attribute ACCapacityFormat */ -class ReadThermostatACCapacityformat : public ReadAttribute { +class ReadThermostatACCapacityFormat : public ReadAttribute { public: - ReadThermostatACCapacityformat() - : ReadAttribute("accapacityformat") + ReadThermostatACCapacityFormat() + : ReadAttribute("accapacity-format") { } - ~ReadThermostatACCapacityformat() + ~ReadThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::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 = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributeACCapacityformatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + [cluster readAttributeACCapacityFormatWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { + NSLog(@"Thermostat.ACCapacityFormat response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { - LogNSError("Thermostat ACCapacityformat read Error", error); + LogNSError("Thermostat ACCapacityFormat read Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -112418,24 +112357,24 @@ class ReadThermostatACCapacityformat : public ReadAttribute { } }; -class WriteThermostatACCapacityformat : public WriteAttribute { +class WriteThermostatACCapacityFormat : public WriteAttribute { public: - WriteThermostatACCapacityformat() - : WriteAttribute("accapacityformat") + WriteThermostatACCapacityFormat() + : WriteAttribute("accapacity-format") { - AddArgument("attr-name", "accapacityformat"); + AddArgument("attr-name", "accapacity-format"); AddArgument("attr-value", 0, UINT8_MAX, &mValue); WriteAttribute::AddArguments(); } - ~WriteThermostatACCapacityformat() + ~WriteThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::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); @@ -112445,9 +112384,9 @@ class WriteThermostatACCapacityformat : public WriteAttribute { params.dataVersion = mDataVersion.HasValue() ? [NSNumber numberWithUnsignedInt:mDataVersion.Value()] : nil; NSNumber * _Nonnull value = [NSNumber numberWithUnsignedChar:mValue]; - [cluster writeAttributeACCapacityformatWithValue:value params:params completion:^(NSError * _Nullable error) { + [cluster writeAttributeACCapacityFormatWithValue:value params:params completion:^(NSError * _Nullable error) { if (error != nil) { - LogNSError("Thermostat ACCapacityformat write Error", error); + LogNSError("Thermostat ACCapacityFormat write Error", error); RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); } SetCommandExitStatus(error); @@ -112459,21 +112398,21 @@ class WriteThermostatACCapacityformat : public WriteAttribute { uint8_t mValue; }; -class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { +class SubscribeAttributeThermostatACCapacityFormat : public SubscribeAttribute { public: - SubscribeAttributeThermostatACCapacityformat() - : SubscribeAttribute("accapacityformat") + SubscribeAttributeThermostatACCapacityFormat() + : SubscribeAttribute("accapacity-format") { } - ~SubscribeAttributeThermostatACCapacityformat() + ~SubscribeAttributeThermostatACCapacityFormat() { } CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override { constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityformat::Id; + constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::ACCapacityFormat::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); @@ -112488,10 +112427,10 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { if (mAutoResubscribe.HasValue()) { params.resubscribeAutomatically = mAutoResubscribe.Value(); } - [cluster subscribeAttributeACCapacityformatWithParams:params + [cluster subscribeAttributeACCapacityFormatWithParams:params subscriptionEstablished:^() { mSubscriptionEstablished = YES; } reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.ACCapacityformat response %@", [value description]); + NSLog(@"Thermostat.ACCapacityFormat response %@", [value description]); if (error == nil) { RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); } else { @@ -112504,6 +112443,7 @@ class SubscribeAttributeThermostatACCapacityformat : public SubscribeAttribute { } }; +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL /* @@ -113469,14 +113409,10 @@ class WriteThermostatSchedules : public WriteAttribute { } newElement_0.transitions = array_2; } - if (entry_0.builtIn.HasValue()) { - if (entry_0.builtIn.Value().IsNull()) { - newElement_0.builtIn = nil; - } else { - newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value().Value()]; - } - } else { + if (entry_0.builtIn.IsNull()) { newElement_0.builtIn = nil; + } else { + newElement_0.builtIn = [NSNumber numberWithBool:entry_0.builtIn.Value()]; } [array_0 addObject:newElement_0]; } @@ -113546,91 +113482,6 @@ class SubscribeAttributeThermostatSchedules : public SubscribeAttribute { #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL -/* - * Attribute PresetsSchedulesEditable - */ -class ReadThermostatPresetsSchedulesEditable : public ReadAttribute { -public: - ReadThermostatPresetsSchedulesEditable() - : ReadAttribute("presets-schedules-editable") - { - } - - ~ReadThermostatPresetsSchedulesEditable() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::AttributeId attributeId = chip::app::Clusters::Thermostat::Attributes::PresetsSchedulesEditable::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 = [[MTRBaseClusterThermostat alloc] initWithDevice:device endpointID:@(endpointId) queue:callbackQueue]; - [cluster readAttributePresetsSchedulesEditableWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.PresetsSchedulesEditable response %@", [value description]); - if (error == nil) { - RemoteDataModelLogger::LogAttributeAsJSON(@(endpointId), @(clusterId), @(attributeId), value); - } else { - LogNSError("Thermostat PresetsSchedulesEditable read Error", error); - RemoteDataModelLogger::LogAttributeErrorAsJSON(@(endpointId), @(clusterId), @(attributeId), error); - } - SetCommandExitStatus(error); - }]; - return CHIP_NO_ERROR; - } -}; - -class SubscribeAttributeThermostatPresetsSchedulesEditable : public SubscribeAttribute { -public: - SubscribeAttributeThermostatPresetsSchedulesEditable() - : SubscribeAttribute("presets-schedules-editable") - { - } - - ~SubscribeAttributeThermostatPresetsSchedulesEditable() - { - } - - CHIP_ERROR SendCommand(MTRBaseDevice * device, chip::EndpointId endpointId) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::Thermostat::Id; - constexpr chip::CommandId attributeId = chip::app::Clusters::Thermostat::Attributes::PresetsSchedulesEditable::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 = [[MTRBaseClusterThermostat 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 subscribeAttributePresetsSchedulesEditableWithParams:params - subscriptionEstablished:^() { mSubscriptionEstablished = YES; } - reportHandler:^(NSNumber * _Nullable value, NSError * _Nullable error) { - NSLog(@"Thermostat.PresetsSchedulesEditable 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 SetpointHoldExpiryTimestamp */ @@ -193932,13 +193783,7 @@ void registerClusterThermostat(Commands & commands) make_unique(), // #endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // -#endif // MTR_ENABLE_PROVISIONAL -#if MTR_ENABLE_PROVISIONAL - make_unique(), // + make_unique(), // #endif // MTR_ENABLE_PROVISIONAL make_unique(Id), // make_unique(Id), // @@ -194065,9 +193910,11 @@ void registerClusterThermostat(Commands & commands) make_unique(), // make_unique(), // make_unique(), // - make_unique(), // - make_unique(), // - make_unique(), // +#if MTR_ENABLE_PROVISIONAL + make_unique(), // + make_unique(), // + make_unique(), // +#endif // MTR_ENABLE_PROVISIONAL #if MTR_ENABLE_PROVISIONAL make_unique(), // make_unique(), // @@ -194110,10 +193957,6 @@ void registerClusterThermostat(Commands & commands) 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(), //