From fcd5ecabc4422c6026571a3464e5e72707fcf075 Mon Sep 17 00:00:00 2001 From: Sergio Soares Date: Mon, 17 Mar 2025 20:24:17 +0000 Subject: [PATCH] server/Server.cpp Initialize ChipDeviceEvent on instantiation This fixes an error: src/app/server/Server.cpp:621:34: error: call to implicitly-deleted default constructor of 'DeviceLayer::ChipDeviceEvent' 621 | DeviceLayer::ChipDeviceEvent event; | ^ src/include/platform/CHIPDeviceEvent.h:508:11: note: default constructor of 'ChipDeviceEvent' is implicitly deleted because variant field 'CHIPoBLEConnectionError' has a non-trivial default constructor 508 | } CHIPoBLEConnectionError; | ^ 1 error generated. --- src/app/server/Server.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/app/server/Server.cpp b/src/app/server/Server.cpp index 5aa7577606cc13..188bfe7379dd2e 100644 --- a/src/app/server/Server.cpp +++ b/src/app/server/Server.cpp @@ -618,8 +618,7 @@ void Server::GenerateShutDownEvent() void Server::PostFactoryResetEvent() { - DeviceLayer::ChipDeviceEvent event; - event.Type = DeviceLayer::DeviceEventType::kFactoryReset; + DeviceLayer::ChipDeviceEvent event{ .Type = DeviceLayer::DeviceEventType::kFactoryReset }; CHIP_ERROR error = DeviceLayer::PlatformMgr().PostEvent(&event); if (error != CHIP_NO_ERROR)