Android-BLE-Library
Android-BLE-Library copied to clipboard
Samsung Galaxy S9 couldn't find device
I've implemented a GATT-server in my application. 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 perfecetly. 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 10 and many different Huawei devices. Nrf Connect finds my 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. 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 I missed?
P.S.: If I run the application on Xiaomi 9T Pro, Samsung S9 can also find my devices but running it on low budget phones like Realme or iHunt, the S9 devices can't see it.