Bluetooth pairing fails when using two android devices
aglogger opened this issue · 0 comments
aglogger commented
When using btPairDevice()
, the PairingBroadcastReceiver
(automatic pairing confirmation) is only registered for the device from which the paring request is started. However, since the corresponding confirmation, for successful pairing must be confirmed on both devices, the PairingBroadcastReceiver
must also be registered for the second device.
My solution for this problem was implementing a additional Rpc-function which is only used to register the broadcast receiver for any device as required.
public void btStartPairingBroadcastReceiver () {
mContext.registerReceiver(new PairingBroadcastReceiver(mContext), PairingBroadcastReceiver.filter);
}