-
Notifications
You must be signed in to change notification settings - Fork 7.6k
/
Copy pathBLEUUID.h
44 lines (39 loc) · 1.09 KB
/
BLEUUID.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
/*
* BLEUUID.h
*
* Created on: Jun 21, 2017
* Author: kolban
*/
#ifndef COMPONENTS_CPP_UTILS_BLEUUID_H_
#define COMPONENTS_CPP_UTILS_BLEUUID_H_
#include "soc/soc_caps.h"
#include "WString.h"
#if SOC_BLE_SUPPORTED
#include "sdkconfig.h"
#if CONFIG_BLUEDROID_ENABLED
#include <esp_gatt_defs.h>
/**
* @brief A model of a %BLE UUID.
*/
class BLEUUID {
public:
BLEUUID(String uuid);
BLEUUID(uint16_t uuid);
BLEUUID(uint32_t uuid);
BLEUUID(esp_bt_uuid_t uuid);
BLEUUID(uint8_t *pData, size_t size, bool msbFirst);
BLEUUID(esp_gatt_id_t gattId);
BLEUUID();
uint8_t bitSize(); // Get the number of bits in this uuid.
bool equals(BLEUUID uuid);
esp_bt_uuid_t *getNative();
BLEUUID to128();
String toString();
static BLEUUID fromString(String uuid); // Create a BLEUUID from a string
private:
esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps.
bool m_valueSet = false; // Is there a value set for this instance.
}; // BLEUUID
#endif /* CONFIG_BLUEDROID_ENABLED */
#endif /* SOC_BLE_SUPPORTED */
#endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */