List for storing and printing BLE scan results.
More...
List for storing and printing BLE scan results.
- Note
- This scanlist implementation is not thread safe. So calling nimble_scanlist_update() in between nimble_scanlist_get*() calls is not a good idea.
◆ nimble_scanlist_get_by_pos()
Get an entry of the scanlist by its position.
- Parameters
-
[in] | pos | position in the list |
- Returns
- the scanlist entry at position
pos
-
NULL if there is no entry a the given position
◆ nimble_scanlist_get_next()
Get the next entry from the list, pass NULL for getting the first entry.
- Parameters
-
[in] | e | any entry in the list |
- Returns
- the entry following
e
-
NULL if
e
was the last entry
◆ nimble_scanlist_print_entry()
Dump a single scanlist entry to STDIO.
- Parameters
-
◆ nimble_scanlist_update()
void nimble_scanlist_update |
( |
uint8_t |
type, |
|
|
const ble_addr_t * |
addr, |
|
|
int8_t |
rssi, |
|
|
const uint8_t * |
ad, |
|
|
size_t |
len |
|
) |
| |
Add/update the entry for the a scanned node.
If the list is already full, the scanned node is simply ignored.
- Parameters
-
[in] | type | type of the advertising packet received |
[in] | addr | BLE address of the scanned node |
[in] | rssi | RSSI of the received advertising packet |
[in] | ad | the payload of the advertising packet |
[in] | len | length of ad |