Skip to content

Commit

Permalink
[Ameba] use event handling for BLE disconnect event (#26569)
Browse files Browse the repository at this point in the history
* use event handling for disconnect event

* restyle
  • Loading branch information
pankore authored and pull[bot] committed Nov 18, 2023
1 parent cfa8fac commit 3116321
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/platform/Ameba/BLEManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3116321

Please sign in to comment.