-
Notifications
You must be signed in to change notification settings - Fork 0
/
BluetoothBeaconService.h
43 lines (36 loc) · 1.02 KB
/
BluetoothBeaconService.h
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
42
43
#ifndef __BLEBEACON_H__
#define __BLEBEACON_H__
#include "ble/BLE.h"
/**
* A class to advertise BLE Beacons
*/
class BluetoothBeaconService
{
public:
/**
* Constructor
* @param dev BLE device
*/
BluetoothBeaconService(BLEDevice *device);
/**
* Advertise as iBeacon
*
* @param uuid UUID format string. like 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
* @param major major ID
* @param minor minor ID
* @param calibratedPower 2’s complement of measured TX power
*/
void advertiseIBeacon(ManagedString uuid, uint16_t major, uint16_t minor, int8_t calibratedPower);
/**
* Advertise as AltBeacon
*
* @param manufacturerId mfg ID
* @param beaconId 20 bytes
* @param refRSSI reference RSSI from 0 to -127
*/
void advertiseAltBeacon(uint16_t manufacturerId, ManagedBuffer beaconId, int8_t refRSSI, uint8_t reserved);
private:
BLEDevice &ble;
void advertiseRawData(const uint8_t *data, uint8_t len);
};
#endif /* __BLEBEACON_H__ */