-
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.
Laundry dryer controls cluster sdk (#30285)
* Steps 1.1, 1.2 * update cluster list and build.gn This reverts commit feabe0b. run zap and update build, clusters list zap_regen_all & build chip-tool regen zap updated zap and regen updated zap and regen zap_regen_all & build chip-tool Revert "regen zap" This reverts commit f259abf. * controller-clusters.zap and regen_all * setting optional=false for clusters * zap_regen_all * run zap and update build, clusters list * zap_regen_all & build chip-tool * Fisrt Pass at SDK code * SDK is building and running * now registers laundry controls delegate added function definitions to override weak definitions that do nothing. * adding the cluster to preAttributeChange list * Restyled by clang-format * Restyled by gn * regenerated all zap * reverting submodule changes * regenerate_zap_all * update all-clusters zap * Updated cluster-enums.h path * Revert "run zap and update build, clusters list" This reverts commit 17642c9. * Restyled by clang-format * update zap * Attribute fix for SelectedDrynessLevel * Added Attribute in zcl.json * Revert "Added Attribute in zcl.json" This reverts commit 4ee377f. * adding SupportedDrynessLevels to JSON bits * Updated zcl test json * Fix Dryer delegate init on Linux all-clusters * Restyled by clang-format * Added static assert for Enum and removed dryer from .json bits --------- Co-authored-by: Restyled.io <[email protected]> Co-authored-by: OmAmbalkar <[email protected]> Co-authored-by: [email protected] <[email protected]>
- Loading branch information
1 parent
061ff86
commit b096c88
Showing
13 changed files
with
595 additions
and
2 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
53 changes: 53 additions & 0 deletions
53
examples/all-clusters-app/all-clusters-common/include/laundry-dryer-controls-delegate-impl.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,53 @@ | ||
/* | ||
* | ||
* 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/laundry-dryer-controls-server/laundry-dryer-controls-delegate.h> | ||
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h> | ||
#include <app/util/af.h> | ||
#include <app/util/config.h> | ||
#include <cstring> | ||
|
||
namespace chip { | ||
namespace app { | ||
namespace Clusters { | ||
namespace LaundryDryerControls { | ||
|
||
/** | ||
* The application delegate to statically define the options. | ||
*/ | ||
|
||
class LaundryDryerControlDelegate : public Delegate | ||
{ | ||
static const DrynessLevelEnum supportedDrynessLevelOptions[]; | ||
static LaundryDryerControlDelegate instance; | ||
|
||
public: | ||
CHIP_ERROR GetSupportedDrynessLevelAtIndex(size_t index, DrynessLevelEnum & supportedDrynessLevel); | ||
|
||
LaundryDryerControlDelegate() = default; | ||
~LaundryDryerControlDelegate() = default; | ||
|
||
static inline LaundryDryerControlDelegate & getLaundryDryerControlDelegate() { return instance; } | ||
}; | ||
|
||
} // namespace LaundryDryerControls | ||
} // namespace Clusters | ||
} // namespace app | ||
} // namespace chip |
40 changes: 40 additions & 0 deletions
40
examples/all-clusters-app/all-clusters-common/src/laundry-dryer-controls-delegate-impl.cpp
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,40 @@ | ||
/* | ||
* | ||
* 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. | ||
*/ | ||
#include <app/clusters/laundry-dryer-controls-server/laundry-dryer-controls-server.h> | ||
#include <app/util/config.h> | ||
#include <laundry-dryer-controls-delegate-impl.h> | ||
|
||
using namespace chip; | ||
using namespace chip::app::Clusters::LaundryDryerControls; | ||
|
||
const DrynessLevelEnum LaundryDryerControlDelegate::supportedDrynessLevelOptions[] = { DrynessLevelEnum::kLow, | ||
DrynessLevelEnum::kNormal, | ||
DrynessLevelEnum::kMax }; | ||
|
||
LaundryDryerControlDelegate LaundryDryerControlDelegate::instance; | ||
|
||
// TODO: Add EndpointId to the API so that different values per endpoint may be possible in some implementations. | ||
CHIP_ERROR LaundryDryerControlDelegate::GetSupportedDrynessLevelAtIndex(size_t index, DrynessLevelEnum & supportedDrynessLevel) | ||
{ | ||
if (index >= ArraySize(supportedDrynessLevelOptions)) | ||
{ | ||
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; | ||
} | ||
supportedDrynessLevel = supportedDrynessLevelOptions[index]; | ||
return CHIP_NO_ERROR; | ||
} |
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.