Skip to content

Commit

Permalink
Don't use default ctor for ChipDeviceEvent (project-chip#36768)
Browse files Browse the repository at this point in the history
* Don't use default ctor for ChipDeviceEvent

* Restyled by clang-format

---------

Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
soares-sergio and restyled-commits authored Dec 10, 2024
1 parent 5d42d92 commit 8606290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 3 additions & 5 deletions src/lib/dnssd/Discovery_ImplPlatform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,7 @@ void DiscoveryImplPlatform::HandleDnssdInit(void * context, CHIP_ERROR initError
publisher->mState = State::kInitialized;

// Post an event that will start advertising
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kDnssdInitialized;
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdInitialized };

CHIP_ERROR error = DeviceLayer::PlatformMgr().PostEvent(&event);
if (error != CHIP_NO_ERROR)
Expand All @@ -477,9 +476,8 @@ void DiscoveryImplPlatform::HandleDnssdError(void * context, CHIP_ERROR error)
// Restore dnssd state before restart, also needs to call ChipDnssdShutdown()
publisher->Shutdown();

DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded;
error = DeviceLayer::PlatformMgr().PostEvent(&event);
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kDnssdRestartNeeded };
error = DeviceLayer::PlatformMgr().PostEvent(&event);

if (error != CHIP_NO_ERROR)
{
Expand Down
3 changes: 1 addition & 2 deletions src/protocols/secure_channel/PairingSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ void PairingSession::Finish()
if (err == CHIP_NO_ERROR)
{
VerifyOrDie(mSecureSessionHolder);
DeviceLayer::ChipDeviceEvent event;
event.Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished;
DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kSecureSessionEstablished };
event.SecureSessionEstablished.TransportType = to_underlying(address.GetTransportType());
event.SecureSessionEstablished.SecureSessionType =
to_underlying(mSecureSessionHolder->AsSecureSession()->GetSecureSessionType());
Expand Down

0 comments on commit 8606290

Please sign in to comment.