host/ble_gap.c: Fix failure to run callback on finished scan

When both roles - peripheral and central where turned off, removed lines where causing
not calling callback function after completing the scan.
This commit is contained in:
Michal Gorecki
2022-08-24 16:22:32 +02:00
committed by Szymon Janc
parent df2ed42d23
commit 338c81014e
-4
View File
@@ -917,21 +917,17 @@ ble_gap_disc_report(void *desc)
static void
ble_gap_disc_complete(void)
{
#if NIMBLE_BLE_CONNECT
struct ble_gap_master_state state;
#endif
struct ble_gap_event event;
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_DISC_COMPLETE;
event.disc_complete.reason = 0;
#if NIMBLE_BLE_CONNECT
ble_gap_master_extract_state(&state, 1);
if (ble_gap_has_client(&state)) {
ble_gap_call_event_cb(&event, state.cb, state.cb_arg);
}
#endif
ble_gap_event_listener_call(&event);
}