Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add chime server to build #37365

Merged
merged 19 commits into from
Feb 27, 2025
Merged
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -7014,6 +7014,28 @@ cluster LowPower = 1288 {
command Sleep(): DefaultSuccess = 0;
}

/** This cluster provides facilities to configure and play Chime sounds, such as those used in a doorbell. */
provisional cluster Chime = 1366 {
revision 1;

struct ChimeSoundStruct {
int8u chimeID = 0;
char_string<48> name = 1;
}

readonly attribute ChimeSoundStruct installedChimeSounds[] = 0;
attribute int8u activeChimeID = 1;
attribute boolean enabled = 2;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

command PlayChimeSound(): DefaultSuccess = 0;
}

/** The Test Cluster is meant to validate the generated code */
internal cluster UnitTesting = 4294048773 {
revision 1; // NOTE: Default/not specifically set
@@ -9291,6 +9313,19 @@ endpoint 1 {
handle command Sleep;
}

server cluster Chime {
callback attribute installedChimeSounds;
callback attribute activeChimeID;
callback attribute enabled;
callback attribute generatedCommandList;
callback attribute acceptedCommandList;
callback attribute attributeList;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;

handle command PlayChimeSound;
}

server cluster UnitTesting {
emits event TestEvent;
emits event TestFabricScopedEvent;
149 changes: 149 additions & 0 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
@@ -20958,6 +20958,155 @@
}
]
},
{
"name": "Chime",
"code": 1366,
"mfgCode": null,
"define": "CHIME_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "PlayChimeSound",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
{
"name": "InstalledChimeSounds",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActiveChimeID",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Enabled",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Unit Testing",
"code": 4294048773,
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
*
* 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/chime-server/chime-server.h>
#include <app/util/config.h>
#include <cstring>

namespace chip {
namespace app {
namespace Clusters {

/**
* The application delegate to define the options & implement commands.
*/
class ChimeCommandDelegate : public ChimeDelegate
{
static ChimeCommandDelegate instance;
static chip::app::Clusters::Chime::Structs::ChimeSoundStruct::Type supportedChimes[];

public:
CHIP_ERROR GetChimeSoundByIndex(uint8_t chimeIndex, uint8_t & chimeID, MutableCharSpan & name);

CHIP_ERROR GetChimeIDByIndex(uint8_t chimeIndex, uint8_t & chimeID);

Protocols::InteractionModel::Status PlayChimeSound();

ChimeCommandDelegate() = default;
~ChimeCommandDelegate() = default;

static inline ChimeCommandDelegate & getInstance() { return instance; }
};

} // namespace Clusters
} // namespace app
} // namespace chip
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
*
* Copyright (c) 2025 Matter 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.
*/

#include <app-common/zap-generated/ids/Attributes.h>
#include <app-common/zap-generated/ids/Clusters.h>
#include <app/clusters/chime-server/chime-server.h>
#include <chime-instance.h>

using namespace chip;
using namespace chip::app;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::Chime;
using namespace chip::app::Clusters::Chime::Attributes;
using chip::Protocols::InteractionModel::Status;
using ChimeSoundStructType = Structs::ChimeSoundStruct::Type;

ChimeCommandDelegate ChimeCommandDelegate::instance;

ChimeSoundStructType ChimeCommandDelegate::supportedChimes[] = {
{ .chimeID = 5, .name = chip::CharSpan("Chime 5"_span) },
{ .chimeID = 10, .name = chip::CharSpan("Chime 10"_span) },
};

CHIP_ERROR ChimeCommandDelegate::GetChimeSoundByIndex(uint8_t chimeIndex, uint8_t & chimeID, MutableCharSpan & name)
{
if (chimeIndex >= MATTER_ARRAY_SIZE(supportedChimes))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
auto & selectedChime = supportedChimes[chimeIndex];
chip::CopyCharSpanToMutableCharSpan(selectedChime.name, name);
chimeID = selectedChime.chimeID;
return CHIP_NO_ERROR;
}

CHIP_ERROR ChimeCommandDelegate::GetChimeIDByIndex(uint8_t chimeIndex, uint8_t & chimeID)
{
if (chimeIndex >= MATTER_ARRAY_SIZE(supportedChimes))
{
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
}
auto & selectedChime = supportedChimes[chimeIndex];
chimeID = selectedChime.chimeID;
return CHIP_NO_ERROR;
}

Status ChimeCommandDelegate::PlayChimeSound()
{
return Status::Success;
}

static ChimeServer gChimeClusterServerInstance = ChimeServer(EndpointId(1), ChimeCommandDelegate::getInstance());

void emberAfChimeClusterInitCallback(EndpointId endpoint)
{
gChimeClusterServerInstance.Init();
}
1 change: 1 addition & 0 deletions examples/all-clusters-app/ameba/chip_main.cmake
Original file line number Diff line number Diff line change
@@ -157,6 +157,7 @@ list(

${chip_dir}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp
${chip_dir}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/asr/BUILD.gn
Original file line number Diff line number Diff line change
@@ -73,6 +73,7 @@ asr_executable("clusters_app") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp",
1 change: 1 addition & 0 deletions examples/all-clusters-app/infineon/psoc6/BUILD.gn
Original file line number Diff line number Diff line change
@@ -115,6 +115,7 @@ psoc6_executable("clusters_app") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp",
1 change: 1 addition & 0 deletions examples/all-clusters-app/linux/BUILD.gn
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/dishwasher-alarm-stub.cpp",
1 change: 1 addition & 0 deletions examples/all-clusters-app/mbed/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@ target_sources(${APP_TARGET} PRIVATE
${MBED_COMMON}/util/DFUManager.cpp
${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON}/src/chime-instance.cpp
${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON}/src/device-energy-management-stub.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/nrfconnect/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -63,6 +63,7 @@ target_sources(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/chime-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp
${ENERGY_MANAGEMENT_COMMON_DIR}/common/src/EnergyTimeUtils.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/nxp/mw320/BUILD.gn
Original file line number Diff line number Diff line change
@@ -84,6 +84,7 @@ mw320_executable("shell_mw320") {
sources = [
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/energy-evse-stub.cpp",
1 change: 1 addition & 0 deletions examples/all-clusters-app/nxp/zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -108,6 +108,7 @@ target_sources(app
${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/chime-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/resource-monitoring-delegates.cpp
${EXAMPLE_PLATFORM_NXP_COMMON_DIR}/icd/source/ICDUtil.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/openiotsdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ target_sources(${APP_TARGET}
${ALL_CLUSTERS_COMMON}/src/smco-stub.cpp
${ALL_CLUSTERS_COMMON}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON}/src/chime-instance.cpp
${ALL_CLUSTERS_COMMON}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON}/src/oven-modes.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/telink/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ target_sources(app PRIVATE
${ALL_CLUSTERS_COMMON_DIR}/src/bridged-actions-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/binding-handler.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/air-quality-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/chime-instance.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/concentration-measurement-instances.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/fan-stub.cpp
${ALL_CLUSTERS_COMMON_DIR}/src/device-energy-management-stub.cpp
1 change: 1 addition & 0 deletions examples/all-clusters-app/tizen/BUILD.gn
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ source_set("chip-all-clusters-common") {
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/air-quality-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/electrical-energy-measurement-stub.cpp",
149 changes: 149 additions & 0 deletions scripts/tools/zap/tests/inputs/all-clusters-app.zap
Original file line number Diff line number Diff line change
@@ -20451,6 +20451,155 @@
}
]
},
{
"name": "Chime",
"code": 1366,
"mfgCode": null,
"define": "CHIME_CLUSTER",
"side": "server",
"enabled": 1,
"apiMaturity": "provisional",
"commands": [
{
"name": "PlayChimeSound",
"code": 0,
"mfgCode": null,
"source": "client",
"isIncoming": 1,
"isEnabled": 1
}
],
"attributes": [
{
"name": "InstalledChimeSounds",
"code": 0,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ActiveChimeID",
"code": 1,
"mfgCode": null,
"side": "server",
"type": "int8u",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "Enabled",
"code": 2,
"mfgCode": null,
"side": "server",
"type": "boolean",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "GeneratedCommandList",
"code": 65528,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AcceptedCommandList",
"code": 65529,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "AttributeList",
"code": 65531,
"mfgCode": null,
"side": "server",
"type": "array",
"included": 1,
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
"mfgCode": null,
"side": "server",
"type": "bitmap32",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "ClusterRevision",
"code": 65533,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
}
]
},
{
"name": "Unit Testing",
"code": 4294048773,

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@
#define MATTER_DM_WEB_RTC_TRANSPORT_PROVIDER_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_WEB_RTC_TRANSPORT_REQUESTOR_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_PUSH_AV_STREAM_TRANSPORT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_CHIME_CLUSTER_SERVER_ENDPOINT_COUNT (1)
#define MATTER_DM_ECOSYSTEM_INFORMATION_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_COMMISSIONER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (0)
#define MATTER_DM_TLS_CERTIFICATE_MANAGEMENT_CLUSTER_SERVER_ENDPOINT_COUNT (0)
@@ -749,6 +749,11 @@
#define MATTER_DM_PLUGIN_LOW_POWER_SERVER
#define MATTER_DM_PLUGIN_LOW_POWER

// Use this macro to check if the server side of the Chime cluster is included
#define ZCL_USING_CHIME_CLUSTER_SERVER
#define MATTER_DM_PLUGIN_CHIME_SERVER
#define MATTER_DM_PLUGIN_CHIME

// Use this macro to check if the server side of the Unit Testing cluster is included
#define ZCL_USING_UNIT_TESTING_CLUSTER_SERVER
#define MATTER_DM_PLUGIN_UNIT_TESTING_SERVER
@@ -772,6 +777,9 @@
#define BOOLEAN_STATE_CONFIGURATION_ENABLE_SUPPRESS_ALARM_CMD 1
#define BOOLEAN_STATE_CONFIGURATION_ENABLE_ENABLE_DISABLE_ALARM_CMD 1

// Chime Cluster Commands
#define CHIME_ENABLE_PLAY_CHIME_SOUND_CMD 1

// ColorControl Cluster Commands
#define COLOR_CONTROL_ENABLE_MOVE_TO_HUE_CMD 1
#define COLOR_CONTROL_ENABLE_MOVE_HUE_CMD 1
8 changes: 4 additions & 4 deletions src/app/clusters/chime-server/chime-server.cpp
Original file line number Diff line number Diff line change
@@ -68,8 +68,8 @@ CHIP_ERROR ChimeServer::Init()
void ChimeServer::LoadPersistentAttributes()
{
// Load Active Chime ID
uint8_t storedActiveChimeID;
CHIP_ERROR err = GetSafeAttributePersistenceProvider()->ReadScalarValue(
uint8_t storedActiveChimeID = 0;
CHIP_ERROR err = GetSafeAttributePersistenceProvider()->ReadScalarValue(
ConcreteAttributePath(GetEndpointId(), Chime::Id, ActiveChimeID::Id), storedActiveChimeID);
if (err == CHIP_NO_ERROR)
{
@@ -82,7 +82,7 @@ void ChimeServer::LoadPersistentAttributes()
}

// Load Enabled
bool storedEnabled;
bool storedEnabled = false;
err = GetSafeAttributePersistenceProvider()->ReadScalarValue(ConcreteAttributePath(GetEndpointId(), Chime::Id, Enabled::Id),
storedEnabled);
if (err == CHIP_NO_ERROR)
@@ -252,7 +252,7 @@ void ChimeServer::InvokeCommand(HandlerContext & ctx)
{
case Commands::PlayChimeSound::Id:
CommandHandlerInterface::HandleCommand<Commands::PlayChimeSound::DecodableType>(
ctx, [this](HandlerContext & context, const auto & req) { HandlePlayChimeSound(context, req); });
ctx, [this](HandlerContext & innerCtx, const auto & req) { HandlePlayChimeSound(innerCtx, req); });
break;
}
}