Specifying a link key in android without pairing

I am trying to determine if there is a way in android to associate a specific link key with an existing instance of a remote Bluetooth device.

In fact, I want to create a connection with an undetectable Bluetooth device without going through a pairing or pairing procedure.

I can’t set the link key with the device in the standard pairing procedure, because I work with my own custom pairing mechanism. I would prefer to complete this task without using my own code, but if I need to, I will do it.

+3
source share
2 answers

api .

(aka bonding) , , , .

, / , Bluetooth .

/ , android bluez, .. , . , /. note - - .. bluetooth

+2
. , android.bluetooth IBluetooth.aidl IBluetoothCallback.aidl( ).

IBluetooth, BluetoothService IBluetooth.aidl. , ,

setPin(String address, byte[] pin)

Bluetooth , , HashMap BluetoothEventLoop. setPin(), , ​​:

setPin(<address>) called but no native data available, ignoring. Maybe the PasskeyAgent Request was cancelled by the remote device or by bluez.

, ( ) , , 500 , , setPin().

+16

Source: https://habr.com/ru/post/1780743/


All Articles