summaryrefslogtreecommitdiff
path: root/src/BLEAddress.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/BLEAddress.h')
-rw-r--r--src/BLEAddress.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/BLEAddress.h b/src/BLEAddress.h
new file mode 100644
index 0000000..7eff4da
--- /dev/null
+++ b/src/BLEAddress.h
@@ -0,0 +1,34 @@
+/*
+ * BLEAddress.h
+ *
+ * Created on: Jul 2, 2017
+ * Author: kolban
+ */
+
+#ifndef COMPONENTS_CPP_UTILS_BLEADDRESS_H_
+#define COMPONENTS_CPP_UTILS_BLEADDRESS_H_
+#include "sdkconfig.h"
+#if defined(CONFIG_BT_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(std::string stringAddress);
+ bool equals(BLEAddress otherAddress);
+ esp_bd_addr_t* getNative();
+ std::string toString();
+
+private:
+ esp_bd_addr_t m_address;
+};
+
+#endif /* CONFIG_BT_ENABLED */
+#endif /* COMPONENTS_CPP_UTILS_BLEADDRESS_H_ */