Open GurgenHOVH opened 1 month ago
@GurgenHOVH yes android will try to pair if any device will try to connect, if you think your use case does not requires pairing on android, you can try to replace this code, and check if it still works for you without bonding
BluetoothProfile.STATE_CONNECTED -> {
handler?.post {
gattServer?.connect(device, true)
}
synchronized(bluetoothDevicesMap) {
bluetoothDevicesMap.put(
device.address,
device
)
}
onConnectionUpdate(device, status, newState)
}
Thanks @rohitsangwan01 for the quick reply. Will try and update here tomorrow.
Hi @rohitsangwan01 . The code you have provided works. Would be great to turn this into a setting and update the package. Thanks!
@gurgenAya not sure if you are using any encrypted Char which causes Pairing request, or maybe thats the default android behaviour, but now that you have removed the pairing code from the native part, that program should not be responsible for making pair requests, you can cross check with Nrf Connect app maybe, in NrfConnect you can create a GattServer, and then try to see if that also makes any pairing request
Hi @rohitsangwan01 . The code you have provided works. Would be great to turn this into a setting and update the package. Thanks!
Sure, maybe will add this as an optional setting to StartScan in next update
When trying to connect to the server hosted on an Android device, it opens a pairing request on both server and client.
The service and advertising looks like this: