Rohit Jadhav | 701fcb2 | 2023-07-19 14:18:26 +0530 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Copyright (c) 2023 Project CHIP Authors |
| 4 | * All rights reserved. |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | #include <app-common/zap-generated/cluster-objects.h> |
Jean-Francois Penven | 67f2ae5 | 2024-02-13 23:12:29 -0500 | [diff] [blame] | 22 | |
Rohit Jadhav | 701fcb2 | 2023-07-19 14:18:26 +0530 | [diff] [blame] | 23 | #include <protocols/interaction_model/StatusCode.h> |
| 24 | |
| 25 | namespace chip { |
| 26 | namespace app { |
| 27 | namespace Clusters { |
| 28 | namespace TemperatureControl { |
| 29 | |
| 30 | /** |
| 31 | * Interface to help manage the supported temperature levels of the Temperature Control Cluster. |
| 32 | */ |
| 33 | class SupportedTemperatureLevelsIteratorDelegate |
| 34 | { |
| 35 | public: |
| 36 | virtual ~SupportedTemperatureLevelsIteratorDelegate() = default; |
| 37 | |
| 38 | SupportedTemperatureLevelsIteratorDelegate() {} |
| 39 | |
| 40 | void Reset(EndpointId endpoint) |
| 41 | { |
| 42 | mEndpoint = endpoint; |
| 43 | mIndex = 0; |
| 44 | } |
| 45 | |
| 46 | // Returns total size of SupportedTemperatureLevels list. |
| 47 | virtual uint8_t Size() = 0; |
| 48 | |
| 49 | virtual CHIP_ERROR Next(MutableCharSpan & item) = 0; |
| 50 | |
| 51 | protected: |
| 52 | EndpointId mEndpoint; |
| 53 | uint8_t mIndex; |
| 54 | }; |
| 55 | |
| 56 | SupportedTemperatureLevelsIteratorDelegate * GetInstance(); |
| 57 | |
| 58 | void SetInstance(SupportedTemperatureLevelsIteratorDelegate * instance); |
| 59 | |
| 60 | } // namespace TemperatureControl |
| 61 | } // namespace Clusters |
| 62 | } // namespace app |
| 63 | } // namespace chip |