My Project
 All Classes Functions Variables Pages
BLEUUID.h
1 /*
2  * BLEUUID.h
3  *
4  * Created on: Jun 21, 2017
5  * Author: kolban
6  */
7 
8 #ifndef COMPONENTS_CPP_UTILS_BLEUUID_H_
9 #define COMPONENTS_CPP_UTILS_BLEUUID_H_
10 #include "sdkconfig.h"
11 #if defined(CONFIG_BT_ENABLED)
12 #include <esp_gatt_defs.h>
13 #include <string>
14 
18 class BLEUUID {
19 public:
20  BLEUUID(std::string uuid);
21  BLEUUID(uint16_t uuid);
22  BLEUUID(uint32_t uuid);
23  BLEUUID(esp_bt_uuid_t uuid);
24  BLEUUID(uint8_t* pData, size_t size, bool msbFirst);
25  BLEUUID(esp_gatt_id_t gattId);
26  BLEUUID();
27  uint8_t bitSize(); // Get the number of bits in this uuid.
28  bool equals(BLEUUID uuid);
29  esp_bt_uuid_t* getNative();
30  BLEUUID to128();
31  std::string toString();
32  static BLEUUID fromString(std::string uuid); // Create a BLEUUID from a string
33 
34 private:
35  esp_bt_uuid_t m_uuid; // The underlying UUID structure that this class wraps.
36  bool m_valueSet = false; // Is there a value set for this instance.
37 }; // BLEUUID
38 #endif /* CONFIG_BT_ENABLED */
39 #endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */