From ef472af2ded68d1a62035fc02b5e3be3f86f84bb Mon Sep 17 00:00:00 2001 From: Julian Flake Date: Tue, 22 Oct 2019 16:41:14 +0200 Subject: [PATCH] Fix Beacons' MAC addresses conversion for comparison: shift by 16 bits instead of 8 bits (affecting #342?) --- src/macsniff.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/macsniff.cpp b/src/macsniff.cpp index 38a1a991..7307f345 100644 --- a/src/macsniff.cpp +++ b/src/macsniff.cpp @@ -39,7 +39,7 @@ void printKey(const char *name, const uint8_t *key, uint8_t len, bool lsb) { uint64_t macConvert(uint8_t *paddr) { uint64_t *mac; mac = (uint64_t *)paddr; - return (__builtin_bswap64(*mac) >> 8); + return (__builtin_bswap64(*mac) >> 16); } bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { @@ -134,4 +134,4 @@ bool mac_add(uint8_t *paddr, int8_t rssi, bool sniff_type) { // True if MAC WiFi/BLE was new return added; // function returns bool if a new and unique Wifi or BLE mac was // counted (true) or not (false) -} \ No newline at end of file +}