Skip to content

Commit

Permalink
[SDK] Rename EMBER_XXX to MATTER_XXX (project-chip#32078)
Browse files Browse the repository at this point in the history
* Rename EMBER_ to MATTER_

* Fix last comments
  • Loading branch information
jepenven-silabs authored Feb 13, 2024
1 parent bdbcf07 commit 58bf8e1
Show file tree
Hide file tree
Showing 31 changed files with 122 additions and 177 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
using namespace chip;
using namespace chip::app;

if (binding.type == EMBER_MULTICAST_BINDING)
if (binding.type == MATTER_MULTICAST_BINDING)
{
ChipLogError(NotSpecified, "Group binding is not supported now");
return;
}

if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 &&
if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
{
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
Expand Down
10 changes: 5 additions & 5 deletions examples/all-clusters-app/ameba/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
if (data->isReadAttribute)
{
// It should always enter here if isReadAttribute is true
if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -82,7 +82,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
}
else
{
if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -103,7 +103,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand Down Expand Up @@ -190,7 +190,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_MULTICAST_BINDING;
entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand All @@ -205,7 +205,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_UNICAST_BINDING;
entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/nxp/mw320/binding-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
using namespace chip;
using namespace chip::app;

if (binding.type == EMBER_MULTICAST_BINDING)
if (binding.type == MATTER_MULTICAST_BINDING)
{
ChipLogError(NotSpecified, "Group binding is not supported now");
return;
}

if (binding.type == EMBER_UNICAST_BINDING && binding.local == 1 &&
if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
{
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
Expand Down
8 changes: 4 additions & 4 deletions examples/light-switch-app/ameba/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast<BindingCommandData *>(context);

if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -122,7 +122,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand Down Expand Up @@ -246,7 +246,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_MULTICAST_BINDING;
entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand All @@ -261,7 +261,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_UNICAST_BINDING;
entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand Down
14 changes: 7 additions & 7 deletions examples/light-switch-app/asr/src/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & aB
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingData * data = static_cast<BindingData *>(context);

if (aBinding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
if (aBinding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
Expand All @@ -214,7 +214,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & aB
break;
}
}
else if (aBinding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
else if (aBinding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
Expand Down Expand Up @@ -255,7 +255,7 @@ bool BindingHandler::IsGroupBound()

for (auto & entry : bindingTable)
{
if (EMBER_MULTICAST_BINDING == entry.type)
if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
Expand All @@ -273,7 +273,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
case EMBER_UNICAST_BINDING:
case MATTER_UNICAST_BINDING:
ASR_LOG("[%d] UNICAST:", i++);
ASR_LOG("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
Expand All @@ -283,18 +283,18 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
case EMBER_MULTICAST_BINDING:
case MATTER_MULTICAST_BINDING:
ASR_LOG("[%d] GROUP:", i++);
ASR_LOG("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
\t+ RemoteEndpointId %d \n \
\t+ GroupId %d",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
case EMBER_UNUSED_BINDING:
case MATTER_UNUSED_BINDING:
ASR_LOG("[%d] UNUSED", i++);
break;
// case EMBER_MANY_TO_ONE_BINDING:
// case MATTER_MANY_TO_ONE_BINDING:
// ASR_LOG("[%d] MANY TO ONE", i++);
// break;
default:
Expand Down
8 changes: 4 additions & 4 deletions examples/light-switch-app/esp32/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast<BindingCommandData *>(context);

if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -118,7 +118,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand Down Expand Up @@ -244,7 +244,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_MULTICAST_BINDING;
entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand All @@ -259,7 +259,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_UNICAST_BINDING;
entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand Down
8 changes: 4 additions & 4 deletions examples/light-switch-app/genio/src/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
// Eason+
ChipLogDetail(AppServer, "LightSwitchChangedHandler~~~~~~~");

if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -128,7 +128,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand Down Expand Up @@ -243,7 +243,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 2, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_MULTICAST_BINDING;
entry->type = MATTER_MULTICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand All @@ -258,7 +258,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_UNICAST_BINDING;
entry->type = MATTER_UNICAST_BINDING;
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
entry->local = 1; // Hardcoded to endpoint 1 for now
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ CHIP_ERROR GroupBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 3, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_MULTICAST_BINDING;
entry->type = MATTER_MULTICAST_BINDING;
entry->local = 1; // Hardcoded to endpoint 1 for now
entry->fabricIndex = atoi(argv[0]);
entry->groupId = atoi(argv[1]);
Expand All @@ -379,7 +379,7 @@ CHIP_ERROR UnicastBindCommandHandler(int argc, char ** argv)
VerifyOrReturnError(argc == 4, CHIP_ERROR_INVALID_ARGUMENT);

EmberBindingTableEntry * entry = Platform::New<EmberBindingTableEntry>();
entry->type = EMBER_UNICAST_BINDING;
entry->type = MATTER_UNICAST_BINDING;
entry->local = 1; // Hardcoded to endpoint 1 for now
entry->fabricIndex = atoi(argv[0]);
entry->nodeId = atoi(argv[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
VerifyOrReturn(context != nullptr, printf("Invalid context for Light switch handler\n"););
BindingData * data = static_cast<BindingData *>(context);

if (binding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
Expand All @@ -228,7 +228,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
Expand Down Expand Up @@ -281,7 +281,7 @@ bool BindingHandler::IsGroupBound()

for (auto & entry : bindingTable)
{
if (EMBER_MULTICAST_BINDING == entry.type)
if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
Expand All @@ -299,7 +299,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
case EMBER_UNICAST_BINDING:
case MATTER_UNICAST_BINDING:
printf("[%d] UNICAST:", i++);
printf("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
Expand All @@ -309,15 +309,15 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
case EMBER_MULTICAST_BINDING:
case MATTER_MULTICAST_BINDING:
printf("[%d] GROUP:", i++);
printf("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
\t+ RemoteEndpointId %d \n \
\t+ GroupId %d \n",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
case EMBER_UNUSED_BINDING:
case MATTER_UNUSED_BINDING:
printf("[%d] UNUSED", i++);
break;
default:
Expand Down
12 changes: 6 additions & 6 deletions examples/light-switch-app/nrfconnect/main/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
VerifyOrReturn(context != nullptr, LOG_ERR("Invalid context for Light switch handler"););
BindingData * data = static_cast<BindingData *>(context);

if (binding.type == EMBER_MULTICAST_BINDING && data->IsGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->IsGroup)
{
switch (data->ClusterId)
{
Expand All @@ -213,7 +213,7 @@ void BindingHandler::LightSwitchChangedHandler(const EmberBindingTableEntry & bi
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->IsGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->IsGroup)
{
switch (data->ClusterId)
{
Expand Down Expand Up @@ -259,7 +259,7 @@ bool BindingHandler::IsGroupBound()

for (auto & entry : bindingTable)
{
if (EMBER_MULTICAST_BINDING == entry.type)
if (MATTER_MULTICAST_BINDING == entry.type)
{
return true;
}
Expand All @@ -277,7 +277,7 @@ void BindingHandler::PrintBindingTable()
{
switch (entry.type)
{
case EMBER_UNICAST_BINDING:
case MATTER_UNICAST_BINDING:
LOG_INF("[%d] UNICAST:", i++);
LOG_INF("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
Expand All @@ -287,15 +287,15 @@ void BindingHandler::PrintBindingTable()
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
(int) entry.nodeId);
break;
case EMBER_MULTICAST_BINDING:
case MATTER_MULTICAST_BINDING:
LOG_INF("[%d] GROUP:", i++);
LOG_INF("\t\t+ Fabric: %d\n \
\t+ LocalEndpoint %d \n \
\t+ RemoteEndpointId %d \n \
\t+ GroupId %d",
(int) entry.fabricIndex, (int) entry.local, (int) entry.remote, (int) entry.groupId);
break;
case EMBER_UNUSED_BINDING:
case MATTER_UNUSED_BINDING:
LOG_INF("[%d] UNUSED", i++);
break;
default:
Expand Down
2 changes: 1 addition & 1 deletion examples/light-switch-app/qpg/src/binding-handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Op

BindingCommandData * data = static_cast<BindingCommandData *>(context);

if (binding.type == EMBER_UNICAST_BINDING)
if (binding.type == MATTER_UNICAST_BINDING)
{
switch (data->clusterId)
{
Expand Down
4 changes: 2 additions & 2 deletions examples/light-switch-app/silabs/src/BindingHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
VerifyOrReturn(context != nullptr, ChipLogError(NotSpecified, "OnDeviceConnectedFn: context is null"));
BindingCommandData * data = static_cast<BindingCommandData *>(context);

if (binding.type == EMBER_MULTICAST_BINDING && data->isGroup)
if (binding.type == MATTER_MULTICAST_BINDING && data->isGroup)
{
switch (data->clusterId)
{
Expand All @@ -99,7 +99,7 @@ void LightSwitchChangedHandler(const EmberBindingTableEntry & binding, Operation
break;
}
}
else if (binding.type == EMBER_UNICAST_BINDING && !data->isGroup)
else if (binding.type == MATTER_UNICAST_BINDING && !data->isGroup)
{
switch (data->clusterId)
{
Expand Down
Loading

0 comments on commit 58bf8e1

Please sign in to comment.