Skip to content

Commit b336001

Browse files
committed
Implement chime delegate instance for all-clusters-app
1 parent cde8e21 commit b336001

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

examples/all-clusters-app/all-clusters-common/include/chime-instance.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ class ChimeCommandDelegate : public ChimeDelegate
4949

5050
} // namespace Clusters
5151
} // namespace app
52-
} // namespace chip
52+
} // namespace chip

examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@ ChimeSoundStructType ChimeCommandDelegate::supportedChimes[] = {
3838

3939
CHIP_ERROR ChimeCommandDelegate::GetChimeSoundByIndex(uint8_t chimeIndex, uint8_t & chimeID, MutableCharSpan & name)
4040
{
41-
if (chimeIndex >= ArraySize(supportedChimes))
41+
if (chimeIndex >= MATTER_ARRAY_SIZE(supportedChimes))
4242
{
4343
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
4444
}
45-
auto& selectedChime = supportedChimes[chimeIndex];
45+
auto & selectedChime = supportedChimes[chimeIndex];
4646
chip::CopyCharSpanToMutableCharSpan(selectedChime.name, name);
4747
chimeID = selectedChime.chimeID;
4848
return CHIP_NO_ERROR;
4949
}
5050

5151
CHIP_ERROR ChimeCommandDelegate::GetChimeIDByIndex(uint8_t chimeIndex, uint8_t & chimeID)
5252
{
53-
if (chimeIndex >= ArraySize(supportedChimes))
53+
if (chimeIndex >= MATTER_ARRAY_SIZE(supportedChimes))
5454
{
5555
return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED;
5656
}
57-
auto& selectedChime = supportedChimes[chimeIndex];
58-
chimeID = selectedChime.chimeID;
57+
auto & selectedChime = supportedChimes[chimeIndex];
58+
chimeID = selectedChime.chimeID;
5959
return CHIP_NO_ERROR;
6060
}
6161

@@ -69,4 +69,4 @@ static ChimeServer gChimeClusterServerInstance = ChimeServer(EndpointId(1), Chim
6969
void emberAfChimeClusterInitCallback(EndpointId endpoint)
7070
{
7171
gChimeClusterServerInstance.Init();
72-
}
72+
}

examples/all-clusters-app/linux/BUILD.gn

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ source_set("chip-all-clusters-common") {
3434
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp",
3535
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/boolcfg-stub.cpp",
3636
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp",
37+
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
3738
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/concentration-measurement-instances.cpp",
3839
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/chime-instance.cpp",
3940
"${chip_root}/examples/all-clusters-app/all-clusters-common/src/device-energy-management-stub.cpp",

0 commit comments

Comments
 (0)