Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add device-energy-management cluster example app code for 1.4 #33910

Merged
merged 83 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
90ac94b
Get the EVSE app building and test TC_DEM_2_2 passing
PeterC1965 Jun 13, 2024
c683503
Get all targets building
PeterC1965 Jun 13, 2024
0ac11b7
Address JamesH review comments
PeterC1965 Jun 15, 2024
3cb089f
Rename utils.cpp to DEMUtils.cpp
PeterC1965 Jun 15, 2024
6688c42
Address JamesH review comments
PeterC1965 Jun 15, 2024
f0858e1
Restyled by whitespace
restyled-commits Jun 15, 2024
757bc1c
Restyled by clang-format
restyled-commits Jun 15, 2024
eccee31
Restyled by gn
restyled-commits Jun 15, 2024
d176136
Restyled by prettier-markdown
restyled-commits Jun 15, 2024
86d7929
Restyled by autopep8
restyled-commits Jun 15, 2024
e9c2f5f
Restyled by isort
restyled-commits Jun 15, 2024
78742f6
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jun 15, 2024
a45e6dd
Fix compilation problem by including lib/core/DataModelTypes.h
PeterC1965 Jun 15, 2024
fe103a9
Fix compilation problem by including
PeterC1965 Jun 15, 2024
a6f0b6d
Save examples/all-clusters-app/all-clusters-common/all-clusters-app.z…
PeterC1965 Jun 15, 2024
9cef023
Restyled by clang-format
restyled-commits Jun 15, 2024
2cbe9c6
Apply further code review changes
PeterC1965 Jun 19, 2024
46e8f0c
Restyled by clang-format
restyled-commits Jun 19, 2024
78e6951
Restyled by gn
restyled-commits Jun 19, 2024
73a6430
Address code review comments from AndreiL
PeterC1965 Jun 20, 2024
cfc815e
Restyled by whitespace
restyled-commits Jun 20, 2024
b2c1616
Restyled by clang-format
restyled-commits Jun 20, 2024
61cca47
Fix ESP build
PeterC1965 Jun 20, 2024
55d778e
Fix ESP build
PeterC1965 Jun 20, 2024
6c65ac4
Restyled by clang-format
restyled-commits Jun 20, 2024
c55ca01
Rename src/python_testing/TC_DEM_Utils.py src/python_testing/DEMTestB…
PeterC1965 Jun 25, 2024
d469ba0
Put time util funtions into namespace + drop the Utils prefix
PeterC1965 Jun 25, 2024
a89767f
Restyled by whitespace
restyled-commits Jun 25, 2024
2038023
Restyled by isort
restyled-commits Jun 25, 2024
4417749
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jun 25, 2024
6a76ba9
Try to address setForecast comments from Boris
PeterC1965 Jul 3, 2024
5ebaf22
Remove unnecessary SetXXX methods from the device energy management c…
PeterC1965 Jul 3, 2024
5e90f9f
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 3, 2024
afcc61f
Restyled by clang-format
restyled-commits Jul 3, 2024
78633e0
Apply code review changes suggested by Louis-Philip Beliveau
PeterC1965 Jul 13, 2024
85bae27
Document the API for GetForecast and GetPowerAdjustmentCapability
PeterC1965 Jul 15, 2024
3ed6f14
Document the GetForecast and GetPowerAdjustmentCapability APIs
PeterC1965 Jul 15, 2024
5fee7b9
Update src/app/clusters/device-energy-management-server/device-energy…
PeterC1965 Jul 18, 2024
7194f5b
Update src/app/clusters/device-energy-management-server/device-energy…
PeterC1965 Jul 18, 2024
d93a68e
Address review comments from Boris
PeterC1965 Jul 18, 2024
a1d146c
Sync up with code review comments from PR34234
PeterC1965 Jul 18, 2024
441d586
Sync up with code review comments from PR34234 that caused some retur…
PeterC1965 Jul 18, 2024
e2fff77
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 18, 2024
c984a59
Restyled by clang-format
restyled-commits Jul 18, 2024
b52bc59
modifyForecastRequest: Failure should be returned if a slot number > …
PeterC1965 Jul 18, 2024
0c48248
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
5f9896e
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
178b5a6
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
d2369fe
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
27fef24
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
2ed990b
Update examples/energy-management-app/energy-management-common/src/DE…
PeterC1965 Jul 18, 2024
412b2e4
Update examples/energy-management-app/energy-management-common/includ…
PeterC1965 Jul 18, 2024
cb04ca1
Update examples/energy-management-app/energy-management-common/src/DE…
PeterC1965 Jul 18, 2024
1db507a
Update examples/energy-management-app/energy-management-common/src/DE…
PeterC1965 Jul 18, 2024
083f324
Address review comments from Boris
PeterC1965 Jul 18, 2024
979353f
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 18, 2024
3e56098
Address further review comments from Boris
PeterC1965 Jul 18, 2024
df78a95
Address further review comments from Boris
PeterC1965 Jul 18, 2024
be69ceb
Address further review comments from Boris
PeterC1965 Jul 18, 2024
3c57718
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 18, 2024
b8d55ce
Address further review comments from Boris
PeterC1965 Jul 18, 2024
38a065e
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 18, 2024
8ad9905
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 18, 2024
7a9ded1
Update examples/energy-management-app/energy-management-common/src/DE…
PeterC1965 Jul 18, 2024
2001980
Update examples/energy-management-app/energy-management-common/src/En…
PeterC1965 Jul 18, 2024
940f102
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 18, 2024
2cdc894
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 18, 2024
1c5e33d
Apply further review comments from Boris
PeterC1965 Jul 20, 2024
14beb82
Used a bitmap rather than uint8_t and sync EnergyTimeUtils files from…
PeterC1965 Jul 20, 2024
fa59eb6
Update following review comments from Boris
PeterC1965 Jul 20, 2024
932c0c3
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 22, 2024
48014ef
Allow more time for forecast.startTime in test setup as tests can tak…
PeterC1965 Jul 23, 2024
6fcc1e7
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 24, 2024
207f907
Update examples/energy-management-app/energy-management-common/src/En…
PeterC1965 Jul 24, 2024
0b1392f
Update examples/energy-management-app/energy-management-common/src/De…
PeterC1965 Jul 24, 2024
9bbcc88
Addressing further review comments from Boris
PeterC1965 Jul 24, 2024
07a172f
Fix small issue found as a result of the DEM test script review
PeterC1965 Jul 24, 2024
242b27f
Protect against forecast being null
PeterC1965 Jul 24, 2024
5d4c2b1
Remove src/python_testing/DEMTestBase.py as renamed in PR34234
PeterC1965 Jul 25, 2024
a955ceb
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 25, 2024
d924fa9
Update following review comment from Andrei
PeterC1965 Jul 25, 2024
07ed1fa
Restyled by clang-format
restyled-commits Jul 25, 2024
eecd532
Merge branch 'master' into add-dem-example-code-for-1-4
PeterC1965 Jul 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,11 @@ list(

${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
${chip_dir}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp
${chip_dir}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp

${chip_dir}/examples/platform/ameba/route_hook/ameba_route_hook.c
${chip_dir}/examples/platform/ameba/route_hook/ameba_route_table.c
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/asr/BUILD.gn
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ asr_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${examples_plat_dir}/ButtonHandler.cpp",
"${examples_plat_dir}/CHIPDeviceManager.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/cc13x4_26x4/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ ti_simplelink_executable("all-clusters-app") {
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/examples/providers/DeviceInfoProviderImpl.cpp",
"${project_dir}/main/AppTask.cpp",
"${project_dir}/main/ClusterManager.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,11 @@ psoc6_executable("clusters_app") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"${examples_plat_dir}/LEDWidget.cpp",
"${examples_plat_dir}/init_psoc6Platform.cpp",
"src/AppTask.cpp",
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/linux/diagnostic-logs-provider-delegate-impl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/device-energy-management-mode.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/energy-evse-mode.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
"AllClustersCommandDelegate.cpp",
"AppOptions.cpp",
"ValveControlDelegate.cpp",
Expand Down
3 changes: 2 additions & 1 deletion examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ target_sources(${APP_TARGET} PRIVATE
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp

${ENERGY_MANAGEMENT_COMMON}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/utils.cpp
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
)

chip_configure_data_model(${APP_TARGET}
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ target_sources(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/utils.cpp
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
${ENERGY_MANAGEMENT_COMMON_DIR}/src/ElectricalPowerMeasurementDelegate.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,11 @@ mw320_executable("shell_mw320") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/src/lib/shell/streamer_mw320.cpp",
"binding-handler.cpp",
"include/CHIPProjectConfig.h",
Expand Down
4 changes: 3 additions & 1 deletion examples/all-clusters-app/openiotsdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ target_sources(${APP_TARGET}
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON}/src/utils.cpp
)

target_link_libraries(${APP_TARGET}
Expand Down
4 changes: 3 additions & 1 deletion examples/all-clusters-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ target_sources(app PRIVATE
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EnergyEvseManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementDelegateImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/DeviceEnergyManagementManager.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/EVSEManufacturerImpl.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/src/utils.cpp
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
${TELINK_COMMON}/common/src/mainCommon.cpp
${TELINK_COMMON}/common/src/AppTaskCommon.cpp
${TELINK_COMMON}/util/src/LEDManager.cpp
Expand Down
2 changes: 2 additions & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DeviceEnergyManagementManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EVSEManufacturerImpl.cpp",
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
"${chip_root}/examples/energy-management-app/energy-management-common/src/ElectricalPowerMeasurementDelegate.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseDelegateImpl.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp",
"${chip_root}/examples/energy-management-app/energy-management-common/src/DEMUtils.cpp",
]

deps = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/*
*
* Copyright (c) 2023 Project CHIP Authors
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved
* All rights reserved.
*
* 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.
*/

#pragma once

using chip::Protocols::InteractionModel::Status;
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved

namespace chip {
namespace app {
namespace Clusters {
namespace DeviceEnergyManagement {

class DeviceEnergyManagementDelegate;
lpbeliveau-silabs marked this conversation as resolved.
Show resolved Hide resolved

/**
* Class to abstract manufacturer specific functionality
*/
class DEMManufacturerDelegate
{
public:
DEMManufacturerDelegate()
{
}

virtual ~DEMManufacturerDelegate()
{
}

virtual int64_t GetEnergyUse() = 0;
PeterC1965 marked this conversation as resolved.
Show resolved Hide resolved

virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustRequest(const int64_t power, const uint32_t duration, AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPowerAdjustCompletion()
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPowerAdjustRequest(CauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementStartTimeAdjustRequest(const uint32_t requestedStartTime, AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPauseRequest(const uint32_t duration, AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementPauseCompletion()
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelPauseRequest(CauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleDeviceEnergyManagementCancelRequest()
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR HandleModifyRequest(const uint32_t forecastID,
const DataModel::DecodableList<Structs::SlotAdjustmentStruct::DecodableType> & slotAdjustments,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}

virtual CHIP_ERROR RequestConstraintBasedForecast(const DataModel::DecodableList<DeviceEnergyManagement::Structs::ConstraintsStruct::DecodableType> & constraints,
AdjustmentCauseEnum cause)
{
return CHIP_NO_ERROR;
}
};

} // namespace DeviceEnergyManagement
} // namespace Clusters
} // namespace app
} // namespace chip

Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
*
* Copyright (c) 2024 Project CHIP Authors
* All rights reserved.
*
* 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.
*/

#pragma once

#include <protocols/interaction_model/StatusCode.h>
#include <protocols/Protocols.h>
#include <app/util/config.h>
#include <cstring>

using chip::Protocols::InteractionModel::Status;

/**
* @brief Helper function to get current timestamp in Epoch format
*
* @param chipEpoch reference to hold return timestamp
*/
CHIP_ERROR UtilsGetEpochTS(uint32_t & chipEpoch);

/**
* @brief Helper function to get current timestamp and work out the day of week
*
* NOTE that the time_t is converted using localtime to provide the timestamp
* in local time. If this is not supported on some platforms an alternative
* implementation may be required.
*
* @param unixEpoch (as time_t)
*
* @return bitmap value for day of week
* Sunday = 0x01, Monday = 0x01 ... Saturday = 0x40 (1<<6)
*/
uint8_t UtilsGetDayOfWeekUnixEpoch(time_t unixEpoch);

/**
* @brief Helper function to get current timestamp and work out the day of week based on localtime
*
* @param reference to hold the day of week as a bitmap
*
* Sunday = 0x01, Monday = 0x01 ... Saturday = 0x40 (1<<6)
*/
CHIP_ERROR UtilsGetDayOfWeekNow(uint8_t & dayOfWeekMap);
Loading
Loading