From 83f05b5e9712389664f1785dacc73c583f601522 Mon Sep 17 00:00:00 2001 From: pr3y Date: Sun, 12 May 2024 18:19:40 -0300 Subject: [PATCH] added BLEinit --- src/ble_spam.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ble_spam.cpp b/src/ble_spam.cpp index 88c03055..638939fd 100644 --- a/src/ble_spam.cpp +++ b/src/ble_spam.cpp @@ -268,6 +268,12 @@ BLEAdvertising *pAdvertising; ** spams BLE from choice **********************************************************************/ void aj_adv(int ble_choice){ + + BLEDevice::init(""); + BLEServer *pServer = BLEDevice::createServer(); + pAdvertising = pServer->getAdvertising(); + BLEAdvertisementData oAdvertisementData = BLEAdvertisementData(); + tft.fillScreen(TFT_BLACK); bool rstOverride = true; bool swiftPair; @@ -419,6 +425,7 @@ void aj_adv(int ble_choice){ swiftPair = false; maelstrom = false; pAdvertising->stop(); // Bug that keeps advertising in the background. Oops. + BLEDevice::deinit(); delay(250); }