I'm trying to connect to BLE device automatically by using this answer.
I've successfully set up BroadcastReceiver for BluetoothDevice.ACTION_PAIRING_REQUEST action and looks it works ok with PIN pairing, but in case of passkey app receive BluetoothDevice.PAIRING_VARIANT_PASSKEY error, and device.setPin() have no effect. and as I can see in android.bluetooth.BluetoothDevice setPasskey() is not accessible:
/** @hide */
public boolean setPasskey(int passkey) {
//TODO(BT)
/*
try {
return sService.setPasskey(this, true, 4, passkey);
} catch (RemoteException e) {Log.e(TAG, "", e);}*/
return false;
}
so, it there any possibility to connect with passkey automatically?