forked from adafruit/circuitpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScanResults.h
More file actions
41 lines (34 loc) · 1.22 KB
/
ScanResults.h
File metadata and controls
41 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// This file is part of the CircuitPython project: https://circuitpython.org
//
// SPDX-FileCopyrightText: Copyright (c) 2019 Dan Halbert for Adafruit Industries
// SPDX-FileCopyrightText: Copyright (c) 2018 Artur Pacholec
//
// SPDX-License-Identifier: MIT
#pragma once
#include <stdint.h>
#include "py/obj.h"
#include "py/ringbuf.h"
typedef struct {
mp_obj_base_t base;
// Pointers that needs to live until the scan is done.
void *common_hal_data;
ringbuf_t buf;
// Prefixes is a length encoded array of prefixes.
uint8_t *prefixes;
size_t prefix_length;
mp_int_t minimum_rssi;
bool active;
bool done;
} bleio_scanresults_obj_t;
bleio_scanresults_obj_t *shared_module_bleio_new_scanresults(size_t buffer_size, uint8_t *prefixes, size_t prefixes_len, mp_int_t minimum_rssi);
bool shared_module_bleio_scanresults_get_done(bleio_scanresults_obj_t *self);
void shared_module_bleio_scanresults_set_done(bleio_scanresults_obj_t *self, bool done);
void shared_module_bleio_scanresults_append(bleio_scanresults_obj_t *self,
uint64_t ticks_ms,
bool connectable,
bool scan_result,
int8_t rssi,
const uint8_t *peer_addr,
uint8_t addr_type,
const uint8_t *data,
uint16_t len);