|
| 1 | +/* |
| 2 | + * |
| 3 | + * Copyright (c) 2024 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> |
| 22 | +#include <lib/core/DataModelTypes.h> |
| 23 | + |
| 24 | +namespace chip { |
| 25 | +namespace app { |
| 26 | +namespace Clusters { |
| 27 | +namespace DeviceEnergyManagement { |
| 28 | + |
| 29 | +/** |
| 30 | + * Class to abstract manufacturer specific functionality |
| 31 | + */ |
| 32 | +class DEMManufacturerDelegate |
| 33 | +{ |
| 34 | +public: |
| 35 | + DEMManufacturerDelegate() {} |
| 36 | + |
| 37 | + virtual ~DEMManufacturerDelegate() {} |
| 38 | + |
| 39 | + // The PowerAdjustEnd event needs to report the approximate energy used by the ESA during the session. |
| 40 | + virtual int64_t GetApproxEnergyDuringSession() = 0; |
| 41 | + |
| 42 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, |
| 43 | + AdjustmentCauseEnum cause) |
| 44 | + { |
| 45 | + return CHIP_NO_ERROR; |
| 46 | + } |
| 47 | + |
| 48 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion() { return CHIP_NO_ERROR; } |
| 49 | + |
| 50 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause) { return CHIP_NO_ERROR; } |
| 51 | + |
| 52 | + virtual CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, |
| 53 | + AdjustmentCauseEnum cause) |
| 54 | + { |
| 55 | + return CHIP_NO_ERROR; |
| 56 | + } |
| 57 | + |
| 58 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) |
| 59 | + { |
| 60 | + return CHIP_NO_ERROR; |
| 61 | + } |
| 62 | + |
| 63 | + virtual CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion() { return CHIP_NO_ERROR; } |
| 64 | + |
| 65 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause) { return CHIP_NO_ERROR; } |
| 66 | + |
| 67 | + virtual CHIP_ERROR HandleDeviceEnergyManagementCancelRequest() { return CHIP_NO_ERROR; } |
| 68 | + |
| 69 | + virtual CHIP_ERROR |
| 70 | + HandleModifyForecastRequest(const uint32_t forecastID, |
| 71 | + const DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> & slotAdjustments, |
| 72 | + AdjustmentCauseEnum cause) |
| 73 | + { |
| 74 | + return CHIP_NO_ERROR; |
| 75 | + } |
| 76 | + |
| 77 | + virtual CHIP_ERROR RequestConstraintBasedForecast( |
| 78 | + const DataModel::DecodableList<DeviceEnergyManagement::Structs::ConstraintsStruct::DecodableType> & constraints, |
| 79 | + AdjustmentCauseEnum cause) |
| 80 | + { |
| 81 | + return CHIP_NO_ERROR; |
| 82 | + } |
| 83 | +}; |
| 84 | + |
| 85 | +} // namespace DeviceEnergyManagement |
| 86 | +} // namespace Clusters |
| 87 | +} // namespace app |
| 88 | +} // namespace chip |
0 commit comments