Skip to content

Commit

Permalink
filter out RSSI readings of 127
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgyoung committed May 14, 2015
1 parent 8e18923 commit fbfe4bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/altbeacon/beacon/service/RangedBeacon.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,13 @@ public void commitMeasurements() {
}

public void addMeasurement(Integer rssi) {
mTracked = true;
lastTrackedTimeMillis = System.currentTimeMillis();
filter.addMeasurement(rssi);
// Filter out unreasonable values per
// http://stackoverflow.com/questions/30118991/rssi-returned-by-altbeacon-library-127-messes-up-distance
if (rssi != 127) {
mTracked = true;
lastTrackedTimeMillis = System.currentTimeMillis();
filter.addMeasurement(rssi);
}
}

//kept here for backward compatibility
Expand Down

0 comments on commit fbfe4bb

Please sign in to comment.