adafruit / Adafruit_BLESniffer_Python

Python API for Adafruit's Bluefruit LE Sniffer
Other
101 stars 51 forks source link

Device.appendOrUpdate RSSI filter typo #10

Open k-mack opened 7 years ago

k-mack commented 7 years ago

When a new device is added via Device.appendOrUpdate, the RSSI check compares the newDevice against itself in the first logical expression (line 34). I believe it should compare the new device against the existing one (like it does in the second logical expression).

It looks like the new device is to be added if its RSSI is less than or greater than the existing device's (by some threshold). If so, wouldn't switching the two devices in the second logical expression make for a better filter? For example,

if (newDevice.RSSI < (existingDevice.RSSI - 5)) or (newDevice.RSSI > (existingDevice.RSSI+2)):