Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Resource Monitoring Cluster Implementation (#27798)
* Add Basic Resource Monitoring Server Implementation * Add Basic Working Resource Monitoring Example App * Improve log output * Replace some HepafilterMonitoring specifics with more general ResourceMonitoring defines - using `using` - and adding by hand * Apply clang-format * More Hepa to ResourceMonitoring replacement * Add ActivatedCarbonFilterMonitoring Cluster * Rename ActivatedCarbonFilterMonitoring.cpp to ActivatedCarbonFilterMonitoringDelegate.cpp * Split delegate definitions into separate files * Cleanup some Headers * Rename member variables * Refactoring: Rename Delegate to Instance Add cluster-objects.h / cpp instead of defining it inside the server.h / cpp * Refactoring: Implement Read and Write function - have External Attribute Storage inside Instances - implement getters and Setters for Attributes * Refactoring: reorder methods to math the order in the .h file * Run Clang-Format * Add Getter for DegradationDirection Attribute - also clean up some namespaces * Add Construction Option To Set OnResetCondition To Supported Also add basic OnResetCondition implementation. * Add Default Values * Modified the AttributePersistenceProvider ReadValue function signiture to take the required attribute information directly rather than as a EmberAfAttributeMetadata structure. * Force External Storage for All Resource Monitoring Clusters * Force External Storage for All Resource Monitoring Clusters Regenerated Code * Expanded AttributePersistanceProvider API to include reading and wirting of uint8 and nullable uint8 * Add LastChangedTime to Attributes For ResourceMonitoring Clusters * Add LastChangedTime to Attributes For ResourceMonitoring Clusters Regenerated Code * Add `LastChangedTime` to Forced External Storage List For Resource Monitoring * Add LastChangedTime To Resource-Monitoring Server Implementation * Templated the AttributePersistanceProvider read and wiret function to work for all uint types. * Fixed AttributePersistanceProvider accepted types. Added read helper for type bool. * Restyled by clang-format * Formatting and some comments * Make OnResetCondition Pure Virtual And remove implementation from resource-monitor-server.cpp. It's not allowed to use the resource-monitoring-server::instance without deriving it yourself. * Set LastChangedTime In the OnResetCondition Handler * Fixed mismatched size return error of DefaultAttributePersistenceProvider * Add All Missing Aliased Clusters - CeramicFilterMonitoring - ElectrostaticFilterMonitoring - FuelTankMonitoring - InkCartridgeMonitoring - IonizingFilterMonitoring - OzoneFilterMonitoring - TonerCartridgeMonitoring - UvFilterMonitoring - WaterTankMonitoring - ZeoliteFilterMonitoring * Started work on tests for the AttributePersistenceProvider. * Add Missing Instances to resourceMonitoring Test App * Add Persistent Storage To LastChangedTime * Add README.md * Remove `ResourceMonitoringAliasesInstanceMap` as it wasn't really needed * Update Description Of Init() * Update Description of AppInit() and OnResetCondition() * Added unit tests for AttributePersistenceProvider testing the storage and retrival of all unsigned types and their nullable veriaties, bool and ByteSpan. Tested for small buffer errors. * Changed the type of aSize in ReadValue to size_t * Removed the dependancy on generated code in the AttributePersistencezprovider.h * Added static funtctions to get the KVS null representation for different types. * Fix Errors after Merge * Some Changes From Comments From The ModeBase PR * Added functions to read and write nullable bools and accompanying tests. * Incorporated boolean tests in the scalar test. * Added failure before init test * Restyled by clang-format * Move Headers To Resource-Monitoring-Common * Move Cpp files To resource-monitor-common * Remove All Unused Aliases For The Resource-Monitoring-Cluster this was decided in the AirQuality Call on 06.07.2023 * Fixed after merge. * Removed the failure on init test as it may have been causing seg faults in some tests. * Renamed GetNull -> GetNullValueForNullableType * Added the initialisation of valueReadBack and added a new templated function for nullable types to avoid the error: The left operand of '==' is a garbage value, on some platforms. * Added handline of signed ints and accompanying tests. * Added handline of nullable signed ints and accompanying tests. * Type cast null. * Restyled by clang-format * Changed shift bit to be af the same type are the return val. * Added tests got GetNull functions * Remove Aliased Clusters From Resource Monitoring Clusters except Hepa and ActivatedCarbon enable LastChangedTime for Hepa and ActivatedCarbon * Add Resource Monitoring Aliased Clusters Server implementation To Linux All-Clusters-App * Remove Todo * Remove Aliased Clusters From Resource Monitoring Clusters except Hepa and ActivatedCarbon * Remove Redundant Check apparently it's not necessary / allow to check this * Apply Restyled patch * Remove Tests For Removed Aliased Clusters - all except Hepa and ActivatedCarbon * Fix Spelling * Remove Unused / disallowed #include <maps> * Remove resource-monitoring-instances.h * Remove Unneeded Destructors * Use Default Descructor and Make Class Non copyable or moveable * Change IsAliascluster to IsValidAliasCluster * Fix Typo * Reset ChangeIndication Attribute On ResetCondition Command Spec requires this to be reset as well * Set FeatureMap To 3 For testing with Warning Feature enabled * Rename mFeature To mFeatureMap * Rewrite Some Comments From "function" to "method" * Remove Const * Update Comment Of Init() Method added the exact CHIP_ERROR_XXX that this can return. * Remove Commented Code * Added TODO For REP Feature * Change From "Next value" To "UINT8_MAX" * Use ChipLogDetail Instead Of ChipLogError * Fix Log on Some Platforms On some platforms (e.g. ASR) uint32_t seems to be a long and will produce a error if %u is used. So cast it to unsinged long on all platforms and use %lu. * Update README.md For Linux Resource-Monitoring-Example-App * Remove Aliased Clusters From Resource Monitoring Clusters except Hepa and ActivatedCarbon * Regen Code * Apply Restylerd Patch * Update Wordlist - Add HEPA * Remove PICS values For Resource Monitoring Clusters That Were Removed * Remove PICS For Resource Monitoring Clusters from PICS.yaml * Add Resource Monitoring README.md To docs/examples/index.md * Remove redundant chip::app:: prefixes * Use Bitset Instead Of Just a Number For FeatureMap * Remove Options from CHIPProjectAppConfig.h not needed or wrong * Remove network commissioning bits As of earlier today that's handled by AppInit. Which is good, because the bits here are buggy. * Make Hepa And ActivateCarbon Filter Monitoring Instances Static * Remove ClusterId From Specialized Hepa and Activated Carbon Construtors They should know their cluster ids, and now they do! * Add Getter for Endpoint * Remove Nonsense Comment * Remove Aliased Cluster IDs That Got Removed * Fix Typo * Simplify HandleResetCondition Method * Add Copyright * Sort out Includes Add what is needed using "include what you use" tool * Make Methods To Private and move private section to bottom instead of in between * Initialize All The Member Varaibles With Initializer List also updated the comment with the new parameters * Explicit Delete Move Constructors * Make More Methods To Private * Update Comment For OnResetCondition Command Handler * Add FeatureMap To Zcl*.json Files * Apply restyled Patch * Remove ResetCondtion::Type And Encode they are only needed for sending the command, it does not send the command. * Remove While Loop's Body is a very complicated no-op. Keep the while itself, it basically check if this is not malformed TLV * Move OnResetCondition Handling to Cluster Implementation - add PreResetCondition and PostResetCondition() methods to be overwritten fixes #27986 * Apply Restyled Patch * Fix Typo * Remove Init For Resource Monitoring Clusters From main-common.cpp And put it in resource-monitoring-helper.cpp. This will use the ClusterInitCallbacks to initialize the instance objects. This removes the need to have the init code in every example app, just include the helper.cpp file. * Apply Restyled Patch * Update examples/resource-monitoring-app/linux/src/main.cpp Co-authored-by: Cliff Chung <[email protected]> * Update examples/resource-monitoring-app/linux/src/main.cpp Co-authored-by: Cliff Chung <[email protected]> * Fix Some Typos * Disable Removed Test Cases * Apply Restylerd Patch * Apply Restyled Patch * Add Resource-Monitoring-Server To ESP32 All Clusters Example * Remove Test Scripts For Aliased Clusters * Revert "Disable Removed Test Cases" This reverts commit 34e6355. * Add VerifyOrDie() When More Than 1 EP gets Initialized For Hepa Or Activated Carbon Filter Monitoring * Add Resource-Monitoring Clusters To ESP32 Minimal App * Apply Restyled Patch * Move Resource-Monitoring Instances/Delegates To All-Clusters-Common to avoid having to include multiple directories and source code from another example app. * Apply Restyled Patch * Update Code Gen * Fix Zap After Merge + CodeGen --------- Co-authored-by: William Hicklin <[email protected]> Co-authored-by: William <[email protected]> Co-authored-by: Restyled.io <[email protected]> Co-authored-by: Cliff Chung <[email protected]> Co-authored-by: Cliff Chung <[email protected]>
- Loading branch information