Skip to content

Commit b9feff9

Browse files
committed
Fix errors due to CHIP_ERROR default constructor no longer being trivial
1 parent aa3d8d2 commit b9feff9

11 files changed

+90
-117
lines changed

src/app/FailSafeContext.cpp

+5-6
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,11 @@ void FailSafeContext::ScheduleFailSafeCleanup(FabricIndex fabricIndex, bool addN
8585

8686
SetFailSafeArmed(false);
8787

88-
ChipDeviceEvent event;
89-
event.Type = DeviceEventType::kFailSafeTimerExpired;
90-
event.FailSafeTimerExpired.fabricIndex = fabricIndex;
91-
event.FailSafeTimerExpired.addNocCommandHasBeenInvoked = addNocCommandInvoked;
92-
event.FailSafeTimerExpired.updateNocCommandHasBeenInvoked = updateNocCommandInvoked;
93-
CHIP_ERROR status = PlatformMgr().PostEvent(&event);
88+
ChipDeviceEvent event{ .Type = DeviceEventType::kFailSafeTimerExpired,
89+
.FailSafeTimerExpired = { .fabricIndex = fabricIndex,
90+
.addNocCommandHasBeenInvoked = addNocCommandInvoked,
91+
.updateNocCommandHasBeenInvoked = updateNocCommandInvoked } };
92+
CHIP_ERROR status = PlatformMgr().PostEvent(&event);
9493

9594
if (status != CHIP_NO_ERROR)
9695
{

src/app/clusters/bindings/bindings.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,8 @@ CHIP_ERROR BindingTableAccess::WriteBindingTable(const ConcreteDataAttributePath
258258

259259
CHIP_ERROR BindingTableAccess::NotifyBindingsChanged()
260260
{
261-
DeviceLayer::ChipDeviceEvent event;
262-
event.Type = DeviceLayer::DeviceEventType::kBindingsChangedViaCluster;
263-
event.BindingsChanged.fabricIndex = mAccessingFabricIndex;
261+
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kBindingsChangedViaCluster,
262+
.BindingsChanged = { .fabricIndex = mAccessingFabricIndex } };
264263
return chip::DeviceLayer::PlatformMgr().PostEvent(&event);
265264
}
266265

src/include/platform/CHIPDeviceEvent.h

-1
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ struct ChipDeviceEvent final
530530
} OtaStateChanged;
531531
};
532532

533-
void Clear() { memset(this, 0, sizeof(*this)); }
534533
bool IsPublic() const { return DeviceEventType::IsPublic(Type); }
535534
bool IsInternal() const { return DeviceEventType::IsInternal(Type); }
536535
bool IsPlatformSpecific() const { return DeviceEventType::IsPlatformSpecific(Type); }

src/include/platform/internal/GenericConnectivityManagerImpl_Thread.ipp

+6-7
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ void GenericConnectivityManagerImpl_Thread<ImplClass>::UpdateServiceConnectivity
7070
mFlags.Set(Flags::kHaveServiceConnectivity, haveServiceConnectivity);
7171

7272
{
73-
ChipDeviceEvent event;
74-
event.Clear();
75-
event.Type = DeviceEventType::kServiceConnectivityChange;
76-
event.ServiceConnectivityChange.ViaThread.Result =
77-
(haveServiceConnectivity) ? kConnectivity_Established : kConnectivity_Lost;
78-
event.ServiceConnectivityChange.Overall.Result = event.ServiceConnectivityChange.ViaThread.Result;
79-
CHIP_ERROR status = PlatformMgr().PostEvent(&event);
73+
ChipDeviceEvent event{ .Type = DeviceEventType::kServiceConnectivityChange,
74+
.ServiceConnectivityChange = {
75+
.Overall = { .Result = event.ServiceConnectivityChange.ViaThread.Result },
76+
.ViaThread = { .Result = (haveServiceConnectivity) ? kConnectivity_Established
77+
: kConnectivity_Lost } } };
78+
CHIP_ERROR status = PlatformMgr().PostEvent(&event);
8079
if (status != CHIP_NO_ERROR)
8180
{
8281
ChipLogError(DeviceLayer, "Failed to post thread connectivity change: %" CHIP_ERROR_FORMAT, status.Format());

src/lib/core/CHIPError.h

+21-13
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
#if __cplusplus >= 202002L
3939
#include <source_location>
40-
#endif // __cplusplus >= 202002L
40+
#endif // __cplusplus >= 202002L
4141

4242
namespace chip {
4343

@@ -120,8 +120,8 @@ class ChipError
120120
#define CHIP_INITIALIZE_ERROR_SOURCE(f, l, loc) , mFile((f)), mLine((l)), mSourceLocation((loc))
121121
#else
122122
#define CHIP_INITIALIZE_ERROR_SOURCE(f, l) , mFile((f)), mLine((l))
123-
#endif // __cplusplus >= 202002L
124-
#else // CHIP_CONFIG_ERROR_SOURCE
123+
#endif // __cplusplus >= 202002L
124+
#else // CHIP_CONFIG_ERROR_SOURCE
125125
#define CHIP_INITIALIZE_ERROR_SOURCE(f, l)
126126
#endif // CHIP_CONFIG_ERROR_SOURCE
127127

@@ -133,9 +133,11 @@ class ChipError
133133
*/
134134
#if __cplusplus >= 202002L
135135
constexpr ChipError(Range range, ValueType value) :
136-
mError(MakeInteger(range, (value & MakeMask(0, kValueLength)))) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location())
136+
mError(MakeInteger(range, (value & MakeMask(0, kValueLength))))
137+
CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location())
137138
{}
138-
constexpr ChipError(Range range, ValueType value, const char * file, unsigned int line, std::source_location location = std::source_location::current()) :
139+
constexpr ChipError(Range range, ValueType value, const char * file, unsigned int line,
140+
std::source_location location = std::source_location::current()) :
139141
mError(MakeInteger(range, (value & MakeMask(0, kValueLength)))) CHIP_INITIALIZE_ERROR_SOURCE(file, line, location)
140142
{}
141143
#else
@@ -154,15 +156,17 @@ class ChipError
154156
* The macro version CHIP_SDK_ERROR checks that the numeric value is constant and well-formed.
155157
*/
156158
#if __cplusplus >= 202002L
157-
constexpr ChipError(SdkPart part, uint8_t code) : mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location()) {}
158-
constexpr ChipError(SdkPart part, uint8_t code, const char * file, unsigned int line, std::source_location location = std::source_location::current()) :
159+
constexpr ChipError(SdkPart part, uint8_t code) :
160+
mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location())
161+
{}
162+
constexpr ChipError(SdkPart part, uint8_t code, const char * file, unsigned int line,
163+
std::source_location location = std::source_location::current()) :
159164
mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(file, line, location)
160165
{}
161166
#else
162167
constexpr ChipError(SdkPart part, uint8_t code) : mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0) {}
163168
constexpr ChipError(SdkPart part, uint8_t code, const char * file, unsigned int line) :
164-
mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(file, line)
165-
{}
169+
mError(MakeInteger(part, code)) CHIP_INITIALIZE_ERROR_SOURCE(file, line){}
166170
#endif // __cplusplus >= 202002L
167171

168172
/**
@@ -184,12 +188,16 @@ class ChipError
184188
* This is intended to be used only in foreign function interfaces.
185189
*/
186190
#if __cplusplus >= 202002L
187-
explicit constexpr ChipError(StorageType error) : mError(error) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location()) {}
188-
explicit constexpr ChipError(StorageType error, const char * file, unsigned int line, std::source_location location = std::source_location::current()) :
191+
explicit constexpr ChipError(StorageType error) : mError(error) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0, std::source_location())
192+
{}
193+
explicit constexpr ChipError(StorageType error, const char * file, unsigned int line,
194+
std::source_location location = std::source_location::current()) :
189195
mError(error) CHIP_INITIALIZE_ERROR_SOURCE(file, line, location)
190196
{}
191197
#else
192-
explicit constexpr ChipError(StorageType error) : mError(error) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0) {}
198+
explicit constexpr ChipError(StorageType error) : mError(error) CHIP_INITIALIZE_ERROR_SOURCE(nullptr, 0)
199+
{
200+
}
193201
explicit constexpr ChipError(StorageType error, const char * file, unsigned int line) :
194202
mError(error) CHIP_INITIALIZE_ERROR_SOURCE(file, line)
195203
{}
@@ -398,7 +406,7 @@ class ChipError
398406
unsigned int mLine;
399407
#if __cplusplus >= 202002L
400408
std::source_location mSourceLocation;
401-
#endif // __cplusplus >= 202002L
409+
#endif // __cplusplus >= 202002L
402410
#endif // CHIP_CONFIG_ERROR_SOURCE
403411

404412
public:

src/platform/DeviceControlServer.cpp

+10-14
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ DeviceControlServer & DeviceControlServer::DeviceControlSvr()
3636

3737
CHIP_ERROR DeviceControlServer::PostCommissioningCompleteEvent(NodeId peerNodeId, FabricIndex accessingFabricIndex)
3838
{
39-
ChipDeviceEvent event;
39+
ChipDeviceEvent event{
4040

41-
event.Type = DeviceEventType::kCommissioningComplete;
42-
event.CommissioningComplete.nodeId = peerNodeId;
43-
event.CommissioningComplete.fabricIndex = accessingFabricIndex;
41+
.Type = DeviceEventType::kCommissioningComplete,
42+
.CommissioningComplete = { .nodeId = peerNodeId, .fabricIndex = accessingFabricIndex }
43+
};
4444

4545
return PlatformMgr().PostEvent(&event);
4646
}
@@ -66,31 +66,27 @@ CHIP_ERROR DeviceControlServer::SetRegulatoryConfig(uint8_t location, const Char
6666

6767
CHIP_ERROR DeviceControlServer::PostConnectedToOperationalNetworkEvent(ByteSpan networkID)
6868
{
69-
ChipDeviceEvent event;
70-
event.Type = DeviceEventType::kOperationalNetworkEnabled;
71-
// TODO(cecille): This should be some way to specify thread or wifi.
72-
event.OperationalNetwork.network = 0;
69+
ChipDeviceEvent event{ .Type = DeviceEventType::kOperationalNetworkEnabled,
70+
// TODO(cecille): This should be some way to specify thread or wifi.
71+
.OperationalNetwork = { .network = 0 } };
7372
return PlatformMgr().PostEvent(&event);
7473
}
7574

7675
CHIP_ERROR DeviceControlServer::PostCloseAllBLEConnectionsToOperationalNetworkEvent()
7776
{
78-
ChipDeviceEvent event;
79-
event.Type = DeviceEventType::kCloseAllBleConnections;
77+
ChipDeviceEvent event{ .Type = DeviceEventType::kCloseAllBleConnections };
8078
return PlatformMgr().PostEvent(&event);
8179
}
8280

8381
CHIP_ERROR DeviceControlServer::PostWiFiDeviceAvailableNetworkEvent()
8482
{
85-
ChipDeviceEvent event;
86-
event.Type = DeviceEventType::kWiFiDeviceAvailable;
83+
ChipDeviceEvent event{ .Type = DeviceEventType::kWiFiDeviceAvailable };
8784
return PlatformMgr().PostEvent(&event);
8885
}
8986

9087
CHIP_ERROR DeviceControlServer::PostOperationalNetworkStartedEvent()
9188
{
92-
ChipDeviceEvent event;
93-
event.Type = DeviceEventType::kOperationalNetworkStarted;
89+
ChipDeviceEvent event{ .Type = DeviceEventType::kOperationalNetworkStarted };
9490
return PlatformMgr().PostEvent(&event);
9591
}
9692

src/platform/Linux/BLEManagerImpl.cpp

+32-50
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,7 @@ void BLEManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
218218
case DeviceEventType::kCHIPoBLESubscribe:
219219
HandleSubscribeReceived(event->CHIPoBLESubscribe.ConId, &CHIP_BLE_SVC_ID, &ChipUUID_CHIPoBLEChar_TX);
220220
{
221-
ChipDeviceEvent connectionEvent;
222-
connectionEvent.Type = DeviceEventType::kCHIPoBLEConnectionEstablished;
221+
ChipDeviceEvent connectionEvent{ .Type = DeviceEventType::kCHIPoBLEConnectionEstablished };
223222
PlatformMgr().PostEventOrDie(&connectionEvent);
224223
}
225224
break;
@@ -465,9 +464,8 @@ void BLEManagerImpl::HandleNewConnection(BLE_CONNECTION_OBJECT conId)
465464
{
466465
if (sInstance.mIsCentral)
467466
{
468-
ChipDeviceEvent event;
469-
event.Type = DeviceEventType::kPlatformLinuxBLECentralConnected;
470-
event.Platform.BLECentralConnected.mConnection = conId;
467+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLECentralConnected,
468+
.Platform = { .BLECentralConnected = { .mConnection = conId } } };
471469
PlatformMgr().PostEventOrDie(&event);
472470
}
473471
}
@@ -476,27 +474,23 @@ void BLEManagerImpl::HandleConnectFailed(CHIP_ERROR error)
476474
{
477475
if (sInstance.mIsCentral)
478476
{
479-
ChipDeviceEvent event;
480-
event.Type = DeviceEventType::kPlatformLinuxBLECentralConnectFailed;
481-
event.Platform.BLECentralConnectFailed.mError = error;
477+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLECentralConnectFailed,
478+
.Platform = { .BLECentralConnectFailed = { .mError = error } } };
482479
PlatformMgr().PostEventOrDie(&event);
483480
}
484481
}
485482

486483
void BLEManagerImpl::HandleWriteComplete(BLE_CONNECTION_OBJECT conId)
487484
{
488-
ChipDeviceEvent event;
489-
event.Type = DeviceEventType::kPlatformLinuxBLEWriteComplete;
490-
event.Platform.BLEWriteComplete.mConnection = conId;
485+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEWriteComplete,
486+
.Platform = { .BLEWriteComplete = { .mConnection = conId } } };
491487
PlatformMgr().PostEventOrDie(&event);
492488
}
493489

494490
void BLEManagerImpl::HandleSubscribeOpComplete(BLE_CONNECTION_OBJECT conId, bool subscribed)
495491
{
496-
ChipDeviceEvent event;
497-
event.Type = DeviceEventType::kPlatformLinuxBLESubscribeOpComplete;
498-
event.Platform.BLESubscribeOpComplete.mConnection = conId;
499-
event.Platform.BLESubscribeOpComplete.mIsSubscribed = subscribed;
492+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLESubscribeOpComplete,
493+
.Platform = { .BLESubscribeOpComplete = { .mConnection = conId, .mIsSubscribed = subscribed } } };
500494
PlatformMgr().PostEventOrDie(&event);
501495
}
502496

@@ -507,12 +501,12 @@ void BLEManagerImpl::HandleTXCharChanged(BLE_CONNECTION_OBJECT conId, const uint
507501

508502
ChipLogDetail(DeviceLayer, "Indication received, conn = %p", conId);
509503

504+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEIndicationReceived,
505+
.Platform = { .BLEIndicationReceived = { .mConnection = conId } } };
506+
510507
VerifyOrExit(!buf.IsNull(), err = CHIP_ERROR_NO_MEMORY);
511508

512-
ChipDeviceEvent event;
513-
event.Type = DeviceEventType::kPlatformLinuxBLEIndicationReceived;
514-
event.Platform.BLEIndicationReceived.mConnection = conId;
515-
event.Platform.BLEIndicationReceived.mData = std::move(buf).UnsafeRelease();
509+
event.Platform.BLEIndicationReceived.mData = std::move(buf).UnsafeRelease();
516510
PlatformMgr().PostEventOrDie(&event);
517511

518512
exit:
@@ -531,11 +525,9 @@ void BLEManagerImpl::HandleRXCharWrite(BLE_CONNECTION_OBJECT conId, const uint8_
531525

532526
// Post an event to the Chip queue to deliver the data into the Chip stack.
533527
{
534-
ChipDeviceEvent event;
535-
event.Type = DeviceEventType::kCHIPoBLEWriteReceived;
536528
ChipLogProgress(Ble, "Write request received debug %p", conId);
537-
event.CHIPoBLEWriteReceived.ConId = conId;
538-
event.CHIPoBLEWriteReceived.Data = std::move(buf).UnsafeRelease();
529+
ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEWriteReceived,
530+
.CHIPoBLEWriteReceived = { .ConId = conId, .Data = std::move(buf).UnsafeRelease() } };
539531
PlatformMgr().PostEventOrDie(&event);
540532
}
541533

@@ -552,10 +544,8 @@ void BLEManagerImpl::CHIPoBluez_ConnectionClosed(BLE_CONNECTION_OBJECT conId)
552544

553545
// If this was a CHIPoBLE connection, post an event to deliver a connection error to the CHIPoBLE layer.
554546
{
555-
ChipDeviceEvent event;
556-
event.Type = DeviceEventType::kCHIPoBLEConnectionError;
557-
event.CHIPoBLEConnectionError.ConId = conId;
558-
event.CHIPoBLEConnectionError.Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED;
547+
ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEConnectionError,
548+
.CHIPoBLEConnectionError = { .ConId = conId, .Reason = BLE_ERROR_REMOTE_DEVICE_DISCONNECTED } };
559549
PlatformMgr().PostEventOrDie(&event);
560550
}
561551
}
@@ -567,9 +557,9 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_CONNECTION_OBJECT conId)
567557

568558
// Post an event to the Chip queue to process either a CHIPoBLE Subscribe or Unsubscribe based on
569559
// whether the client is enabling or disabling indications.
570-
ChipDeviceEvent event;
571-
event.Type = conId->IsNotifyAcquired() ? DeviceEventType::kCHIPoBLESubscribe : DeviceEventType::kCHIPoBLEUnsubscribe;
572-
event.CHIPoBLESubscribe.ConId = conId;
560+
ChipDeviceEvent event{ .Type = conId->IsNotifyAcquired() ? DeviceEventType::kCHIPoBLESubscribe
561+
: DeviceEventType::kCHIPoBLEUnsubscribe,
562+
.CHIPoBLESubscribe = { .ConId = conId } };
573563
PlatformMgr().PostEventOrDie(&event);
574564

575565
ChipLogProgress(DeviceLayer, "CHIPoBLE %s received",
@@ -579,9 +569,7 @@ void BLEManagerImpl::HandleTXCharCCCDWrite(BLE_CONNECTION_OBJECT conId)
579569
void BLEManagerImpl::HandleTXComplete(BLE_CONNECTION_OBJECT conId)
580570
{
581571
// Post an event to the Chip queue to process the indicate confirmation.
582-
ChipDeviceEvent event;
583-
event.Type = DeviceEventType::kCHIPoBLEIndicateConfirm;
584-
event.CHIPoBLEIndicateConfirm.ConId = conId;
572+
ChipDeviceEvent event{ .Type = DeviceEventType::kCHIPoBLEIndicateConfirm, .CHIPoBLEIndicateConfirm = { .ConId = conId } };
585573
PlatformMgr().PostEventOrDie(&event);
586574
}
587575

@@ -822,50 +810,44 @@ CHIP_ERROR BLEManagerImpl::CancelConnection()
822810

823811
void BLEManagerImpl::NotifyBLEAdapterAdded(unsigned int aAdapterId, const char * aAdapterAddress)
824812
{
825-
ChipDeviceEvent event;
826-
event.Type = DeviceEventType::kPlatformLinuxBLEAdapterAdded;
827-
event.Platform.BLEAdapter.mAdapterId = aAdapterId;
813+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEAdapterAdded,
814+
.Platform = { .BLEAdapter = { .mAdapterId = aAdapterId } } };
828815
Platform::CopyString(event.Platform.BLEAdapter.mAdapterAddress, aAdapterAddress);
829816
PlatformMgr().PostEventOrDie(&event);
830817
}
831818

832819
void BLEManagerImpl::NotifyBLEAdapterRemoved(unsigned int aAdapterId, const char * aAdapterAddress)
833820
{
834-
ChipDeviceEvent event;
835-
event.Type = DeviceEventType::kPlatformLinuxBLEAdapterRemoved;
836-
event.Platform.BLEAdapter.mAdapterId = aAdapterId;
821+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEAdapterRemoved,
822+
.Platform = { .BLEAdapter = { .mAdapterId = aAdapterId } } };
837823
Platform::CopyString(event.Platform.BLEAdapter.mAdapterAddress, aAdapterAddress);
838824
PlatformMgr().PostEventOrDie(&event);
839825
}
840826

841827
void BLEManagerImpl::NotifyBLEPeripheralRegisterAppComplete(CHIP_ERROR error)
842828
{
843-
ChipDeviceEvent event;
844-
event.Type = DeviceEventType::kPlatformLinuxBLEPeripheralRegisterAppComplete;
845-
event.Platform.BLEPeripheralRegisterAppComplete.mError = error;
829+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEPeripheralRegisterAppComplete,
830+
.Platform = { .BLEPeripheralRegisterAppComplete = { .mError = error } } };
846831
PlatformMgr().PostEventOrDie(&event);
847832
}
848833

849834
void BLEManagerImpl::NotifyBLEPeripheralAdvStartComplete(CHIP_ERROR error)
850835
{
851-
ChipDeviceEvent event;
852-
event.Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvStartComplete;
853-
event.Platform.BLEPeripheralAdvStartComplete.mError = error;
836+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvStartComplete,
837+
.Platform = { .BLEPeripheralAdvStartComplete = { .mError = error } } };
854838
PlatformMgr().PostEventOrDie(&event);
855839
}
856840

857841
void BLEManagerImpl::NotifyBLEPeripheralAdvStopComplete(CHIP_ERROR error)
858842
{
859-
ChipDeviceEvent event;
860-
event.Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvStopComplete;
861-
event.Platform.BLEPeripheralAdvStopComplete.mError = error;
843+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvStopComplete,
844+
.Platform = { .BLEPeripheralAdvStopComplete = { .mError = error } } };
862845
PlatformMgr().PostEventOrDie(&event);
863846
}
864847

865848
void BLEManagerImpl::NotifyBLEPeripheralAdvReleased()
866849
{
867-
ChipDeviceEvent event;
868-
event.Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvReleased;
850+
ChipDeviceEvent event{ .Type = DeviceEventType::kPlatformLinuxBLEPeripheralAdvReleased };
869851
PlatformMgr().PostEventOrDie(&event);
870852
}
871853

0 commit comments

Comments
 (0)