feat: parse and filter ibeacon/altbeacon/eddystone ble advertisements
This commit is contained in:
@@ -2,12 +2,25 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Called for every unique BLE advertisement received.
|
||||
* tag_id is a null-terminated string: "aa:bb:cc:dd:ee:ff"
|
||||
* rssi is in dBm (negative).
|
||||
*/
|
||||
typedef void (*ble_scanner_cb_t)(const char *tag_id, int8_t rssi);
|
||||
typedef enum {
|
||||
BLE_BEACON_IBEACON,
|
||||
BLE_BEACON_ALTBEACON,
|
||||
BLE_BEACON_EDDYSTONE_UID,
|
||||
BLE_BEACON_EDDYSTONE_URL,
|
||||
} ble_beacon_type_t;
|
||||
|
||||
typedef struct {
|
||||
ble_beacon_type_t type;
|
||||
char id[64]; /* beacon identifier; encoding varies by type:
|
||||
iBeacon: "UUID-MAJOR-MINOR"
|
||||
AltBeacon: 40-char hex beacon ID
|
||||
Eddystone UID: "NAMESPACE.INSTANCE" hex
|
||||
Eddystone URL: decoded URL string */
|
||||
int8_t tx_power; /* calibrated TX power from beacon payload */
|
||||
int8_t rssi; /* measured signal strength */
|
||||
} ble_beacon_t;
|
||||
|
||||
typedef void (*ble_scanner_cb_t)(const ble_beacon_t *beacon);
|
||||
|
||||
/**
|
||||
* Initialise the Bluedroid BLE stack and register the scan callback.
|
||||
|
||||
Reference in New Issue
Block a user