Skip to content

Commit 78633e0

Browse files
committed
Apply code review changes suggested by Louis-Philip Beliveau
1 parent afcc61f commit 78633e0

File tree

4 files changed

+14
-17
lines changed

4 files changed

+14
-17
lines changed

examples/energy-management-app/energy-management-common/include/DEMManufacturerDelegate.h

-5
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@
2020

2121
#include <app-common/zap-generated/cluster-objects.h>
2222
#include <lib/core/DataModelTypes.h>
23-
#include <protocols/interaction_model/StatusCode.h>
24-
25-
using chip::Protocols::InteractionModel::Status;
2623

2724
namespace chip {
2825
namespace app {
2926
namespace Clusters {
3027
namespace DeviceEnergyManagement {
3128

32-
class DeviceEnergyManagementDelegate;
33-
3429
/**
3530
* Class to abstract manufacturer specific functionality
3631
*/

examples/energy-management-app/energy-management-common/include/DeviceEnergyManagementDelegateImpl.h

+8-9
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <app/clusters/device-energy-management-server/device-energy-management-server.h>
2222
#include <app/util/config.h>
2323

24-
using chip::Protocols::InteractionModel::Status;
2524
namespace chip {
2625
namespace app {
2726
namespace Clusters {
@@ -55,15 +54,15 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
5554
* @param duration The duration that the ESA SHALL maintain the requested power for.
5655
* @return Success if the adjustment is accepted; otherwise the command SHALL be rejected with appropriate error.
5756
*/
58-
virtual Status PowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, AdjustmentCauseEnum cause) override;
57+
virtual chip::Protocols::InteractionModel::Status PowerAdjustRequest(const int64_t powerMw, const uint32_t durationS, AdjustmentCauseEnum cause) override;
5958

6059
/**
6160
* @brief Make the ESA end the active power adjustment session & return to normal (or idle) power levels.
6261
* The ESA SHALL also generate an PowerAdjustEnd Event and the ESAState SHALL be restored to Online.
6362
*
6463
* @return It should report SUCCESS if successful and FAILURE otherwise.
6564
*/
66-
virtual Status CancelPowerAdjustRequest() override;
65+
virtual chip::Protocols::InteractionModel::Status CancelPowerAdjustRequest() override;
6766

6867
/**
6968
* @brief The ESA SHALL update its Forecast attribute with the RequestedStartTime including a new ForecastID.
@@ -81,7 +80,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
8180
* @return Success if the StartTime in the Forecast is updated, otherwise the command SHALL be rejected with appropriate
8281
* IM_Status.
8382
*/
84-
virtual Status StartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, AdjustmentCauseEnum cause) override;
83+
virtual chip::Protocols::InteractionModel::Status StartTimeAdjustRequest(const uint32_t requestedStartTimeUtc, AdjustmentCauseEnum cause) override;
8584

8685
/**
8786
* @brief Handler for PauseRequest command
@@ -96,7 +95,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
9695
* @param duration Duration that the ESA SHALL be paused for.
9796
* @return Success if the ESA is paused, otherwise returns other IM_Status.
9897
*/
99-
virtual Status PauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) override;
98+
virtual chip::Protocols::InteractionModel::Status PauseRequest(const uint32_t durationS, AdjustmentCauseEnum cause) override;
10099

101100
/**
102101
* @brief Handler for ResumeRequest command
@@ -107,7 +106,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
107106
*
108107
* @return Success if the ESA is resumed, otherwise returns other IM_Status.
109108
*/
110-
virtual Status ResumeRequest() override;
109+
virtual chip::Protocols::InteractionModel::Status ResumeRequest() override;
111110

112111
/**
113112
* @brief Handler for ModifyForecastRequest
@@ -125,7 +124,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
125124
* @return Success if the entire list of SlotAdjustmentStruct are accepted, otherwise the command
126125
* SHALL be rejected returning other IM_Status.
127126
*/
128-
virtual Status
127+
virtual chip::Protocols::InteractionModel::Status
129128
ModifyForecastRequest(const uint32_t forecastID,
130129
const DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> & slotAdjustments,
131130
AdjustmentCauseEnum cause) override;
@@ -141,7 +140,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
141140
* @param constraints Sequence of turn up/down power requests that the ESA is being asked to constrain its operation within.
142141
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
143142
*/
144-
virtual Status
143+
virtual chip::Protocols::InteractionModel::Status
145144
RequestConstraintBasedForecast(const DataModel::DecodableList<Structs::ConstraintsStruct::DecodableType> & constraints,
146145
AdjustmentCauseEnum cause) override;
147146

@@ -162,7 +161,7 @@ class DeviceEnergyManagementDelegate : public DeviceEnergyManagement::Delegate
162161
*
163162
* @return Success if successful, otherwise the command SHALL be rejected returning other IM_Status.
164163
*/
165-
virtual Status CancelRequest() override;
164+
virtual chip::Protocols::InteractionModel::Status CancelRequest() override;
166165

167166
// ------------------------------------------------------------------
168167
// Overridden DeviceEnergyManagement::Delegate Get attribute methods

examples/energy-management-app/energy-management-common/include/EnergyTimeUtils.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@
2020

2121
#include <app/util/config.h>
2222
#include <cstring>
23+
#include <lib/core/CHIPError.h>
2324
#include <protocols/Protocols.h>
24-
#include <protocols/interaction_model/StatusCode.h>
25-
26-
using chip::Protocols::InteractionModel::Status;
25+
#include <time.h>
2726

2827
namespace chip {
2928
namespace app {

examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,17 @@
2020
#include "DEMManufacturerDelegate.h"
2121
#include "EnergyTimeUtils.h"
2222
#include <app/EventLogging.h>
23+
#include <protocols/interaction_model/StatusCode.h>
2324

2425
using namespace chip;
2526
using namespace chip::app;
2627
using namespace chip::app::Clusters;
2728
using namespace chip::app::Clusters::DeviceEnergyManagement;
2829
using namespace chip::app::Clusters::DeviceEnergyManagement::Attributes;
2930

31+
using chip::Protocols::InteractionModel::Status;
32+
33+
3034
using chip::Optional;
3135
using CostsList = DataModel::List<const Structs::CostStruct::Type>;
3236

0 commit comments

Comments
 (0)