21#ifndef NIMBLE_SCANNER_H
22#define NIMBLE_SCANNER_H
28#include "host/ble_hs.h"
37#define NIMBLE_SCANNER_EXT_ADV 0x80
47#if IS_USED(MODULE_NIMBLE_PHY_CODED)
48 NIMBLE_SCANNER_PHY_CODED = 0x20,
119 const uint8_t *ad,
size_t ad_len);
156 return ble_gap_disc_active();
int nimble_scanner_start(void)
Start scanning using timing parameters configured on initialization.
void(* nimble_scanner_cb)(uint8_t type, const ble_addr_t *addr, const nimble_scanner_info_t *info, const uint8_t *ad, size_t ad_len)
Callback signature triggered by this module for each discovered advertising packet.
static bool nimble_scanner_is_active(void)
Get the current scanning status.
void nimble_scanner_stop(void)
Stop scanning.
void nimble_scanner_set_scan_duration(int32_t duration_ms)
Set the duration for the scanning procedure.
int nimble_scanner_init(const nimble_scanner_cfg_t *params, nimble_scanner_cb disc_cb)
Initialize the scanner module.
@ NIMBLE_SCANNER_FILTER_DUPS
filter duplicates
@ NIMBLE_SCANNER_PHY_1M
scan on 1Mbit PHY
@ NIMBLE_SCANNER_LIMITED
do limited discovery
@ NIMBLE_SCANNER_PASSIVE
do a passive scan
@ NIMBLE_SCANNER_INCOMPLETE
The advertising message is incomplete.
@ NIMBLE_SCANNER_TRUNCATED
Advertising message is truncated.
@ NIMBLE_SCANNER_COMPLETE
All fragments of a advertising message were received.
Scanner configuration parameters.
uint16_t win_ms
scan window [ms]
uint8_t flags
scan configuration flags
uint16_t itvl_ms
scan interval [ms]
Additional information about received advertising packets.
uint8_t status
Status of received packet.
uint8_t phy_pri
PHY used on primary advertisement channels.
int8_t rssi
RSSI value of received advertisement.
uint8_t phy_sec
PHY used on secondary advertisement channels.