Skip to content

Commit 69d8585

Browse files
andy31415andreilitvinbzbarsky-apple
authored
Convert a few more items to std::optional (#33073)
* Update minmdns resource record to use std optional * Convert a few more things to std::optional. Binding table * Restyle * Move some group data provider to std::optional * Slight logic fix * Fix a few more binding handler logics * More compile fixes * Fix castingserver.cpp * Fix CastingShellCommands.cpp * Restyle * A few more casting file updates for bindings * Fix some more value setting for clusterid for bindings * Update examples/light-switch-app/asr/src/BindingHandler.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Update examples/light-switch-app/nrfconnect/main/BindingHandler.cpp Co-authored-by: Boris Zbarsky <bzbarsky@apple.com> * Restyle --------- Co-authored-by: Andrei Litvin <andreilitvin@google.com> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent 2fcac2e commit 69d8585

29 files changed

+96
-76
lines changed

examples/all-clusters-app/all-clusters-common/src/binding-handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
8080
}
8181

8282
if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
83-
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
83+
binding.clusterId.value_or(Clusters::OnOff::Id) == Clusters::OnOff::Id)
8484
{
8585
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
8686
ChipLogProgress(NotSpecified, "OnOff command succeeds");

examples/all-clusters-app/ameba/main/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
194194
entry->fabricIndex = atoi(argv[0]);
195195
entry->groupId = atoi(argv[1]);
196196
entry->local = 1; // Hardcoded to endpoint 1 for now
197-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
197+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
198198

199199
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
200200
return CHIP_NO_ERROR;
@@ -210,7 +210,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
210210
entry->nodeId = atoi(argv[1]);
211211
entry->local = 1; // Hardcoded to endpoint 1 for now
212212
entry->remote = atoi(argv[2]);
213-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
213+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
214214

215215
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
216216
return CHIP_NO_ERROR;

examples/all-clusters-app/nxp/mw320/binding-handler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static void BoundDeviceChangedHandler(const EmberBindingTableEntry & binding, ch
8181
}
8282

8383
if (binding.type == MATTER_UNICAST_BINDING && binding.local == 1 &&
84-
(!binding.clusterId.HasValue() || binding.clusterId.Value() == Clusters::OnOff::Id))
84+
binding.clusterId.value_or(Clusters::OnOff::Id) == Clusters::OnOff::Id)
8585
{
8686
auto onSuccess = [](const ConcreteCommandPath & commandPath, const StatusIB & status, const auto & dataResponse) {
8787
ChipLogProgress(NotSpecified, "OnOff command succeeds");

examples/light-switch-app/ameba/main/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
250250
entry->fabricIndex = atoi(argv[0]);
251251
entry->groupId = atoi(argv[1]);
252252
entry->local = 1; // Hardcoded to endpoint 1 for now
253-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
253+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
254254

255255
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
256256
return CHIP_NO_ERROR;
@@ -266,7 +266,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
266266
entry->nodeId = atoi(argv[1]);
267267
entry->local = 1; // Hardcoded to endpoint 1 for now
268268
entry->remote = atoi(argv[2]);
269-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
269+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
270270

271271
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
272272
return CHIP_NO_ERROR;

examples/light-switch-app/asr/src/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,8 @@ void BindingHandler::PrintBindingTable()
280280
\t+ ClusterId %d \n \
281281
\t+ RemoteEndpointId %d \n \
282282
\t+ NodeId %d",
283-
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
284-
(int) entry.nodeId);
283+
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.value_or(kInvalidClusterId),
284+
(int) entry.remote, (int) entry.nodeId);
285285
break;
286286
case MATTER_MULTICAST_BINDING:
287287
ASR_LOG("[%d] GROUP:", i++);

examples/light-switch-app/esp32/main/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
248248
entry->fabricIndex = atoi(argv[0]);
249249
entry->groupId = atoi(argv[1]);
250250
entry->local = 1; // Hardcoded to endpoint 1 for now
251-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
251+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
252252

253253
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
254254
return CHIP_NO_ERROR;
@@ -264,7 +264,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
264264
entry->nodeId = atoi(argv[1]);
265265
entry->local = 1; // Hardcoded to endpoint 1 for now
266266
entry->remote = atoi(argv[2]);
267-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
267+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
268268

269269
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
270270
return CHIP_NO_ERROR;

examples/light-switch-app/genio/src/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
247247
entry->fabricIndex = atoi(argv[0]);
248248
entry->groupId = atoi(argv[1]);
249249
entry->local = 1; // Hardcoded to endpoint 1 for now
250-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
250+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
251251

252252
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
253253
return CHIP_NO_ERROR;
@@ -263,7 +263,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
263263
entry->nodeId = atoi(argv[1]);
264264
entry->local = 1; // Hardcoded to endpoint 1 for now
265265
entry->remote = atoi(argv[2]);
266-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
266+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
267267

268268
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
269269
return CHIP_NO_ERROR;

examples/light-switch-app/infineon/cyw30739/src/AppShellCommands.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ CHIP_ERROR GroupBindCommandHandler(int argc, char ** argv)
365365
entry->local = 1; // Hardcoded to endpoint 1 for now
366366
entry->fabricIndex = atoi(argv[0]);
367367
entry->groupId = atoi(argv[1]);
368-
entry->clusterId.SetValue(atoi(argv[3]));
368+
entry->clusterId.emplace(atoi(argv[3]));
369369

370370
DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::BindingWorkerHandler, reinterpret_cast<intptr_t>(entry));
371371
return CHIP_NO_ERROR;
@@ -384,7 +384,7 @@ CHIP_ERROR UnicastBindCommandHandler(int argc, char ** argv)
384384
entry->fabricIndex = atoi(argv[0]);
385385
entry->nodeId = atoi(argv[1]);
386386
entry->remote = atoi(argv[2]);
387-
entry->clusterId.SetValue(atoi(argv[3]));
387+
entry->clusterId.emplace(atoi(argv[3]));
388388

389389
DeviceLayer::PlatformMgr().ScheduleWork(BindingHandler::BindingWorkerHandler, reinterpret_cast<intptr_t>(entry));
390390
return CHIP_NO_ERROR;

examples/light-switch-app/infineon/cyw30739/src/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,8 @@ void BindingHandler::PrintBindingTable()
306306
\t+ ClusterId %d \n \
307307
\t+ RemoteEndpointId %d \n \
308308
\t+ NodeId %d \n",
309-
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
310-
(int) entry.nodeId);
309+
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.value_or(kInvalidClusterId),
310+
(int) entry.remote, (int) entry.nodeId);
311311
break;
312312
case MATTER_MULTICAST_BINDING:
313313
printf("[%d] GROUP:", i++);

examples/light-switch-app/nrfconnect/main/BindingHandler.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ void BindingHandler::PrintBindingTable()
284284
\t+ ClusterId %d \n \
285285
\t+ RemoteEndpointId %d \n \
286286
\t+ NodeId %d",
287-
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.Value(), (int) entry.remote,
288-
(int) entry.nodeId);
287+
(int) entry.fabricIndex, (int) entry.local, (int) entry.clusterId.value_or(kInvalidClusterId),
288+
(int) entry.remote, (int) entry.nodeId);
289289
break;
290290
case MATTER_MULTICAST_BINDING:
291291
LOG_INF("[%d] GROUP:", i++);

examples/light-switch-app/silabs/src/ShellCommands.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
143143
entry->fabricIndex = atoi(argv[0]);
144144
entry->groupId = atoi(argv[1]);
145145
entry->local = 1; // Hardcoded to endpoint 1 for now
146-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
146+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
147147

148148
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
149149
return CHIP_NO_ERROR;
@@ -159,7 +159,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
159159
entry->nodeId = atoi(argv[1]);
160160
entry->local = 1; // Hardcoded to endpoint 1 for now
161161
entry->remote = atoi(argv[2]);
162-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
162+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
163163

164164
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
165165
return CHIP_NO_ERROR;

examples/light-switch-app/telink/src/binding-handler.cpp

100755100644
+2-2
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ CHIP_ERROR BindingGroupBindCommandHandler(int argc, char ** argv)
243243
entry->fabricIndex = atoi(argv[0]);
244244
entry->groupId = atoi(argv[1]);
245245
entry->local = 1; // Hardcoded to endpoint 1 for now
246-
entry->clusterId.SetValue(6); // Hardcoded to OnOff cluster for now
246+
entry->clusterId.emplace(6); // Hardcoded to OnOff cluster for now
247247

248248
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
249249
return CHIP_NO_ERROR;
@@ -259,7 +259,7 @@ CHIP_ERROR BindingUnicastBindCommandHandler(int argc, char ** argv)
259259
entry->nodeId = atoi(argv[1]);
260260
entry->local = 1; // Hardcoded to endpoint 1 for now
261261
entry->remote = atoi(argv[2]);
262-
entry->clusterId.SetValue(6); // Hardcode to OnOff cluster for now
262+
entry->clusterId.emplace(6); // Hardcode to OnOff cluster for now
263263

264264
DeviceLayer::PlatformMgr().ScheduleWork(BindingWorkerFunction, reinterpret_cast<intptr_t>(entry));
265265
return CHIP_NO_ERROR;

examples/tv-casting-app/linux/CastingShellCommands.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void PrintBindings()
9191
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
9292
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
9393
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
94-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
94+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
9595
}
9696
}
9797

examples/tv-casting-app/linux/simple-app-helper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ void PrintBindings()
294294
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
295295
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
296296
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
297-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
297+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
298298
}
299299
}
300300

examples/tv-casting-app/tv-casting-common/src/CastingServer.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void CastingServer::ReadServerClustersForNode(NodeId nodeId)
312312
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
313313
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
314314
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
315-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
315+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
316316
if (binding.type == MATTER_UNICAST_BINDING && nodeId == binding.nodeId)
317317
{
318318
if (!mActiveTargetVideoPlayerInfo.HasEndpoint(binding.remote))
@@ -584,7 +584,7 @@ void CastingServer::DeviceEventCallback(const DeviceLayer::ChipDeviceEvent * eve
584584
"CastingServer::DeviceEventCallback Read cached binding type=%d fabrixIndex=%d nodeId=0x" ChipLogFormatX64
585585
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
586586
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
587-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
587+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
588588
if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
589589
{
590590
ChipLogProgress(
@@ -675,7 +675,7 @@ NodeId CastingServer::GetVideoPlayerNodeForFabricIndex(FabricIndex fabricIndex)
675675
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
676676
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
677677
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
678-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
678+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
679679
if (binding.type == MATTER_UNICAST_BINDING && fabricIndex == binding.fabricIndex)
680680
{
681681
ChipLogProgress(NotSpecified, "GetVideoPlayerNodeForFabricIndex nodeId=0x" ChipLogFormatX64,
@@ -701,7 +701,7 @@ FabricIndex CastingServer::GetVideoPlayerFabricIndexForNode(NodeId nodeId)
701701
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
702702
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
703703
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
704-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
704+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
705705
if (binding.type == MATTER_UNICAST_BINDING && nodeId == binding.nodeId)
706706
{
707707
ChipLogProgress(NotSpecified, "GetVideoPlayerFabricIndexForNode fabricIndex=%d nodeId=0x" ChipLogFormatX64,

examples/tv-casting-app/tv-casting-common/support/ChipDeviceEventHandler.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void ChipDeviceEventHandler::HandleBindingsChangedViaCluster(const chip::DeviceL
155155
"nodeId=0x" ChipLogFormatX64
156156
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
157157
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
158-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
158+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
159159
if (binding.type == MATTER_UNICAST_BINDING && event->BindingsChanged.fabricIndex == binding.fabricIndex)
160160
{
161161
ChipLogProgress(AppServer,

examples/tv-casting-app/tv-casting-common/support/EndpointListLoader.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ CHIP_ERROR EndpointListLoader::Load()
8686
"Binding type=%d fab=%d nodeId=0x" ChipLogFormatX64
8787
" groupId=%d local endpoint=%d remote endpoint=%d cluster=" ChipLogFormatMEI,
8888
binding.type, binding.fabricIndex, ChipLogValueX64(binding.nodeId), binding.groupId, binding.local,
89-
binding.remote, ChipLogValueMEI(binding.clusterId.ValueOr(0)));
89+
binding.remote, ChipLogValueMEI(binding.clusterId.value_or(0)));
9090
if (binding.type == MATTER_UNICAST_BINDING && CastingPlayer::GetTargetCastingPlayer()->GetNodeId() == binding.nodeId)
9191
{
9292
// if we discovered a new Endpoint from the bindings, read its EndpointAttributes

src/app/clusters/bindings/BindingManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ CHIP_ERROR BindingManager::NotifyBoundClusterChanged(EndpointId endpoint, Cluste
185185

186186
for (auto iter = BindingTable::GetInstance().begin(); iter != BindingTable::GetInstance().end(); ++iter)
187187
{
188-
if (iter->local == endpoint && (!iter->clusterId.HasValue() || iter->clusterId.Value() == cluster))
188+
if (iter->local == endpoint && (iter->clusterId.value_or(cluster) == cluster))
189189
{
190190
if (iter->type == MATTER_UNICAST_BINDING)
191191
{

src/app/clusters/bindings/bindings.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,13 @@ CHIP_ERROR CreateBindingEntry(const TargetStructType & entry, EndpointId localEn
125125

126126
if (entry.group.HasValue())
127127
{
128-
bindingEntry = EmberBindingTableEntry::ForGroup(entry.fabricIndex, entry.group.Value(), localEndpoint, entry.cluster);
128+
bindingEntry =
129+
EmberBindingTableEntry::ForGroup(entry.fabricIndex, entry.group.Value(), localEndpoint, entry.cluster.std_optional());
129130
}
130131
else
131132
{
132133
bindingEntry = EmberBindingTableEntry::ForNode(entry.fabricIndex, entry.node.Value(), localEndpoint, entry.endpoint.Value(),
133-
entry.cluster);
134+
entry.cluster.std_optional());
134135
}
135136

136137
return AddBindingEntry(bindingEntry);
@@ -159,7 +160,7 @@ CHIP_ERROR BindingTableAccess::ReadBindingTable(EndpointId endpoint, AttributeVa
159160
.node = MakeOptional(entry.nodeId),
160161
.group = NullOptional,
161162
.endpoint = MakeOptional(entry.remote),
162-
.cluster = entry.clusterId,
163+
.cluster = FromStdOptional(entry.clusterId),
163164
.fabricIndex = entry.fabricIndex,
164165
};
165166
ReturnErrorOnFailure(subEncoder.Encode(value));
@@ -170,7 +171,7 @@ CHIP_ERROR BindingTableAccess::ReadBindingTable(EndpointId endpoint, AttributeVa
170171
.node = NullOptional,
171172
.group = MakeOptional(entry.groupId),
172173
.endpoint = NullOptional,
173-
.cluster = entry.clusterId,
174+
.cluster = FromStdOptional(entry.clusterId),
174175
.fabricIndex = entry.fabricIndex,
175176
};
176177
ReturnErrorOnFailure(subEncoder.Encode(value));

src/app/clusters/group-key-mgmt-server/group-key-mgmt-server.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct GroupTableCodec
8484
TLV::TLVType inner;
8585
ReturnErrorOnFailure(writer.StartContainer(TagEndpoints(), TLV::kTLVType_Array, inner));
8686
GroupDataProvider::GroupEndpoint mapping;
87-
auto iter = mProvider->IterateEndpoints(mFabric, MakeOptional(mInfo.group_id));
87+
auto iter = mProvider->IterateEndpoints(mFabric, std::make_optional(mInfo.group_id));
8888
if (nullptr != iter)
8989
{
9090
while (iter->Next(mapping))

0 commit comments

Comments
 (0)