schollz / find3

High-precision indoor positioning framework, version 3.
https://www.internalpositioning.com/doc
MIT License
4.65k stars 366 forks source link

Ability to filter out randomised MAC addresses #15

Closed victorhooi closed 6 years ago

victorhooi commented 6 years ago

(See https://github.com/schollz/find/issues/173)

We should have the ability fo filter out randomised MAC addresses. (e.g. from iOS 8+, Android 6.0+, Windows 10 etc.).

I believe on iOS, they set the U/L bit to 1, so that should be reasonably easy to filter out?

https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local

Universally administered and locally administered addresses are distinguished by setting the second-least-significant bit of the first octet of the address. This bit is also referred to as the U/L bit, short for Universal/Local, which identifies how the address is administered. If the bit is 0, the address is universally administered. If it is 1, the address is locally administered. In the example address 06-00-00-00-00-00 the first octet is 06 (hex), the binary form of which is 00000110, where the second-least-significant bit is 1. Therefore, it is a locally administered address.

At the API, when we return a location, it could have a boolean, "randomised". E.g.:

...
        "toilets": [
            {
                "device": "wifi-ae:7e:d9:e0:6e:40",
                "probability": 0.19580419580419584,
                "timestamp": "2018-03-07T05:56:28.669Z",
                "randomised": True
            },
            {
                "device": "wifi-3e:ce:41:a2:ea:58",
                "probability": 0.23326229508196722,
                "timestamp": "2018-03-07T05:56:28.598Z"
                "randomised": False
            },
            {
                "device": "wifi-ec:b1:d7:5f:03:0a",
                "probability": 0.23577049180327866,
                "timestamp": "2018-03-07T05:56:28.177Z"
                "randomised": True
            }
        ]
    },
    "message": "got locations",
    "success": true
}

And for the React frontend - we can have a slider button to show/hide randomised devices.

schollz commented 6 years ago

This has been added, but needs documentation