Loading...
Searching...
No Matches
nimble_scanner.h File Reference

Scanner abstraction for NimBLE. More...

Detailed Description

Scanner abstraction for NimBLE.

Author
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file nimble_scanner.h.

#include <errno.h>
#include <stdint.h>
#include <stdbool.h>
#include "host/ble_hs.h"
+ Include dependency graph for nimble_scanner.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  nimble_scanner_cfg_t
 Scanner configuration parameters. More...
 
struct  nimble_scanner_info_t
 Additional information about received advertising packets. More...
 

Macros

#define NIMBLE_SCANNER_EXT_ADV   0x80
 Flag to mark type for extended advertisements.
 

Typedefs

typedef 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.
 

Enumerations

enum  { NIMBLE_SCANNER_PASSIVE = 0x01 , NIMBLE_SCANNER_LIMITED = 0x02 , NIMBLE_SCANNER_FILTER_DUPS = 0x04 , NIMBLE_SCANNER_PHY_1M = 0x10 }
 Scan procedure configuration flags. More...
 
enum  { NIMBLE_SCANNER_COMPLETE = BLE_HCI_ADV_DATA_STATUS_COMPLETE , NIMBLE_SCANNER_INCOMPLETE = BLE_HCI_ADV_DATA_STATUS_INCOMPLETE , NIMBLE_SCANNER_TRUNCATED = BLE_HCI_ADV_DATA_STATUS_TRUNCATED }
 Status flags for received advertising packets. More...
 

Functions

int nimble_scanner_init (const nimble_scanner_cfg_t *params, nimble_scanner_cb disc_cb)
 Initialize the scanner module.
 
int nimble_scanner_start (void)
 Start scanning using timing parameters configured on initialization.
 
void nimble_scanner_stop (void)
 Stop scanning.
 
static bool nimble_scanner_is_active (void)
 Get the current scanning status.
 
void nimble_scanner_set_scan_duration (int32_t duration_ms)
 Set the duration for the scanning procedure.