Skip to content

Commit

Permalink
Moved max distance to be applied before adding it to the Kalman dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
mKeRix committed Aug 22, 2016
1 parent 4560df9 commit a1aa242
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ble.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ BLEScanner.prototype._handlePacket = function (peripheral) {
// default hardcoded value for beacon tx power
var txPower = advertisement.txPowerLevel || -59;
var distance = this._calculateDistance(peripheral.rssi, txPower);
var filteredDistance = this._filter(peripheral.id, distance);

// max distance parameter checking
var maxDistance = config.get('ble.max_distance') || 0;
if (maxDistance == 0 || filteredDistance <= maxDistance) {
if (maxDistance == 0 || distance <= maxDistance) {
var filteredDistance = this._filter(peripheral.id, distance);
var payload = {
id: peripheral.id,
name: advertisement.localName,
Expand Down

0 comments on commit a1aa242

Please sign in to comment.