adafruit / adafruit/Adafruit_BLESniffer_Python
Device.appendOrUpdate RSSI filter typo
- Dominant language
- C
- Stars
- 106
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
When a new device is added via Device.appendOrUpdate, the RSSI check compares the `newDevice` against itself in the first logical expression ([line 34](https://github.com/adafruit/Adafruit_BLESniffer_Python/blob/master/SnifferAPI/Devices.py#L34)). 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)):
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in SnifferAPI/Devices.py at line 34 and inspect Device.appendOrUpdate, focusing on how the RSSI comparison uses newDevice and existingDevice. Confirm the intended threshold behavior from the surrounding logic, then verify that the filter compares the new device with the existing device in both expressions and preserves the correct add/update behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100