forked from project-chip/connectedhomeip
-
Notifications
You must be signed in to change notification settings - Fork 0
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 project-chip#27802, project-chip#27801, project-chip#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
36 changed files
with
1,905 additions
and
1,126 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
52 changes: 52 additions & 0 deletions
52
...oring-common/include/instances/StaticActivatedCarbonFilterReplacementProductListManager.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,52 @@ | ||
/* | ||
* | ||
* 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> | ||
|
||
using namespace chip::app::Clusters; | ||
|
||
namespace chip { | ||
namespace app { | ||
namespace Clusters { | ||
namespace ResourceMonitoring { | ||
|
||
static const uint8_t kActivatedCarbonFilterReplacementProductListSize = 3; | ||
|
||
/** | ||
* This implementation statically defines the options. | ||
*/ | ||
|
||
class StaticActivatedCarbonFilterReplacementProductListManager | ||
: public ReplacementProductListManager<ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::Type> | ||
{ | ||
public: | ||
uint8_t Size() override { return kActivatedCarbonFilterReplacementProductListSize; }; | ||
|
||
CHIP_ERROR Next(ActivatedCarbonFilterMonitoring::Structs::ReplacementProductStruct::Type & item) override; | ||
|
||
~StaticActivatedCarbonFilterReplacementProductListManager() {} | ||
}; | ||
|
||
} // namespace ResourceMonitoring | ||
} // namespace Clusters | ||
} // namespace app | ||
} // namespace chip |
52 changes: 52 additions & 0 deletions
52
...ource-monitoring-common/include/instances/StaticHepaFilterReplacementProductListManager.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,52 @@ | ||
/* | ||
* | ||
* 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> | ||
|
||
using namespace chip::app::Clusters; | ||
|
||
namespace chip { | ||
namespace app { | ||
namespace Clusters { | ||
namespace ResourceMonitoring { | ||
|
||
static const uint8_t kHepaFilterReplacementProductListSize = 3; | ||
|
||
/** | ||
* This implementation statically defines the options. | ||
*/ | ||
|
||
class StaticHepaFilterReplacementProductListManager | ||
: public ReplacementProductListManager<HepaFilterMonitoring::Structs::ReplacementProductStruct::Type> | ||
{ | ||
public: | ||
uint8_t Size() override { return kHepaFilterReplacementProductListSize; }; | ||
|
||
CHIP_ERROR Next(HepaFilterMonitoring::Structs::ReplacementProductStruct::Type & item) override; | ||
|
||
~StaticHepaFilterReplacementProductListManager() {} | ||
}; | ||
|
||
} // 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
Oops, something went wrong.