Skip to content

Commit

Permalink
use event handling for disconnect event
Browse files Browse the repository at this point in the history
  • Loading branch information
pankore committed May 15, 2023
1 parent 05d9050 commit 00e9563
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 00e9563

Please sign in to comment.