Skip to content

Instantly share code, notes, and snippets.

@charlesmuchene
Created April 17, 2020 03:31
Embed
What would you like to do?
Android as Peripheral - Advertising
// 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