From 5ac03e88288b83555cae8b4a046eda242d1cfe53 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Tue, 23 May 2023 03:11:01 +0800 Subject: [PATCH] [Ameba] use event handling for BLE disconnect event (#26569) * use event handling for disconnect event * restyle --- src/platform/Ameba/BLEManagerImpl.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/platform/Ameba/BLEManagerImpl.cpp b/src/platform/Ameba/BLEManagerImpl.cpp index 2cb77beb3e9c7e..b45c314446e095 100644 --- a/src/platform/Ameba/BLEManagerImpl.cpp +++ b/src/platform/Ameba/BLEManagerImpl.cpp @@ -292,7 +292,12 @@ CHIP_ERROR BLEManagerImpl::HandleGAPDisconnect(uint16_t conn_id, uint16_t disc_c disconReason = BLE_ERROR_CHIPOBLE_PROTOCOL_ABORT; break; } - HandleConnectionError(conn_id, disconReason); + + ChipDeviceEvent event; + event.Type = DeviceEventType::kCHIPoBLEConnectionError; + event.CHIPoBLEConnectionError.ConId = conn_id; + event.CHIPoBLEConnectionError.Reason = disconReason; + PlatformMgr().PostEventOrDie(&event); // Force a reconfiguration of advertising in case we switched to non-connectable mode when // the BLE connection was established.