From 63ef389aaa7e1e71e461b8a5166d765cbd7d4b5a Mon Sep 17 00:00:00 2001 From: CommanderRedYT Date: Tue, 10 Aug 2021 23:26:19 +0200 Subject: [PATCH] Updated to meet requirements --- main/ble.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main/ble.h b/main/ble.h index 58d0fe6..8d0eaf3 100644 --- a/main/ble.h +++ b/main/ble.h @@ -9,6 +9,9 @@ #include #endif +#define FEATURE_BLE +#define FEATURE_WIRELESS_CONFIG + // local includes #include "globals.h" #include "futurecpp.h" @@ -262,9 +265,9 @@ void WirelessSettingsCallbacks::onWrite(NimBLECharacteristic* pCharacteristic) return; } - const char* write_type = doc["type"].as(); + auto write_type = doc["type"].as(); - if (strcmp(write_type, "wifi") == 0) { + if (write_type == "wifi") { const int index = doc["wifi_index"].as(); ESP_LOGI(TAG, "[ble_config]: Set wifi%i: WiFi-SSID: %s, WiFi-Password: ***", doc["wifi_index"].as(), doc["wifi_ssid"].as()); stringSettings.wifis[index].ssid = doc["wifi_ssid"].as();