蓝牙SPP协议学习记录

SPP的链路依赖关系

从RF到用户层

基带 -> HCI -> L2CAP -> SDP -> RFCOMM -> SPP

SPP链路建立

 蓝牙SPP协议学习记录_第1张图片

14.5.1 Establish link and set up virtual serial connection. This procedure refers to performing the steps necessary to establish a connection to an emulated serial port (or equivalent) in a remote device. The steps in this procedure are:
1) Submit a query using SDP to find out the RFCOMM Server channel number of the desired application in the remote device. This might include a browsing capability to let the user select among available ports (or services) in the peer device.【选择SPP对应的通道以及SPP的UUID】Alternatively, if it is known exactly which service to contact, it is sufficient look up the necessary parameters using the Service Class ID associated with the desired service.
2) Optionally, require authentication of the remote device to be performed. Also optionally, require encryption to be turned on.
3) Request a new L2CAP channel to the remote RFCOMM entity.【SPP的链路依赖于L2CAP链路】
4) Initiate an RFCOMM session on the L2CAP channel.
5) Start a new data link connection on the RFCOMM session, using the aforementioned server channel number.
After step 5, the virtual serial cable connection is ready to be used for communication between applications on both sides.

SPP链路鉴权

14.5.2 Accept link and establish virtual serial connection.
This procedure refers to taking part in the following steps:
1) If requested by the remote device, take part in authentication procedure and, upon further request, turn on encryption.【当远端设备发起连接请求,将执行鉴权动作】
2) Accept a new channel establishment indication from L2CAP.
3) Accept an RFCOMM session establishment on that channel.
4) Accept a new data link connection on the RFCOMM session. This may trigger a local request to authenticate the remote device and turn on encryption, if the user has required that for the emulated serial port being connected to (and authentication/encryption procedures have not already been carried out).
14.5.3 Register Service record for application in local SDP database.
This procedure refers to registration of a service record for an emulated serial port (or equivalent) in the SDP database. This implies the existence of a Service Database, and the ability to respond to SDP queries.
 

你可能感兴趣的:(蓝牙,学习)