Stumbled across a situation where I want my server to block access to a client device but cannot find a way to disconnect it without first accepting it to build the managed connection. If there is a way I missed, please let me know. I can reflect into the library to get to cancelConnection for now but would be nice if there was legit access to it.
This is the basic scenario.
override fun onDeviceConnectedToServer(device: BluetoothDevice) {
val address = device.address
if (allowed(address)) {
val newConnection = ...
newConnection.useServer(this)
newConnection.attachClientConnection(device)
} else {
Log.d(TAG, "BLE connection blocked $address")
cancelConnection(device)
}
}
Stumbled across a situation where I want my server to block access to a client device but cannot find a way to disconnect it without first accepting it to build the managed connection. If there is a way I missed, please let me know. I can reflect into the library to get to
cancelConnection
for now but would be nice if there was legit access to it.This is the basic scenario.