蓝牙学习(4) -- L2CAP

L2CAP in protocol

首先看一下L2CAP在Bluetooth protocol architecture diagram中的位置:
蓝牙学习(4) -- L2CAP

Features of L2CAP

Logical Link Control and Adaptation Protocol (L2CAP) 主要有如下功能:

  1. Segmentation
    L2CAP层接收的frames最长为64KB。 当应用层收发的Frame的长度大于这个限制时。L2CAP层负责包的segmenation.

  2. 上层协议multiplexing
    由于在低层协议的frame中并没有一个protocol type这样的field来明确定义协议,因此L2CAP层需要通过frame的解析来获取协议的类型, 包括 RFCOMM, SDP, 或者 Telephony Control.

  3. Quality of Service
    包括建立connection,negotiations以及flow control, retransmission

蓝牙学习(4) -- L2CAP

Interface to Controller

一般情况controller相关的部分直接由蓝牙chipset提供. 如下图中的LMP, ACL, SCO, baseband, 以及Radio相关部分。

蓝牙学习(4) -- L2CAP

因此HCI接口定义了host和controller之间的接口。
蓝牙学习(4) -- L2CAP

reference

https://os.itec.kit.edu/downloads/sa_2006_roehricht-martin_flow-control-in-bluez.pdf