|
| 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 | +using chip::Protocols::InteractionModel::Status; |
| 22 | + |
| 23 | +namespace chip { |
| 24 | +namespace app { |
| 25 | +namespace Clusters { |
| 26 | +namespace DeviceEnergyManagement { |
| 27 | + |
| 28 | +class DeviceEnergyManagementDelegate; |
| 29 | + |
| 30 | +/** |
| 31 | + * Class to abstract manufacturer specific functionality |
| 32 | + */ |
| 33 | +class DEMManufacturerDelegate |
| 34 | +{ |
| 35 | +public: |
| 36 | + DEMManufacturerDelegate() |
| 37 | + { |
| 38 | + } |
| 39 | + |
| 40 | + virtual ~DEMManufacturerDelegate() |
| 41 | + { |
| 42 | + } |
| 43 | + |
| 44 | + virtual int64_t GetEnergyUse() = 0; |
| 45 | + |
| 46 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t power, const uint32_t duration, AdjustmentCauseEnum cause) |
| 47 | + { |
| 48 | + return CHIP_NO_ERROR; |
| 49 | + } |
| 50 | + |
| 51 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion() |
| 52 | + { |
| 53 | + return CHIP_NO_ERROR; |
| 54 | + } |
| 55 | + |
| 56 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) |
| 57 | + { |
| 58 | + return CHIP_NO_ERROR; |
| 59 | + } |
| 60 | + |
| 61 | + virtual CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTime, AdjustmentCauseEnum cause) |
| 62 | + { |
| 63 | + return CHIP_NO_ERROR; |
| 64 | + } |
| 65 | + |
| 66 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t duration, AdjustmentCauseEnum cause) |
| 67 | + { |
| 68 | + return CHIP_NO_ERROR; |
| 69 | + } |
| 70 | + |
| 71 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion() |
| 72 | + { |
| 73 | + return CHIP_NO_ERROR; |
| 74 | + } |
| 75 | + |
| 76 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) |
| 77 | + { |
| 78 | + return CHIP_NO_ERROR; |
| 79 | + } |
| 80 | + |
| 81 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelRequest() |
| 82 | + { |
| 83 | + return CHIP_NO_ERROR; |
| 84 | + } |
| 85 | + |
| 86 | + virtual CHIP_ERROR HandleModifyRequest(const uint32_t forecastID, |
| 87 | + const DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> & slotAdjustments, |
| 88 | + AdjustmentCauseEnum cause) |
| 89 | + { |
| 90 | + return CHIP_NO_ERROR; |
| 91 | + } |
| 92 | + |
| 93 | + virtual CHIP_ERROR RequestConstraintBasedForecast(const DataModel::DecodableList<DeviceEnergyManagement::Structs::ConstraintsStruct::DecodableType> & constraints, |
| 94 | + AdjustmentCauseEnum cause) |
| 95 | + { |
| 96 | + return CHIP_NO_ERROR; |
| 97 | + } |
| 98 | +}; |
| 99 | + |
| 100 | +} // namespace DeviceEnergyManagement |
| 101 | +} // namespace Clusters |
| 102 | +} // namespace app |
| 103 | +} // namespace chip |
| 104 | + |
0 commit comments