Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
020019e
Oven App skeleton code with all endpoint initialisations
arun-silabs Oct 16, 2025
2298d4e
Restyled by whitespace
restyled-commits Oct 16, 2025
579b8b9
Restyled by clang-format
restyled-commits Oct 16, 2025
eef89e6
Fix zap issue
arun-silabs Oct 16, 2025
8b9b916
Address copilot review
arun-silabs Oct 21, 2025
34dc94d
Restyled by clang-format
restyled-commits Oct 21, 2025
1b54182
Rebased with main and regenerated zap to fix the zap gen issue
arun-silabs Oct 21, 2025
0928fbb
Apply suggestions from code review
arun-silabs Oct 21, 2025
81ee2a0
Apply suggestions from code review
arun-silabs Oct 21, 2025
ec92429
Address copilot review comments
arun-silabs Oct 22, 2025
5ab6a75
Address review comments and modify the file structures accordingly
arun-silabs Oct 23, 2025
95421c7
Restyled by whitespace
restyled-commits Oct 23, 2025
0242577
Restyled by clang-format
restyled-commits Oct 23, 2025
ba8363d
Restyled by gn
restyled-commits Oct 23, 2025
ff3f05a
Add required TODOs and optimize the skeleton code
arun-silabs Oct 23, 2025
1835a98
Restyled by whitespace
restyled-commits Oct 23, 2025
04a7ba8
Restyled by clang-format
restyled-commits Oct 23, 2025
9c7a0d5
Cleanup comments
arun-silabs Oct 23, 2025
66cacf0
Apply suggestions from code review
arun-silabs Oct 28, 2025
4c3c584
Address review comments
arun-silabs Oct 28, 2025
b36fa68
Restyled by whitespace
restyled-commits Oct 28, 2025
06b215d
Restyled by clang-format
restyled-commits Oct 28, 2025
d6fcd86
Replace if blocks with VerifyOrReturnError
arun-silabs Oct 28, 2025
c131c62
Restyled by clang-format
restyled-commits Oct 28, 2025
dd57d5d
Minor clean-ups
arun-silabs Oct 29, 2025
b2638ec
Commands implementation
arun-silabs Oct 26, 2025
3eb7ff8
Add logic to handle the oven-mode change
arun-silabs Oct 26, 2025
32e9ade
Clean-up the command handling logic
arun-silabs Oct 27, 2025
f4a5bf4
Restyled by whitespace
restyled-commits Oct 27, 2025
6613eea
Restyled by clang-format
restyled-commits Oct 27, 2025
e3758b1
Address review comments
arun-silabs Oct 28, 2025
679dfcd
Address review comments
arun-silabs Oct 29, 2025
0f9b2d0
Restyled by whitespace
restyled-commits Oct 29, 2025
9d67255
Restyled by clang-format
restyled-commits Oct 29, 2025
b95b3fc
Move ChangeToMode command processing to common layer
arun-silabs Oct 29, 2025
3f3d6e2
Restyled by whitespace
restyled-commits Oct 29, 2025
43caebd
Restyled by clang-format
restyled-commits Oct 29, 2025
ff26167
Commands implementation
arun-silabs Oct 26, 2025
f230e37
Add logic to handle the oven-mode change
arun-silabs Oct 26, 2025
da89d90
Clean-up the command handling logic
arun-silabs Oct 27, 2025
522dddc
Binding manager initial implementation
arun-silabs Oct 27, 2025
c9201c7
Fix zap issue by re-generating .matter file
arun-silabs Oct 29, 2025
029bdb4
Fix build errors
arun-silabs Oct 29, 2025
5a7500a
Restyled by whitespace
restyled-commits Oct 29, 2025
cd39178
Restyled by clang-format
restyled-commits Oct 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions examples/oven-app/oven-app-common/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright (c) 2025 Project CHIP Authors
#
# 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.

import("//build_overrides/chip.gni")
import("${chip_root}/examples/common/pigweed/pigweed_rpcs.gni")
import("${chip_root}/src/app/chip_data_model.gni")

config("config") {
include_dirs = [ "common/include" ]
}

chip_data_model("oven-app-common") {
zap_file = "oven-app.zap"
is_server = true
public_deps = [ "${chip_root}/src/app/clusters/bindings:binding-manager" ]
}
66 changes: 66 additions & 0 deletions examples/oven-app/oven-app-common/include/CookSurfaceEndpoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
*
* Copyright (c) 2025 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-common/zap-generated/cluster-objects.h>
#include <lib/core/CHIPError.h>
#include <lib/core/DataModelTypes.h>

namespace chip {
namespace app {
namespace Clusters {
namespace CookSurface {

class CookSurfaceEndpoint
{
public:
CookSurfaceEndpoint(EndpointId endpointId) : mEndpointId(endpointId) {}

/**
* @brief Initialize the CookSurface endpoint.
*
* @return returns CHIP_NO_ERROR on success, or an error code on failure.
*/
CHIP_ERROR Init();

/**
* @brief Gets the current On/Off state from server.
* @param state Reference to store the current On/Off state.
* @return Returns Status::Success on success, or an error code on failure.
*/

chip::Protocols::InteractionModel::Status GetOnOffState(bool & state);

/**
* @brief Set On/Off state for the CookSurface.
* @param state Desired On/Off state.
* @return Returns Status::Success on success, or an error code on failure.
*/
chip::Protocols::InteractionModel::Status SetOnOffState(bool state);

EndpointId GetEndpointId() const { return mEndpointId; }

private:
EndpointId mEndpointId = kInvalidEndpointId;
};

} // namespace CookSurface
} // namespace Clusters
} // namespace app
} // namespace chip
56 changes: 56 additions & 0 deletions examples/oven-app/oven-app-common/include/CookTopEndpoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
*
* Copyright (c) 2025 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/on-off-server/on-off-server.h>
#include <lib/core/CHIPError.h>

namespace chip {
namespace app {
namespace Clusters {
namespace CookTop {

class CookTopEndpoint
{
public:
CookTopEndpoint(EndpointId endpointId) : mEndpointId(endpointId) {}

/**
* @brief Initialize the cooktop endpoint.
*
* @return returns CHIP_NO_ERROR on success, or an error code on failure.
*/
CHIP_ERROR Init();

/**
* @brief Set On/Off state for the CookSurface.
* @param state Desired On/Off state.
* @return Returns Status::Success on success, or an error code on failure.
*/
chip::Protocols::InteractionModel::Status SetOnOffState(bool state);

private:
bool currentOnOffState = false;
EndpointId mEndpointId = kInvalidEndpointId;
};

} // namespace CookTop
} // namespace Clusters
} // namespace app
} // namespace chip
134 changes: 134 additions & 0 deletions examples/oven-app/oven-app-common/include/OvenEndpoint.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
/*
*
* Copyright (c) 2025 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-common/zap-generated/cluster-objects.h>
#include <app/clusters/mode-base-server/mode-base-server.h>
#include <app/clusters/temperature-control-server/supported-temperature-levels-manager.h>
#include <app/data-model/List.h>
#include <lib/core/CHIPError.h>
#include <lib/core/DataModelTypes.h>
#include <lib/support/Span.h>

namespace chip {
namespace app {
namespace Clusters {
namespace TemperatureControlledCabinet {
class OvenModeDelegate : public ModeBase::Delegate
{
public:
// Oven mode enum for better type safety and code clarity
enum class OvenModes : uint8_t
{
kModeBake = 0,
kModeConvection = 1,
kModeGrill = 2,
kModeRoast = 3,
kModeClean = 4,
kModeConvectionBake = 5,
kModeConvectionRoast = 6,
kModeWarming = 7,
kModeProofing = 8,
kModeCount = 9,
};

OvenModeDelegate(EndpointId endpointId) : mEndpointId(endpointId) {}

// ModeBase::Delegate interface
CHIP_ERROR Init() override;
void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override;
CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override;
CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override;
CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List<detail::Structs::ModeTagStruct::Type> & tags) override;

/**
* @brief Checks if the provided mode is supported.
*
* @param mode The mode to check.
* @return true if the mode is supported, false otherwise.
*/
bool IsSupportedMode(uint8_t mode);

private:
EndpointId mEndpointId;

static const detail::Structs::ModeTagStruct::Type sModeTagsBake[];
static const detail::Structs::ModeTagStruct::Type sModeTagsConvection[];
static const detail::Structs::ModeTagStruct::Type sModeTagsGrill[];
static const detail::Structs::ModeTagStruct::Type sModeTagsRoast[];
static const detail::Structs::ModeTagStruct::Type sModeTagsClean[];
static const detail::Structs::ModeTagStruct::Type sModeTagsConvectionBake[];
static const detail::Structs::ModeTagStruct::Type sModeTagsConvectionRoast[];
static const detail::Structs::ModeTagStruct::Type sModeTagsWarming[];
static const detail::Structs::ModeTagStruct::Type sModeTagsProofing[];

static const detail::Structs::ModeOptionStruct::Type skModeOptions[];
};

class TemperatureControlledCabinetEndpoint
{
public:
TemperatureControlledCabinetEndpoint(EndpointId endpointId) :
mEndpointId(endpointId), mOvenModeDelegate(mEndpointId), mOvenModeInstance(&mOvenModeDelegate, mEndpointId, OvenMode::Id, 0)
{}

/**
* @brief Initialize the temperature controlled cabinet endpoint. Sets the oven mode cluster instance with the appropriate
* delegate.
*
* @return returns CHIP_NO_ERROR on success, or an error code on failure.
*/
CHIP_ERROR Init();

/**
* @brief Get the oven mode delegate instance.
*
* @return Reference to the oven mode delegate.
*/
OvenModeDelegate & GetOvenModeDelegate() { return mOvenModeDelegate; }

private:
EndpointId mEndpointId = kInvalidEndpointId;
OvenModeDelegate mOvenModeDelegate;
ModeBase::Instance mOvenModeInstance;
};

} // namespace TemperatureControlledCabinet

namespace Oven {
/**
* @brief Base oven endpoint placeholder.
*/
class OvenEndpoint
{
public:
OvenEndpoint() {}

/**
* @brief Initialize the oven endpoint.
*
* @return returns CHIP_NO_ERROR on success, or an error code on failure.
*/
CHIP_ERROR Init();
};

} // namespace Oven
} // namespace Clusters
} // namespace app
} // namespace chip
Loading
Loading