From 1f3b31e04085fe95daa9a1dc7bf7945283ee759b Mon Sep 17 00:00:00 2001 From: Faisal Bhaiyat Date: Fri, 2 Aug 2024 12:58:23 +0100 Subject: [PATCH] [Silabs] Fix silabs energy mangement app --- .../energy-management-app/silabs/BUILD.gn | 39 ++++++++++--------- .../silabs/src/AppTask.cpp | 6 +-- examples/platform/silabs/provision/BUILD.gn | 5 +++ 3 files changed, 29 insertions(+), 21 deletions(-) diff --git a/examples/energy-management-app/silabs/BUILD.gn b/examples/energy-management-app/silabs/BUILD.gn index b51ed59de6f52c..d32356994e60a4 100644 --- a/examples/energy-management-app/silabs/BUILD.gn +++ b/examples/energy-management-app/silabs/BUILD.gn @@ -101,7 +101,10 @@ if (wifi_soc) { "${examples_plat_dir}", "${chip_root}/src/lib", "${examples_common_plat_dir}", - "../energy-management-common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/common/include", + "${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/include", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/include", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/include", ] if (use_wf200) { @@ -136,23 +139,23 @@ silabs_executable("energy-management-app") { } sources = [ - "${chip_root}/examples/energy-management-app/energy-management-common/src/ChargingTargetsMemMgr.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/DEMTestEventTriggers.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/EnergyEvseEventTriggers.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseMain.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseManager.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyEvseTargetsStore.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyReportingEventTriggers.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/EnergyTimeUtils.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/FakeReadings.cpp", - "${chip_root}/examples/energy-management-app/energy-management-common/src/PowerTopologyDelegate.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/common/src/EnergyTimeUtils.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DEMTestEventTriggers.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/DeviceEnergyManagementManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/device-energy-management/src/device-energy-management-mode.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/ChargingTargetsMemMgr.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EVSEManufacturerImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseDelegateImpl.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseEventTriggers.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseMain.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseManager.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/EnergyEvseTargetsStore.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-evse/src/energy-evse-mode.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/ElectricalPowerMeasurementDelegate.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/EnergyReportingEventTriggers.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/FakeReadings.cpp", + "${chip_root}/examples/energy-management-app/energy-management-common/energy-reporting/src/PowerTopologyDelegate.cpp", "${examples_common_plat_dir}/main.cpp", "src/AppTask.cpp", ] diff --git a/examples/energy-management-app/silabs/src/AppTask.cpp b/examples/energy-management-app/silabs/src/AppTask.cpp index 8b8aa7cb9e61e6..8d3454e8c46218 100644 --- a/examples/energy-management-app/silabs/src/AppTask.cpp +++ b/examples/energy-management-app/silabs/src/AppTask.cpp @@ -43,7 +43,7 @@ #include -#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED +#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED #include #include #include @@ -73,7 +73,7 @@ using namespace ::chip::DeviceLayer::Silabs; using namespace ::chip::DeviceLayer::Internal; using namespace chip::TLV; -#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED +#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED static EnergyEvseTestEventTriggerHandler sEnergyEvseTestEventTriggerHandler; static EnergyReportingTestEventTriggerHandler sEnergyReportingTestEventTriggerHandler; static DeviceEnergyManagementTestEventTriggerHandler sDeviceEnergyManagementTestEventTriggerHandler; @@ -133,7 +133,7 @@ CHIP_ERROR AppTask::Init() ApplicationInit(); -#if SL_MATTER_TEST_EVENT_TRIGGER_ENABLED +#ifdef SL_MATTER_TEST_EVENT_TRIGGER_ENABLED if (Server::GetInstance().GetTestEventTriggerDelegate() != nullptr) { Server::GetInstance().GetTestEventTriggerDelegate()->AddHandler(&sEnergyEvseTestEventTriggerHandler); diff --git a/examples/platform/silabs/provision/BUILD.gn b/examples/platform/silabs/provision/BUILD.gn index ccd5b919bc0379..e0c311416e8587 100644 --- a/examples/platform/silabs/provision/BUILD.gn +++ b/examples/platform/silabs/provision/BUILD.gn @@ -47,6 +47,11 @@ source_set("storage") { } deps = [ "${chip_root}/src/lib" ] + public_deps = [ "${chip_root}/src/platform/silabs/provision:provision-headers" ] + + public_configs = [ + "${chip_root}/examples/platform/silabs/efr32:test-event-trigger-config", + ] }