Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in custom sample expiration for RunningAverageRssiFilter #627

Closed
cupakromer opened this issue Dec 11, 2017 · 1 comment · Fixed by #629
Closed

Regression in custom sample expiration for RunningAverageRssiFilter #627

cupakromer opened this issue Dec 11, 2017 · 1 comment · Fixed by #629
Labels

Comments

@cupakromer
Copy link
Contributor

Expected behavior

Setting a custom sample expiration using RunningAverageRssiFilter. setSampleExpirationMilliseconds changes the static expiration and thus running RSSI averages.

Actual behavior

All distance calculations use the value from RangedBeacon.sampleExpirationMilliseconds.

This is a regression of #523 (AltBeacon/android-beacon-library-reference#30). It was introduced in commit f084042 (PR #484) where the RunningAverageRssiFilter has it's value constantly reset after every cycle in RangedBeacon#commitMeasurements.

Steps to reproduce this behavior

  1. Set a custom sample expiration through RunningAverageRssiFilter.setSampleExpirationMilliseconds
  2. Range for a beacon
  3. Wait for the scan cycle to complete
  4. Check the value of the RunningAverageRssiFilter sample expiration

Android Beacon Library version

2.12.3

@cupakromer cupakromer added the bug label Dec 11, 2017
@davidgyoung
Copy link
Member

Yes, it appears I undid the change from #523 got undone in a bad merge.

I think it is safe to remove the sampleExpirationMilliseconds field from RangedBeacon entirely, including its use in commitMeasurements(). This field is a holdover from the 0.x version of the library where RangedBeacon was where this setting was stored. Only this method needs to be retained:

    //kept here for backward compatibility
    public static void setSampleExpirationMilliseconds(long milliseconds) {
        sampleExpirationMilliseconds = milliseconds;
        RunningAverageRssiFilter.setSampleExpirationMilliseconds(sampleExpirationMilliseconds);
    }

And it should probably be deprecated.

cupakromer added a commit that referenced this issue Dec 12, 2017
This fixes #627 which is a regression of
#523
(AltBeacon/android-beacon-library-reference#30). It was introduced in
commit f084042 (PR #484) where
the `RunningAverageRssiFilter` has it's value constantly reset after
every cycle in [`RangedBeacon#commitMeasurements`](f084042#diff-65311818bc092d4192549ca6a7932a8aR50).
cupakromer added a commit that referenced this issue Dec 12, 2017
This fixes #627 which is a regression of
#523
(AltBeacon/android-beacon-library-reference#30). It was introduced in
commit f084042 (PR #484) where
the `RunningAverageRssiFilter` has it's value constantly reset after
every cycle in [`RangedBeacon#commitMeasurements`](f084042#diff-65311818bc092d4192549ca6a7932a8aR50).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants