4

I was looking through the Device API in BlueZ 5.44 and am a bit confused about the difference between Connecting and Pairing to a device. I see that connecting is profile based while pairing seems to profile independent. Pairing seemingly has more to do with SDP and authentication.

However, after reading that documentation I am still a bit confused about where one begins and the other ends. For example, must a device be paired before it can be connected? If anyone has any Bluetooth docs or BlueZ docs that detail this they would be much appreciated.

zeus_masta_funk
  • 1,388
  • 2
  • 11
  • 34

2 Answers2

1

This is answered assuming that the OP intended to ask about classic bluetooth. classic pairing requires a lower layer bluetooth classic connection. whether a device need to be paired with another device is determined by the security level (defined in Generic Access Profile) of the devices involved. most Mobile Phones uses SecurityMode 4 ,Level 4 which enforces pairing for most profiles except SDP. This means that Service discovery can be done without pairing but the profiles which require a service level connection needs pairing. please see the details of the Security Modes in GAP profile section 5.2 in core_v5.0 bluetooth specification (https://www.bluetooth.com/specifications/bluetooth-core-specification) .confusion in the document mentioned by you can be avoided if you see service-level/profile-level connection and lower-layer connection separately.

bare_metal
  • 1,134
  • 9
  • 20
  • I see. So pairing is a lower level connection that might be required depending on each devices security as specified in their GAP configuration. Connecting a specific profile is then in turn dependent upon the security levels. However, the platform I'm working on has a dual-mode 4.0 controller - does this change the Classic Mode pairing or is it independent of LE pairing? Thanks again! – zeus_masta_funk Jul 19 '17 at 15:12
  • 1
    Classic and LE pairing is different (from Bluetooth 4.2 there is cross transport key generation feature, which allows the key generated by one transport to be used to generate the key for the other transport). The classic and LE pairing differs in the sense that the way by which the secret shared key is exchanged is different (in Bluetooth 4.0 and 4.1) and is also differentiated by whether the the lower layers (LMP) or higher layers (SMP) facilitate the pairing procedures. – bare_metal Jul 21 '17 at 13:56
  • 1
    classic pairing is the act of executing a set of procedures to securely create same secret key in two devices by mutual authentication and storing those keys. note that the key is never transferred over the air. do not confuse pairing as a lower level connection, see that to achieve pairing a lower-layer connection is required. The idea is to establish a trust relationship between the two devices (some devices shows a love symbol :) once pairing is completed). – bare_metal Jul 21 '17 at 14:16
1

Let's make things as simple as possible. What is pairing: it is an procedure to create the link key(both device will have the same secret key for encryption) for the secure connections. You do not want other person hear what you said via Bluetooth is't it.

The pairing procedure of course need connection.

The device can choose encrypt the link or not, and can decide which level on Bluetooth stack start encryption, i.e. profiles, protocols, or low level data link.

SDP as an profile is different since it is a profile to show local features to other device, hence when connect SDP, it basically does not need pairing.

Guo Xingmin
  • 1,013
  • 1
  • 7
  • 7