From 175b52b512a1cfe63163407adbdaf2c2c6abf0a4 Mon Sep 17 00:00:00 2001 From: Just Call Me Koko Date: Fri, 10 Jul 2026 14:12:19 -0400 Subject: [PATCH] Add foxhunt to old NimBLE hardware --- esp32_marauder/WiFiScan.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/esp32_marauder/WiFiScan.cpp b/esp32_marauder/WiFiScan.cpp index e3d5d50..0b59b5c 100644 --- a/esp32_marauder/WiFiScan.cpp +++ b/esp32_marauder/WiFiScan.cpp @@ -469,9 +469,36 @@ extern "C" { #endif } } - else if (wifi_scan_obj.currentScanMode == BT_SCAN_ALL) { + else if ((wifi_scan_obj.currentScanMode == BT_SCAN_ALL) || + (wifi_scan_obj.currentScanMode == BT_SCAN_FOX_HUNT)) { if (buf >= 0) { + BleDevice ble_device; + if (name_length > 0) + ble_device.name = name; + else + ble_device.name = mac; + + ble_device.rssi = rssi; + + memcpy(ble_device.mac, mac_char, sizeof(mac_char)); + + int device_match_check = wifi_scan_obj.seenBLEDevice(ble_device); + + if (device_match_check >= 0) { + ble_device.selected = ble_devices->get(device_match_check).selected; + ble_device.name = ble_devices->get(device_match_check).name; + memcpy(ble_device.mac, ble_devices->get(device_match_check).mac, sizeof(mac_char)); + ble_devices->set(device_match_check, ble_device); + //Serial.println(ble_devices->get(device_match_check).name + " RSSI updated: " + String(ble_devices->get(device_match_check).rssi)); + return; + } + + if (wifi_scan_obj.currentScanMode == BT_SCAN_FOX_HUNT) + return; + + ble_devices->add(ble_device); + #ifndef HAS_MINI_SCREEN display_string.concat(text_table4[0]); #endif