Fix for non bluetooth hardware

This commit is contained in:
Just Call Me Koko
2025-11-24 13:20:01 -05:00
parent b714f274b5
commit 0fba6966a6
2 changed files with 11 additions and 7 deletions

View File

@@ -1835,12 +1835,14 @@ bool WiFiScan::mac_cmp(struct mac_addr addr1, struct mac_addr addr2) {
return true; return true;
} }
void WiFiScan::copyNimbleMac(const BLEAddress &addr, unsigned char out[6]) { #ifdef HAS_BT
const uint8_t* bytes = addr.getNative(); // NimBLE gives MAC as uint8_t[6] void WiFiScan::copyNimbleMac(const BLEAddress &addr, unsigned char out[6]) {
for (int i = 0; i < 6; i++) { const uint8_t* bytes = addr.getNative(); // NimBLE gives MAC as uint8_t[6]
out[i] = bytes[i]; for (int i = 0; i < 6; i++) {
} out[i] = bytes[i];
} }
}
#endif
bool WiFiScan::seen_mac(unsigned char* mac) { bool WiFiScan::seen_mac(unsigned char* mac) {
//Return true if this MAC address is in the recently seen array. //Return true if this MAC address is in the recently seen array.

View File

@@ -721,7 +721,9 @@ class WiFiScan
#endif #endif
bool seen_mac(unsigned char* mac); bool seen_mac(unsigned char* mac);
void save_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 filterActive();
bool RunGPSInfo(bool tracker = false, bool display = true, bool poi = false); bool RunGPSInfo(bool tracker = false, bool display = true, bool poi = false);
void logPoint(String lat, String lon, float alt, String datetime, bool poi = false); void logPoint(String lat, String lon, float alt, String datetime, bool poi = false);