Coder Social home page Coder Social logo

Comments (5)

davidgyoung avatar davidgyoung commented on July 17, 2024

Nice catch, thank you!

Fixed in bfd2d7d.

This will be available in the next binary release by the end of the week. Let me know if you need something sooner.

from android-ibeacon-service.

rnevet avatar rnevet commented on July 17, 2024

I modified a local version.

Just a comment,
I would document that call the set*ScanPeriod functions won't take effect if scanning is in progress and it's necessary to call setScanPeriods() to apply the changes if you already started scanning.

Or another options is to check if the service interface is there and then call the setScanPeriods() - less flexible but an easier use case.

from android-ibeacon-service.

davidgyoung avatar davidgyoung commented on July 17, 2024

Good point. I don't want to make the call to setScanPeriods() automatic, because it becomes a remote call that throws a RemoteException. The real intention is that this is configured up front and not at run time. (Although nothing stops you from doing that if you really want.)

How about this for documentation?

/**
 * Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for iBeacons when no
 * ranging/monitoring clients are in the foreground. The new value will take affect the next time
 * the IBeaconManager transitions between background and foreground mode.  To have it take effect
 * as soon as the next scan cycle starts, call setScanPeriods()
 * @param p
 */
public void setBackgroundScanPeriod(long p) {
    backgroundScanPeriod = p;
}

from android-ibeacon-service.

rnevet avatar rnevet commented on July 17, 2024

My suggestion is changing the setScanPeriods to updateScanPeriods (to use a different terminology then the other set functions) and document it something like this:

/**
 * Updates an already running scan with scanPeriod/betweenScanPeriod according to Background/Foreground state.
 * Change will take effect on next scan cycle or pause.
 * @throws RemoteException - If the IBeaconManager is not bound to the service.
 */
    public void updateScanPeriods() throws RemoteException {

And this is my suggestion for the other set functions.

    /**
     * Sets the duration in milliseconds of each Bluetooth LE scan cycle to look for iBeacons.
     * This function is used to setup the period before starting a scan or switching between background/foreground.
     * To have it effect on an already running scan (when the next cycle start), call {@link #setScanPeriods}
     * @param p
     */
    public void setForegroundScanPeriod(long p) {

from android-ibeacon-service.

davidgyoung avatar davidgyoung commented on July 17, 2024

Changed as described in 49d11ad

from android-ibeacon-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.