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

Auto bind #1035

Merged
merged 6 commits into from
Aug 1, 2021
Merged

Auto bind #1035

merged 6 commits into from
Aug 1, 2021

Conversation

davidgyoung
Copy link
Member

@davidgyoung davidgyoung commented Jul 4, 2021

Two new features:

  1. Auto Bind

Adds new methods to start beacon ranging and monitoring that allows forgoing manual calls to bind(...) and unbind(...) and the use of BeaconConsumer. This simplifies setup.

beaconManager.startMonitoring(@NonNull Region region)
beaconManager.stopMonitoring(@NonNull Region region)
beaconManager.startRangingBeacons(@NonNull Region region)
beaconManager.stopRangingBeacons(@NonNull Region region)

The old methods that do require a manual call to bind and a BeaconConsumer first still work:

beaconManager.startMonitoringBeaconsInRegion(@NonNull Region region)
beaconManager.stopMonitoringBeaconsInRegion(@NonNull Region region)
beaconManager.startRangingBeaconsInRegion(@NonNull Region region)
beaconManager.stopRangingBeaconsInRegion(@NonNull Region region)

  1. Adds support for beacon parsers based on 128-bit service UUIDs. Example:

beaconManager.getBeaconParsers().add(BeaconParser().setBeaconLayout("s:0-15=2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6,m:16-17=A6FF,p:18-18,i:0-15l"))

In the example above, a beacon with service UUID 2F234454-CF6D-4A0F-ADF2-F4911BA9FFA6 will be matched if the service data has the first two bytes 0xA6 0xFF. A single identifier will be parsed out of the beacon which will always be the same as the service UUID. This is useful for treating service advertisements as beacons for some use cases.

This change is available for testing in 2.19-beta5

@davidgyoung davidgyoung merged commit 4d61532 into master Aug 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant