@@ -59,16 +59,16 @@ void SetDefaultDelegate(EndpointId endpoint, Delegate * delegate)
59
59
* @return true If the preset is valid i.e the PresetHandle if not null fits within size constraints and the presetScenario enum
60
60
* value is valid. Otherwise, return false.
61
61
*/
62
- bool IsValidPresetEntry (ApplePresetInternalStruct & preset)
62
+ bool IsValidPresetEntry (ApplePresetStruct::Type & preset)
63
63
{
64
64
// If the presetHandle is not null, the size of the handle should not exceed 16 bytes.
65
- if (!preset.GetPresetHandleData () .IsNull () && preset.GetPresetHandleData () .Value ().size () > kAppleActivePresetHandleSize )
65
+ if (!preset.presetHandle .IsNull () && preset.presetHandle .Value ().size () > kAppleActivePresetHandleSize )
66
66
{
67
67
return false ;
68
68
}
69
69
70
70
// Return true if the preset scenario is valid, false otherwise.
71
- return (preset.GetPresetScenario () != ApplePresetScenarioEnum::kUnknownEnumValue );
71
+ return (preset.presetScenario != ApplePresetScenarioEnum::kUnknownEnumValue );
72
72
}
73
73
74
74
void AppleThermostatExtAttrAccess::SetThermostatAttrAccess (ThermostatAttrAccess * thermostatAttrAccessPtr)
@@ -249,7 +249,7 @@ CHIP_ERROR AppleThermostatExtAttrAccess::Write(const ConcreteDataAttributePath &
249
249
auto iter = newPresets.begin ();
250
250
while (iter.Next ())
251
251
{
252
- ApplePresetInternalStruct preset = ApplePresetInternalStruct ( iter.GetValue () );
252
+ ApplePresetStruct::Type preset = iter.GetValue ();
253
253
if (IsValidPresetEntry (preset))
254
254
{
255
255
ReturnErrorOnFailure (delegate->AppendToPendingPresetList (preset));
@@ -266,7 +266,7 @@ CHIP_ERROR AppleThermostatExtAttrAccess::Write(const ConcreteDataAttributePath &
266
266
// If the list operation is AppendItem, call the delegate to append to the list of pending presets.
267
267
if (aPath.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem)
268
268
{
269
- ApplePresetInternalStruct preset;
269
+ ApplePresetStruct::Type preset;
270
270
ReturnErrorOnFailure (aDecoder.Decode (preset));
271
271
if (IsValidPresetEntry (preset))
272
272
{
@@ -437,9 +437,9 @@ void ExtendTimer(EndpointId endpoint, uint16_t timeoutSeconds)
437
437
*
438
438
* @return true If the preset is built-in, false otherwise.
439
439
*/
440
- bool IsBuiltIn (const ApplePresetInternalStruct preset)
440
+ bool IsBuiltIn (ApplePresetInternalStruct preset)
441
441
{
442
- return preset.builtIn .ValueOr (false );
442
+ return preset.GetBuiltIn () .ValueOr (false );
443
443
}
444
444
445
445
/* *
@@ -854,7 +854,7 @@ bool emberAfThermostatClusterAppleCommitPresetsSchedulesRequestCallback(
854
854
855
855
// #8. Find the number of presets in the pending preset list that match the preset handle. If there are more than 2
856
856
// entries, return CONSTRAINT_ERROR.
857
- uint8_t count = delegate->CountPresetInPendingListWithPresetHandle (pendingPreset.presetHandle .Value ());
857
+ uint8_t count = delegate->CountPresetInPendingListWithPresetHandle (pendingPreset.GetPresetHandleData () .Value ());
858
858
if (count >= 2 )
859
859
{
860
860
return sendResponseAndCleanUp (delegate, endpoint, commandObj, commandPath, Status::ConstraintError);
0 commit comments