I’ve implemented a GATT-server in my application using this library: GitHub - NordicSemiconductor/Android-BLE-Library: A library that makes working with Bluetooth LE on Android a pleasure. Seriously.
I asks for permissions and added all necessary uses-permission tags in AndroidManifest file. When I start the application, the GATT-server starts and works perfectly. I have downloaded Nrf Connect on multiple devices and scanned for the application on Android and iOS devices. Everything works fine on Xiaomi Mi 9T, Samsung Galaxy S10 and many different Huawei devices. Nrf Connect finds my GATT-server device and able to connect to. However, when I start Nrf connect on Samsung Galaxy S9 or Note 9 devices, my device doesn’t appear in the scan result list (however, it works perfectly on S10). I used the following code to build AdvertiseSettings and AdvertiseData objects:
fun settings(): AdvertiseSettings {
return AdvertiseSettings.Builder()
.setAdvertiseMode(AdvertiseSettings.ADVERTISE_MODE_LOW_LATENCY)
.setConnectable(true)
.setTimeout(0)
.setTxPowerLevel(AdvertiseSettings.ADVERTISE_TX_POWER_HIGH)
.build()
}
fun advertiseData(serviceUUIDs: List<UUID>): AdvertiseData {
val builder = AdvertiseData.Builder()
.setIncludeDeviceName(true)
.setIncludeTxPowerLevel(false)
for (serviceUUID in serviceUUIDs)
builder.addServiceUuid(ParcelUuid(serviceUUID))
return builder.build()
}
The strange thing is that everything works fine (scanning, connecting, sending or receiving data) on all devices except on S9 series phones. Is there any platform specific thing or bug I missed?