From 1c8e64319c417f5be54783467c2b85d45aef8d95 Mon Sep 17 00:00:00 2001 From: Ben Meadors Date: Sat, 6 Aug 2022 14:16:11 -0500 Subject: [PATCH] Update nimble to 1.4 (#1600) * Update nimble version * Back down a version * Nimble 1.4 * Change log level of Nimble. Too chatty * Log level * Log level of 1 (error) --- platformio.ini | 4 ++-- src/esp32/ESP32Bluetooth.cpp | 4 ++-- src/esp32/architecture.h | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/platformio.ini b/platformio.ini index ec2695890..3d328fbfa 100644 --- a/platformio.ini +++ b/platformio.ini @@ -103,13 +103,13 @@ debug_init_break = tbreak setup build_flags = ${arduino_base.build_flags} -Wall -Wextra -Isrc/esp32 -Isrc/esp32-mfix-esp32-psram-cache-issue -lnimble -std=c++11 -DLOG_LOCAL_LEVEL=ESP_LOG_DEBUG -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_DEBUG -DMYNEWT_VAL_BLE_HS_LOG_LVL=LOG_LEVEL_CRITICAL - -DAXP_DEBUG_PORT=Serial -DUSE_NEW_ESP32_BLUETOOTH + -DAXP_DEBUG_PORT=Serial -DUSE_NEW_ESP32_BLUETOOTH -DCONFIG_BT_NIMBLE_ENABLED -DCONFIG_NIMBLE_CPP_LOG_LEVEL=1 lib_deps = ${arduino_base.lib_deps} ${networking_base.lib_deps} ${environmental_base.lib_deps} https://github.com/meshtastic/esp32_https_server.git - h2zero/NimBLE-Arduino@1.3.8 + h2zero/NimBLE-Arduino@1.4.0 arduino-libraries/NTPClient@^3.1.0 lorol/LittleFS_esp32@^1.0.6 https://github.com/meshtastic/AXP202X_Library.git#8404abb6d4b486748636bc6ad72d2a47baaf5460 diff --git a/src/esp32/ESP32Bluetooth.cpp b/src/esp32/ESP32Bluetooth.cpp index 5ed46f119..563679339 100644 --- a/src/esp32/ESP32Bluetooth.cpp +++ b/src/esp32/ESP32Bluetooth.cpp @@ -62,9 +62,9 @@ PhoneAPI *bluetoothPhoneAPI; class ESP32BluetoothToRadioCallback : public NimBLECharacteristicCallbacks { virtual void onWrite(NimBLECharacteristic *pCharacteristic) { DEBUG_MSG("To Radio onwrite\n"); - auto valueString = pCharacteristic->getValue(); + auto val = pCharacteristic->getValue(); - bluetoothPhoneAPI->handleToRadio(reinterpret_cast(&valueString[0]), pCharacteristic->getDataLength()); + bluetoothPhoneAPI->handleToRadio(val.data(), val.length()); } }; diff --git a/src/esp32/architecture.h b/src/esp32/architecture.h index 9c4509359..caec3e446 100644 --- a/src/esp32/architecture.h +++ b/src/esp32/architecture.h @@ -103,3 +103,4 @@ #endif #define SERIAL0_RX_GPIO 3 // Always GPIO3 on ESP32 +