Loading...
Searching...
No Matches
nimble_scanlist.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
23
24#include "clist.h"
25#include "net/ble.h"
26#include "nimble/ble.h"
27#include "nimble_scanner.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
36#ifndef NIMBLE_SCANLIST_SIZE
37#define NIMBLE_SCANLIST_SIZE (20U)
38#endif
39
43typedef struct {
45 ble_addr_t addr;
47 uint8_t ad_len;
48 int8_t last_rssi;
49 uint32_t adv_msg_cnt;
50 uint32_t first_update;
51 uint32_t last_update;
52 uint8_t type;
53 uint8_t phy_pri;
54 uint8_t phy_sec;
56
61
73void nimble_scanlist_update(uint8_t type, const ble_addr_t *addr,
74 const nimble_scanner_info_t *info,
75 const uint8_t *ad, size_t len);
76
86
97
102
107
114
115#ifdef __cplusplus
116}
117#endif
118
Circular linked list.
list_node_t clist_node_t
List node structure.
Definition clist.h:104
#define BLE_ADV_PDU_LEN
max size of legacy ADV packets
Definition ble.h:45
void nimble_scanlist_clear(void)
Clear all entries in the list.
void nimble_scanlist_update(uint8_t type, const ble_addr_t *addr, const nimble_scanner_info_t *info, const uint8_t *ad, size_t len)
Add/update the entry for the a scanned node.
nimble_scanlist_entry_t * nimble_scanlist_get_by_pos(unsigned pos)
Get an entry of the scanlist by its position.
void nimble_scanlist_print_entry(nimble_scanlist_entry_t *e)
Dump a single scanlist entry to STDIO.
nimble_scanlist_entry_t * nimble_scanlist_get_next(nimble_scanlist_entry_t *e)
Get the next entry from the list, pass NULL for getting the first entry.
void nimble_scanlist_init(void)
Initialize the scanlist.
void nimble_scanlist_print(void)
Dump the entire scanlist to STDIO using nimble_scanlist_print_entry()
Scanner abstraction for NimBLE.
Data structure for holding a single scanlist entry.
uint32_t adv_msg_cnt
number of adv packets by a node
int8_t last_rssi
last RSSI of a scanned node
uint8_t type
advertising packet type
uint8_t phy_sec
secondary PHY advertised
uint32_t first_update
first packet timestamp
ble_addr_t addr
a node's BLE address
clist_node_t node
list node
uint8_t ad[BLE_ADV_PDU_LEN]
the received raw advertising data
uint8_t phy_pri
primary PHY used
uint8_t ad_len
length of the advertising data
uint32_t last_update
last packet timestamp
Additional information about received advertising packets.
General BLE values as defined by the BT standard.