-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ReplacementProductList to Resource Monitoring Cluster
This adds the implementation to fetch the replacement product list from the aliased resource-monitoring-cluster. It adds support for Hepa and Activated Carbon filter examples. Closes out issues #27802, #27801, #27577 ### Testing I tested this using both the all-clusters-app as well as the resource-monitoring-example-app ``` >>>> hepafiltermonitoring read replacement-product-list 0x1 0x1 DataVersion = 0xd31d0b60, AttributePathIB = { Endpoint = 0x1, Cluster = 0x71, Attribute = 0x0000_0005, } Data = [ { 0x0 = 0, 0x1 = "upc12xhepaxx" (13 chars), }, { 0x0 = 1, 0x1 = "gtin8xhe" (9 chars), }, { 0x0 = 2, 0x1 = "ean13xhepaxxx" (14 chars), }, ], >>>> activatedcarbonfiltermonitoring read replacement-product-list 0x1 0x1 DataVersion = 0xfd145260, AttributePathIB = { Endpoint = 0x1, Cluster = 0x72, Attribute = 0x0000_0005, } Data = [ { 0x0 = 0, 0x1 = "upc12xcarbon" (13 chars), }, { 0x0 = 1, 0x1 = "gtin8xca" (9 chars), }, { 0x0 = 2, 0x1 = "ean13xacarbon" (14 chars), }, ], ```
- Loading branch information
Showing
39 changed files
with
860 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ng-app/resource-monitoring-common/include/instances/StaticReplacementProductListManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* | ||
* Copyright (c) 2023 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 <app/clusters/resource-monitoring-server/replacement-product-list-manager.h> | ||
#include <app/util/af.h> | ||
#include <app/util/config.h> | ||
|
||
namespace chip { | ||
namespace app { | ||
namespace Clusters { | ||
namespace ResourceMonitoring { | ||
|
||
/** | ||
* This implementation statically defines the options. | ||
*/ | ||
|
||
class StaticReplacementProductListManager : public ReplacementProductListManager | ||
{ | ||
public: | ||
uint8_t Size() override { return mReplacementProductListSize; }; | ||
|
||
CHIP_ERROR Next(Attributes::ReplacementProductStruct::Type & item) override; | ||
|
||
~StaticReplacementProductListManager() {} | ||
StaticReplacementProductListManager(Attributes::ReplacementProductStruct::Type * aReplacementProductsList, uint8_t aReplacementProductListSize) | ||
{ | ||
mReplacementProductsList = aReplacementProductsList; | ||
mReplacementProductListSize = aReplacementProductListSize; | ||
} | ||
|
||
private: | ||
Attributes::ReplacementProductStruct::Type * mReplacementProductsList; | ||
uint8_t mReplacementProductListSize; | ||
}; | ||
|
||
} // namespace ResourceMonitoring | ||
} // namespace Clusters | ||
} // namespace app | ||
} // namespace chip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.