diff options
author | dakkar <dakkar@thenautilus.net> | 2018-08-03 12:23:17 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-08-03 12:23:17 +0100 |
commit | bb00c2da73b6ab8837f50c9f889ee151f8abc036 (patch) | |
tree | 3922eb826386260568ccaa1da7056c141f752a97 /sensor/patchedBLE/src/BLEUUID.h | |
parent | don't print from callback, there's races (diff) | |
parent | Upload of 0.4.16 (diff) | |
download | thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.gz thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.tar.bz2 thermostat-bb00c2da73b6ab8837f50c9f889ee151f8abc036.zip |
Add 'sensor/patchedBLE/' from commit '7951347ed68313d75c367e1f2cce763cb56d1eb2'
git-subtree-dir: sensor/patchedBLE
git-subtree-mainline: 27e209cf58abeda1dc110777f99a98804a13fdbf
git-subtree-split: 7951347ed68313d75c367e1f2cce763cb56d1eb2
Diffstat (limited to 'sensor/patchedBLE/src/BLEUUID.h')
-rw-r--r-- | sensor/patchedBLE/src/BLEUUID.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sensor/patchedBLE/src/BLEUUID.h b/sensor/patchedBLE/src/BLEUUID.h new file mode 100644 index 0000000..5fb7795 --- /dev/null +++ b/sensor/patchedBLE/src/BLEUUID.h @@ -0,0 +1,39 @@ +/* + * BLEUUID.h + * + * Created on: Jun 21, 2017 + * Author: kolban + */ + +#ifndef COMPONENTS_CPP_UTILS_BLEUUID_H_ +#define COMPONENTS_CPP_UTILS_BLEUUID_H_ +#include "sdkconfig.h" +#if defined(CONFIG_BT_ENABLED) +#include <esp_gatt_defs.h> +#include <string> + +/** + * @brief A model of a %BLE UUID. + */ +class BLEUUID { +public: + BLEUUID(std::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(); + int bitSize(); // Get the number of bits in this uuid. + bool equals(BLEUUID uuid); + esp_bt_uuid_t* getNative(); + BLEUUID to128(); + std::string toString(); + static BLEUUID fromString(std::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; // Is there a value set for this instance. +}; // BLEUUID +#endif /* CONFIG_BT_ENABLED */ +#endif /* COMPONENTS_CPP_UTILS_BLEUUID_H_ */ |