This version actually compiles!!
This commit is contained in:
@@ -122,7 +122,7 @@ bool BLEtick(NimBLEAdvertising* pAdvertising) {
|
||||
if (!scanBlock) {
|
||||
scanBlock = true;
|
||||
printf("Scanning WiFi...\n");
|
||||
scanAndUpdateSSIDList();
|
||||
bmWiFi.scanAndUpdateSSIDList();
|
||||
}
|
||||
else printf("Duplicate scan request\n");
|
||||
}
|
||||
@@ -233,7 +233,7 @@ void reset() {
|
||||
tokenGiven = false;
|
||||
}
|
||||
|
||||
void onConnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo) {
|
||||
void MyServerCallbacks::onConnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo) {
|
||||
isBLEClientConnected = true;
|
||||
printf("Client connected\n");
|
||||
reset();
|
||||
@@ -245,6 +245,10 @@ void MyServerCallbacks::onDisconnect(NimBLEServer* pServer, NimBLEConnInfo& conn
|
||||
reset();
|
||||
}
|
||||
|
||||
void MyCharCallbacks::onRead(NimBLECharacteristic* pChar, NimBLEConnInfo& connInfo) {
|
||||
printf("Characteristic Read\n");
|
||||
}
|
||||
|
||||
void MyCharCallbacks::onWrite(NimBLECharacteristic* pChar, NimBLEConnInfo& connInfo) {
|
||||
std::string val = pChar->getValue();
|
||||
std::string uuidStr = pChar->getUUID().toString();
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
// Global pointers to characteristics for notification support
|
||||
extern NimBLECharacteristic* ssidListChar;
|
||||
extern NimBLECharacteristic* ssidRefreshChar;
|
||||
extern std::atomic<bool> isBLEClientConnected{false};
|
||||
extern std::atomic<bool> isBLEClientConnected;
|
||||
|
||||
class MyServerCallbacks : public NimBLEServerCallbacks {
|
||||
void onConnect(NimBLEServer* pServer, NimBLEConnInfo& connInfo);
|
||||
|
||||
@@ -232,7 +232,7 @@ void WiFi::processScanResults() {
|
||||
|
||||
// 5. Update BLE
|
||||
if (ssidListChar != nullptr) {
|
||||
ssidListChar->setValue(json_string);
|
||||
ssidListChar->setValue(std::string(json_string));
|
||||
ssidRefreshChar->setValue("Ready");
|
||||
ssidRefreshChar->notify();
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "esp_wifi.h"
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
|
||||
class WiFi {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user