summaryrefslogtreecommitdiff
path: root/ESP32_BLE_Arduino/src/BLEAdvertising.h
diff options
context:
space:
mode:
authorkolban <kolban1@kolban.com>2017-09-10 13:36:10 -0500
committerkolban <kolban1@kolban.com>2017-09-10 13:36:10 -0500
commit5e5b5b78f0aeca611edb52ff4e885334b6fe46a9 (patch)
tree8d207806891e66ee6ea292d82eb7f120e2138418 /ESP32_BLE_Arduino/src/BLEAdvertising.h
downloadthermostat-5e5b5b78f0aeca611edb52ff4e885334b6fe46a9.tar.gz
thermostat-5e5b5b78f0aeca611edb52ff4e885334b6fe46a9.tar.bz2
thermostat-5e5b5b78f0aeca611edb52ff4e885334b6fe46a9.zip
0.1.0 release
Diffstat (limited to 'ESP32_BLE_Arduino/src/BLEAdvertising.h')
-rw-r--r--ESP32_BLE_Arduino/src/BLEAdvertising.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/ESP32_BLE_Arduino/src/BLEAdvertising.h b/ESP32_BLE_Arduino/src/BLEAdvertising.h
new file mode 100644
index 0000000..2d0b51c
--- /dev/null
+++ b/ESP32_BLE_Arduino/src/BLEAdvertising.h
@@ -0,0 +1,34 @@
+/*
+ * BLEAdvertising.h
+ *
+ * Created on: Jun 21, 2017
+ * Author: kolban
+ */
+
+#ifndef COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
+#define COMPONENTS_CPP_UTILS_BLEADVERTISING_H_
+#include "sdkconfig.h"
+#if defined(CONFIG_BT_ENABLED)
+#include <esp_gap_ble_api.h>
+#include "BLEUUID.h"
+
+/**
+ * @brief Perform and manage %BLE advertising.
+ *
+ * A %BLE server will want to perform advertising in order to make itself known to %BLE clients.
+ */
+class BLEAdvertising {
+public:
+ BLEAdvertising();
+ void start();
+ void stop();
+ void setAppearance(uint16_t appearance);
+ void setServiceUUID(const char* serviceUUID);
+ void setServiceUUID(BLEUUID serviceUUID);
+private:
+ esp_ble_adv_data_t m_advData;
+ esp_ble_adv_params_t m_advParams;
+ BLEUUID m_serviceUUID;
+};
+#endif /* CONFIG_BT_ENABLED */
+#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */