/src/connectedhomeip/examples/all-clusters-app/all-clusters-common/include/laundry-washer-controls-delegate-impl.h
Line | Count | Source |
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/clusters/laundry-washer-controls-server/laundry-washer-controls-delegate.h> |
22 | | #include <app/clusters/laundry-washer-controls-server/laundry-washer-controls-server.h> |
23 | | #include <app/util/config.h> |
24 | | #include <cstring> |
25 | | |
26 | | namespace chip { |
27 | | namespace app { |
28 | | namespace Clusters { |
29 | | namespace LaundryWasherControls { |
30 | | |
31 | | /** |
32 | | * The application delegate to statically define the options. |
33 | | */ |
34 | | |
35 | | class LaundryWasherControlDelegate : public Delegate |
36 | | { |
37 | | static const CharSpan spinSpeedsNameOptions[]; |
38 | | static const NumberOfRinsesEnum supportRinsesOptions[]; |
39 | | static LaundryWasherControlDelegate instance; |
40 | | |
41 | | public: |
42 | | CHIP_ERROR GetSpinSpeedAtIndex(size_t index, MutableCharSpan & spinSpeed); |
43 | | CHIP_ERROR GetSupportedRinseAtIndex(size_t index, NumberOfRinsesEnum & supportedRinse); |
44 | | |
45 | | LaundryWasherControlDelegate() = default; |
46 | | ~LaundryWasherControlDelegate() = default; |
47 | | |
48 | 1 | static inline LaundryWasherControlDelegate & getLaundryWasherControlDelegate() { return instance; } |
49 | | }; |
50 | | |
51 | | } // namespace LaundryWasherControls |
52 | | } // namespace Clusters |
53 | | } // namespace app |
54 | | } // namespace chip |