| /* |
| * |
| * Copyright (c) 2022 Project CHIP Authors |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| // THIS FILE IS GENERATED BY ZAP |
| // This file is generated from clusters-Commands.h.zapt |
| |
| #pragma once |
| |
| #include <app/data-model/DecodableList.h> |
| #include <app/data-model/Encode.h> |
| #include <app/data-model/List.h> |
| #include <app/data-model/NullObject.h> |
| #include <app/data-model/Nullable.h> |
| #include <lib/core/DataModelTypes.h> |
| #include <lib/core/Optional.h> |
| #include <lib/core/TLV.h> |
| #include <lib/support/BitMask.h> |
| |
| #include <clusters/shared/Enums.h> |
| #include <clusters/shared/Structs.h> |
| |
| #include <clusters/DeviceEnergyManagement/ClusterId.h> |
| #include <clusters/DeviceEnergyManagement/CommandIds.h> |
| #include <clusters/DeviceEnergyManagement/Enums.h> |
| #include <clusters/DeviceEnergyManagement/Structs.h> |
| |
| #include <cstdint> |
| |
| namespace chip { |
| namespace app { |
| namespace Clusters { |
| namespace DeviceEnergyManagement { |
| namespace Commands { |
| // Forward-declarations so we can reference these later. |
| |
| namespace PowerAdjustRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace PowerAdjustRequest |
| |
| namespace CancelPowerAdjustRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace CancelPowerAdjustRequest |
| |
| namespace StartTimeAdjustRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace StartTimeAdjustRequest |
| |
| namespace PauseRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace PauseRequest |
| |
| namespace ResumeRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace ResumeRequest |
| |
| namespace ModifyForecastRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace ModifyForecastRequest |
| |
| namespace RequestConstraintBasedForecast { |
| struct Type; |
| struct DecodableType; |
| } // namespace RequestConstraintBasedForecast |
| |
| namespace CancelRequest { |
| struct Type; |
| struct DecodableType; |
| } // namespace CancelRequest |
| |
| } // namespace Commands |
| |
| namespace Commands { |
| namespace PowerAdjustRequest { |
| enum class Fields : uint8_t |
| { |
| kPower = 0, |
| kDuration = 1, |
| kCause = 2, |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::PowerAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| int64_t power = static_cast<int64_t>(0); |
| uint32_t duration = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::PowerAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| int64_t power = static_cast<int64_t>(0); |
| uint32_t duration = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace PowerAdjustRequest |
| namespace CancelPowerAdjustRequest { |
| enum class Fields : uint8_t |
| { |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::CancelPowerAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::CancelPowerAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace CancelPowerAdjustRequest |
| namespace StartTimeAdjustRequest { |
| enum class Fields : uint8_t |
| { |
| kRequestedStartTime = 0, |
| kCause = 1, |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::StartTimeAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| uint32_t requestedStartTime = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::StartTimeAdjustRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| uint32_t requestedStartTime = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace StartTimeAdjustRequest |
| namespace PauseRequest { |
| enum class Fields : uint8_t |
| { |
| kDuration = 0, |
| kCause = 1, |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::PauseRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| uint32_t duration = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::PauseRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| uint32_t duration = static_cast<uint32_t>(0); |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace PauseRequest |
| namespace ResumeRequest { |
| enum class Fields : uint8_t |
| { |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::ResumeRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::ResumeRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace ResumeRequest |
| namespace ModifyForecastRequest { |
| enum class Fields : uint8_t |
| { |
| kForecastID = 0, |
| kSlotAdjustments = 1, |
| kCause = 2, |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::ModifyForecastRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| uint32_t forecastID = static_cast<uint32_t>(0); |
| DataModel::List<const Structs::SlotAdjustmentStruct::Type> slotAdjustments; |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::ModifyForecastRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| uint32_t forecastID = static_cast<uint32_t>(0); |
| DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> slotAdjustments; |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace ModifyForecastRequest |
| namespace RequestConstraintBasedForecast { |
| enum class Fields : uint8_t |
| { |
| kConstraints = 0, |
| kCause = 1, |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::RequestConstraintBasedForecast::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| DataModel::List<const Structs::ConstraintsStruct::Type> constraints; |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::RequestConstraintBasedForecast::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| DataModel::DecodableList<Structs::ConstraintsStruct::DecodableType> constraints; |
| AdjustmentCauseEnum cause = static_cast<AdjustmentCauseEnum>(0); |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace RequestConstraintBasedForecast |
| namespace CancelRequest { |
| enum class Fields : uint8_t |
| { |
| }; |
| |
| struct Type |
| { |
| public: |
| // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand |
| static constexpr CommandId GetCommandId() { return Commands::CancelRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| |
| CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; |
| |
| using ResponseType = DataModel::NullObjectType; |
| |
| static constexpr bool MustUseTimedInvoke() { return false; } |
| }; |
| |
| struct DecodableType |
| { |
| public: |
| static constexpr CommandId GetCommandId() { return Commands::CancelRequest::Id; } |
| static constexpr ClusterId GetClusterId() { return Clusters::DeviceEnergyManagement::Id; } |
| static constexpr bool kIsFabricScoped = false; |
| |
| CHIP_ERROR Decode(TLV::TLVReader & reader); |
| }; |
| }; // namespace CancelRequest |
| } // namespace Commands |
| } // namespace DeviceEnergyManagement |
| } // namespace Clusters |
| } // namespace app |
| } // namespace chip |