forked from espressif/arduino-esp32
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBLEAddress.h
44 lines (39 loc) · 1.16 KB
/
BLEAddress.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
44
/*
* BLEAddress.h
*
* Created on: Jul 2, 2017
* Author: kolban
*/
#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_
#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_
#include "soc/soc_caps.h"
#include "WString.h"
#if SOC_BLE_SUPPORTED
#include "sdkconfig.h"
#if defined(CONFIG_BLUEDROID_ENABLED)
#include <esp_gap_ble_api.h> // ESP32 BLE
#include <string>
/**
* @brief A %BLE device address.
*
* Every %BLE device has a unique address which can be used to identify it and form connections.
*/
class BLEAddress {
public:
BLEAddress(esp_bd_addr_t address);
BLEAddress(String stringAddress);
bool equals(BLEAddress otherAddress);
bool operator==(const BLEAddress &otherAddress) const;
bool operator!=(const BLEAddress &otherAddress) const;
bool operator<(const BLEAddress &otherAddress) const;
bool operator<=(const BLEAddress &otherAddress) const;
bool operator>(const BLEAddress &otherAddress) const;
bool operator>=(const BLEAddress &otherAddress) const;
esp_bd_addr_t *getNative();
String toString();
private:
esp_bd_addr_t m_address;
};
#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */