summaryrefslogtreecommitdiff
path: root/src/BLEDevice.h
diff options
context:
space:
mode:
authorNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
committerNeil Kolban <kolban1@kolban.com>2018-01-17 18:16:31 -0600
commit3f5005c383540d07dd16ac044c78d7be28d4aa8e (patch)
treec5236ddbe5c8dd99ad7083dd498110152ad0e9be /src/BLEDevice.h
parentRemoval of unneeded file (diff)
downloadthermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.gz
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.tar.bz2
thermostat-3f5005c383540d07dd16ac044c78d7be28d4aa8e.zip
0.4.8
Diffstat (limited to 'src/BLEDevice.h')
-rw-r--r--src/BLEDevice.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/BLEDevice.h b/src/BLEDevice.h
index acf20f3..7f33143 100644
--- a/src/BLEDevice.h
+++ b/src/BLEDevice.h
@@ -13,29 +13,43 @@
#include <esp_gattc_api.h> // ESP32 BLE
#include <map> // Part of C++ STL
#include <string>
-#include <bt.h>
+#include <esp_bt.h>
#include "BLEServer.h"
#include "BLEClient.h"
#include "BLEUtils.h"
#include "BLEScan.h"
#include "BLEAddress.h"
+
/**
* @brief %BLE functions.
*/
class BLEDevice {
public:
- static BLEClient* createClient();
- static BLEServer* createServer();
- static void dumpDevices();
- static BLEScan* getScan();
- static void init(std::string deviceName);
+ static BLEClient* createClient(); // Create a new BLE client.
+ static BLEServer* createServer(); // Cretae a new BLE server.
+ static BLEAddress getAddress(); // Retrieve our own local BD address.
+ static BLEScan* getScan(); // Get the scan object
+ static std::string getValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID); // Get the value of a characteristic of a service on a server.
+ static void init(std::string deviceName); // Initialize the local BLE environment.
+ static void setPower(esp_power_level_t powerLevel); // Set our power level.
+ static void setValue(BLEAddress bdAddress, BLEUUID serviceUUID, BLEUUID characteristicUUID, std::string value); // Set the value of a characteristic on a service on a server.
+ static std::string toString(); // Return a string representation of our device.
+ static void whiteListAdd(BLEAddress address); // Add an entry to the BLE white list.
+ static void whiteListRemove(BLEAddress address); // Remove an entry from the BLE white list.
+ static void setEncryptionLevel(esp_ble_sec_act_t level);
+ static void setSecurityCallbacks(BLESecurityCallbacks* pCallbacks);
+ static esp_err_t setMTU(uint16_t mtu);
+ static uint16_t getMTU();
private:
static BLEServer *m_pServer;
static BLEScan *m_pScan;
static BLEClient *m_pClient;
+ static esp_ble_sec_act_t m_securityLevel;
+ static BLESecurityCallbacks* m_securityCallbacks;
+ static uint16_t m_localMTU;
static esp_gatt_if_t getGattcIF();
@@ -53,9 +67,6 @@ private:
esp_gap_ble_cb_event_t event,
esp_ble_gap_cb_param_t* param);
-public:
- static void setPower(esp_power_level_t powerLevel);
-
}; // class BLE
#endif // CONFIG_BT_ENABLED