@@ -732,9 +732,6 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
732
732
Delegate * delegate = GetDelegate (aPath.mEndpointId );
733
733
VerifyOrReturnError (delegate != nullptr , CHIP_ERROR_INCORRECT_STATE, ChipLogError (Zcl, " Delegate is null" ));
734
734
735
- if (InAtomicWrite (aPath.mEndpointId ))
736
- {
737
- }
738
735
return aEncoder.EncodeList ([delegate](const auto & encoder) -> CHIP_ERROR {
739
736
for (uint8_t i = 0 ; true ; i++)
740
737
{
@@ -761,6 +758,22 @@ CHIP_ERROR ThermostatAttrAccess::Read(const ConcreteReadAttributePath & aPath, A
761
758
Delegate * delegate = GetDelegate (aPath.mEndpointId );
762
759
VerifyOrReturnError (delegate != nullptr , CHIP_ERROR_INCORRECT_STATE, ChipLogError (Zcl, " Delegate is null" ));
763
760
761
+ if (InAtomicWrite (aPath.mEndpointId ))
762
+ {
763
+ return aEncoder.EncodeList ([delegate](const auto & encoder) -> CHIP_ERROR {
764
+ for (uint8_t i = 0 ; true ; i++)
765
+ {
766
+ PresetStructWithOwnedMembers preset;
767
+ auto err = delegate->GetPendingPresetAtIndex (i, preset);
768
+ if (err == CHIP_ERROR_PROVIDER_LIST_EXHAUSTED)
769
+ {
770
+ return CHIP_NO_ERROR;
771
+ }
772
+ ReturnErrorOnFailure (err);
773
+ ReturnErrorOnFailure (encoder.Encode (preset));
774
+ }
775
+ });
776
+ }
764
777
return aEncoder.EncodeList ([delegate](const auto & encoder) -> CHIP_ERROR {
765
778
for (uint8_t i = 0 ; true ; i++)
766
779
{
0 commit comments