-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Refactoring of Energy Management App #35616
base: master
Are you sure you want to change the base?
Refactoring of Energy Management App #35616
Conversation
…EPM out of EVSE and into bespoke files.
Review changes with SemanticDiff. |
PR #35616: Size comparison from 514e810 to 80a9f1c Full report (47 builds for bl602, bl702, bl702l, cyw30739, efr32, nrfconnect, nxp, psoc6, qpg, stm32, tizen)
|
PR #35616: Size comparison from 514e810 to b1f742b Full report (66 builds for bl602, bl702, bl702l, cyw30739, efr32, esp32, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35616: Size comparison from 514e810 to f60fd7d Increases above 0.2%:
Full report (45 builds for bl602, bl702, bl702l, cyw30739, esp32, nrfconnect, nxp, psoc6, qpg, stm32, tizen)
|
|
||
chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate * GetDEMDelegate(); | ||
// TODO investigate this why isn't in in DEM? | ||
extern std::unique_ptr<chip::app::Clusters::DeviceEnergyManagementManager> gDEMInstance; | ||
extern std::unique_ptr<chip::app::Clusters::DeviceEnergyManagement::DeviceEnergyManagementDelegate> gDEMDelegate; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A general comment - can global variables be avoided? There is an accessor function GetDEMDelegate for the DEM delegate singleton but no accessor functions for the DEM instance.
Also not sure why gDEMDelegate is being exposed when there is a function to access it?
|
||
// Electrical Energy Measurement cluster uses ember to initialise | ||
extern std::unique_ptr<chip::app::Clusters::ElectricalEnergyMeasurement::ElectricalEnergyMeasurementAttrAccess> gEEMAttrAccess; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about global variables. Can they be replaced with accessor functions?
WhmManufacturer(WaterHeaterManagementInstance * whmInstance) { mWhmInstance = whmInstance; } | ||
WhmManufacturer(WaterHeaterManagementInstance * whmInstance, | ||
ElectricalPowerMeasurement::ElectricalPowerMeasurementInstance * aEPMInstance, | ||
PowerTopology::PowerTopologyInstance * aPTInstance, DeviceEnergyManagementManager * aDEMInstance) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the parameters be passed in by-reference instead of pointers? This would avoid having to check thereafter that the pointers are not null.
…pology-stub.cpp in place of PowerTopologyDelegate which does similar things in example-energy-management-app in all-clusters-app.
PR #35616: Size comparison from 7fd3d59 to 1ce153a Full report (86 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35616: Size comparison from 7fd3d59 to e54c613 Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #35616: Size comparison from ac9537d to 54ff768 Full report (76 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink)
|
Has there been any progress on this request? INFO In file included from ../../examples/all-clusters-app/linux/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/src/WhmManufacturer.cpp:20:
INFO ../../examples/all-clusters-app/linux/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/include/WhmManufacturer.h:182:16: error: 'SendPowerReading' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override]
INFO 182 | CHIP_ERROR SendPowerReading(EndpointId aEndpointId, Power_mW aActivePower_mW, Voltage_mV aVoltage_mV,
INFO | ^
INFO ../../examples/all-clusters-app/linux/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include/DEMManufacturerDelegate.h:92:24: note: overridden virtual function is here
INFO 92 | virtual CHIP_ERROR SendPowerReading(EndpointId aEndpointId, int64_t aActivePower_mW, int64_t aVoltage_mV, int64_t aCurrent_mA)
INFO | ^
INFO 1 error generated.
INFO [974/990] c++ obj/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/src/chip-all-clusters-common.water-heater-mode.cpp.o
INFO [975/990] c++ obj/third_party/connectedhomeip/examples/thermostat/thermostat-common/src/chip-all-clusters-common.thermostat-delegate-impl.cpp.o
INFO ninja: build stopped: subcommand failed.
Traceback (most recent call last):
File "/Users/runner/work/connectedhomeip/connectedhomeip/./scripts/build/build_examples.py", line 241, in <module>
main(auto_envvar_prefix='CHIP') It's related to this statement: Lines 173 to 174 in 54ff768
|
…ergy-management-app/energy-management-common/common/include" in ESP CMakeLists.txt after another PR moved EnergyTimeUtils.h back into this folder.
…ergy-management-app/energy-management-common/common/include" change in EMA ESP32
…common/common/include", back into silabs EMA BUILD.gn
I think the other PR #35948 that has merged shouldn't have added Power reporting into DEM. DEM doesn't have anything to do with Power Reporting (that belongs in the EEM/EPM clusters as part of the Power Reporting module). So will have to work out how undo that change - I missed that in the review of PR #35948 |
I built the Matter Linux Energy Management Example from this PR and Steps to reproduce
Log file: chip-energy-management-app.log Did you manage to make it work? Regards |
I haven't tried this since I merged up to master which picked up he PR #35948. I don't see this on old branches - but I suspect the issue is that the EVSE has been broken by the other PR - although not sure how it would have passed the CI tests? I also don't use the clang but just build it with a different set of args to disable BLE / WiFi & Thread when running local on PC. |
This PR moves some of the file contents to more appropriate places, so that the WaterHeater code can implement
EEM/EPM functions which were previously only in the EVSE source files.