mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-08-21 09:20:02 +00:00
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:
committed by
Szymon Janc
parent
df2ed42d23
commit
338c81014e
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user