Created
April 17, 2020 03:31
-
-
Save charlesmuchene/ffe8efa183a5b770a04785a68f85a80a to your computer and use it in GitHub Desktop.
Android as Peripheral - Advertising
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Advertisement data: only has Trace UUID to enable filtering | |
val advertiseData: AdvertiseData = AdvertiseData.Builder() | |
.addServiceUuid(Services.TRACE.serviceUUID) | |
.build() | |
// Advertise | |
bleAdvertiser.startAdvertising(advertiseSettings, advertiseData, adCallback) | |
// Advertisement callback - delivers advertising operation status | |
private inner class AdCallback : AdvertiseCallback() { | |
override fun onStartSuccess(settingsInEffect: AdvertiseSettings?) { ... } | |
override fun onStartFailure(errorCode: Int) { ... } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment