diff options
Diffstat (limited to 'sensor/patchedBLE/src')
-rw-r--r-- | sensor/patchedBLE/src/BLEDevice.cpp | 8 | ||||
-rw-r--r-- | sensor/patchedBLE/src/BLEDevice.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sensor/patchedBLE/src/BLEDevice.cpp b/sensor/patchedBLE/src/BLEDevice.cpp index a7db454..3f31ace 100644 --- a/sensor/patchedBLE/src/BLEDevice.cpp +++ b/sensor/patchedBLE/src/BLEDevice.cpp @@ -426,6 +426,14 @@ uint16_t BLEDevice::m_localMTU = 23; vTaskDelay(200/portTICK_PERIOD_MS); // Delay for 200 msecs as a workaround to an apparent Arduino environment issue. } // init +void BLEDevice::uninit() { + if (initialized) { + initialized = false; + esp_bluedroid_disable(); + esp_bt_controller_disable(); + esp_bt_controller_deinit(); + } +} /** * @brief Set the transmission power. diff --git a/sensor/patchedBLE/src/BLEDevice.h b/sensor/patchedBLE/src/BLEDevice.h index 7a1b833..16c323c 100644 --- a/sensor/patchedBLE/src/BLEDevice.h +++ b/sensor/patchedBLE/src/BLEDevice.h @@ -33,6 +33,7 @@ public: 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 uninit(); 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. |