开发者

Android Bluetooth Pairing

开发者 https://www.devze.com 2023-02-18 22:47 出处:网络
Can anybody tell me how to find out which pairing technique phone used while开发者_Python百科 connecting to other device?

Can anybody tell me how to find out which pairing technique phone used while开发者_Python百科 connecting to other device?

I have a Nexus S(Android 2.3.3) and a BT device(Bluetooth2.1+EDR).

When I try to pair them, I dont have to give any input(passkey). As both devices are having bluetooth 2.1, I want to know which pairing technique they used.

Can we specify the pairing technique to phone?


When both devices are 2.1 and above the Secure Simple pairing (SSP) gets used instead of the legacy pairing (legacy pairing is the one where user was required to enter same PIN on both devices to connect and most of the cases PIN used to be well known common combinations of 0000 or 1234)

Secure simple pairing simplifies the process and gets rid of the need for PINs to be entered, instead it generates 6 digit passkeys automatically as part of the pairing process and user may only be required to verify/enter the passkey on one or more of the devices.

Secure Simple Pairing (SSP) further has few different association modes and the association model to be used is determined by the display and input capabilities on the devices that are trying to pair.

When there is no display or input to enter 6 digits on one of the devices, then "Just works" association model gets used , in this the user input is not required during pairing. In Android it is possible to force this model is SPP applications when using the createInsecureRfcommSocketToServiceRecord() API. This model gets used commonly when pairing with Headsets, other small devices without any display or input capability

Other association models are :

  • Numeric Comparison - Where a 6 digit number is shown on both devices and user is asked to confirm is they are the same. Used when both devices has display and capable of entering Yes/No.

  • Passkey entry - When one of the devices has only input capability and no output display capability and the other has an output / display capability, here the user will be asked to enter the 6 digits on the input only capable device as shown on the display capable device.

  • Out-of-Band - Where devices exchange pairing information over a different channel (other than Bluetooth) example NFC or some other secure mechanism.


You can either sniff the Bluetooth traffic or take a log to figure out which technique is being used. On a Nexus-S $adb shell hcidump -XVt will show you the log. If I/O capabiltiies are being exchanged than its Bluetooth 2.1 pairing.

Another option is to enable bluetoothd log in init.herring.rc file and you can figure out which pairing method is used.

Its most definitely Bluetooth 2.1 pairing in your case and the problem is elsewhere.

0

精彩评论

暂无评论...
验证码 换一张
取 消