nimble/gap: Add missing listener callback call on Scan Request

This commit is contained in:
Łukasz Rymanowski
2019-08-19 13:38:59 +02:00
parent 2e28eefb54
commit 70cfe8b792
+8 -5
View File
@@ -755,15 +755,18 @@ ble_gap_scan_req_rcvd(uint8_t instance, uint8_t scan_addr_type,
ble_gap_event_fn *cb;
void *cb_arg;
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_SCAN_REQ_RCVD;
event.scan_req_rcvd.instance = instance;
event.scan_req_rcvd.scan_addr.type = scan_addr_type;
memcpy(event.scan_req_rcvd.scan_addr.val, scan_addr, 6);
ble_gap_slave_extract_cb(instance, &cb, &cb_arg);
if (cb != NULL) {
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_SCAN_REQ_RCVD;
event.scan_req_rcvd.instance = instance;
event.scan_req_rcvd.scan_addr.type = scan_addr_type;
memcpy(event.scan_req_rcvd.scan_addr.val, scan_addr, 6);
cb(&event, cb_arg);
}
ble_gap_event_listener_call(&event);
}
#endif