pkb/nimble/scanner: pass adv pkt type to callback

This commit is contained in:
Hauke Petersen 2019-09-05 17:01:29 +02:00
parent 999fffdc59
commit 825710e489
2 changed files with 9 additions and 2 deletions

View File

@ -42,8 +42,15 @@ enum {
/**
* @brief Callback signature triggered by this module for each discovered
* advertising packet
*
* @param[in] type type of advertising packet, e.g BLE_HCI_ADV_TYPE_ADV_IND
* @param[in] addr advertising address of the source node
* @param[in] rssi RSSI value for the received packet
* @param[in] ad advertising data
* @param[in] ad_len length of @p ad in bytes
*/
typedef void(*nimble_scanner_cb)(const ble_addr_t *addr, int8_t rssi,
typedef void(*nimble_scanner_cb)(uint8_t type,
const ble_addr_t *addr, int8_t rssi,
const uint8_t *ad, size_t ad_len);
/**

View File

@ -35,7 +35,7 @@ static int _on_scan_evt(struct ble_gap_event *event, void *arg)
{
/* only interested in the DISC event */
if (event->type == BLE_GAP_EVENT_DISC) {
_disc_cb(&event->disc.addr, event->disc.rssi,
_disc_cb(event->disc.event_type, &event->disc.addr, event->disc.rssi,
event->disc.data, (size_t)event->disc.length_data);
}
else {