From 0fba6966a6c66ffb212ee3c3e1a25dda107adf76 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Mon, 24 Nov 2025 13:20:01 -0500 Subject: [PATCH] Fix for non bluetooth hardware --- esp32_marauder/WiFiScan.cpp | 14 ++++++++------ esp32_marauder/WiFiScan.h | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index 4b634ef..cd1cc42 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -1835,12 +1835,14 @@ bool WiFiScan::mac_cmp(struct mac_addr addr1, struct mac_addr addr2) { return true; } -void WiFiScan::copyNimbleMac(const BLEAddress &addr, unsigned char out[6]) { - const uint8_t* bytes = addr.getNative(); // NimBLE gives MAC as uint8_t[6] - for (int i = 0; i < 6; i++) { - out[i] = bytes[i]; - } -} +#ifdef HAS_BT + void WiFiScan::copyNimbleMac(const BLEAddress &addr, unsigned char out[6]) { + const uint8_t* bytes = addr.getNative(); // NimBLE gives MAC as uint8_t[6] + for (int i = 0; i < 6; i++) { + out[i] = bytes[i]; + } + } +#endif bool WiFiScan::seen_mac(unsigned char* mac) { //Return true if this MAC address is in the recently seen array. diff --git a/esp32_marauder/WiFiScan.h b/esp32_marauder/WiFiScan.h index 8c9f46b..16afa12 100644 --- a/esp32_marauder/WiFiScan.h +++ b/esp32_marauder/WiFiScan.h @@ -721,7 +721,9 @@ class WiFiScan #endif bool seen_mac(unsigned char* mac); void save_mac(unsigned char* mac); - void copyNimbleMac(const BLEAddress &addr, unsigned char out[6]); + #ifdef HAS_BT + void copyNimbleMac(const BLEAddress &addr, unsigned char out[6]); + #endif bool filterActive(); bool RunGPSInfo(bool tracker = false, bool display = true, bool poi = false); void logPoint(String lat, String lon, float alt, String datetime, bool poi = false);