1.概念
The Link Manager Protocol (LMP) is used to control and negotiate all aspects of the operation of the Bluetooth connection between two devices. This includes the set-up and control of logical transports and logical links, and for control of physical links.简单的说,就是控制basebandc层的Logical transports和Logical links的:
2.Packet Format
LMP的SDU有两种形式,使用ACL-C的DM1格式:
LMP的msg以transaction的形式进行传输,拥有重要参数transaction ID:
0:master发起transaction
1:slaver发起transaction
同一组对话有相同的transaction ID。
3.LMP MSGs
定义了四种General response messages:
LMP MSGs不能超过DM1的17byte的packet长度(因为在ACL-C上创术嘛);
所有LM的MSGs都是固定长度(park状态下的广播除外)。
4.DEVICE FEATURES
蓝牙Device定义了诸多的Device Feature,LMP传输MSG时,必须确定双方是否支持这些Feature。具体参考SPec的465-470.用Feature Mask来表示是否支持某些device feature。定义如下(只是一部分):
5. LMP的Rules
这段讲述一些LMP应用的规则。下图是LMP连接建立的过程:
一些LMP上常用的PDU:
6.INFORMATIONAL REQUESTS
用来获取对方设备的相关信息。
(1)Timing Accuracy
7.MODES OF OPERATION
LMP的模式(connection、park、sniff等)的转换过程。
(1)Hold Mode
Slave Forces Hold Mode:
Master or Slave requests Hold Mode:
其余sniff、park等都是相似的过程。
8.LOGICAL TRANSPORTS
When a connection is first established between two devices the connection consists of the default ACL logical links: ACL-C (for LMP messages) and ACLU (for L2CAP data.) One or more synchronous logical transports (SCO or eSCO) may then be added. A new logical transport shall not be created if itwould cause all slots to be allocated to reserved slots on secondary LT_ADDRs.
SCO Logical Transport
Master Initiates an SCO Link:
Slave Initiates an SCO Link:
9.简单总结
LMP的数据建立在ACL-C上,以transaction的形式进行联系,LMP的PDU结构很简单,为Opcode+payLoad形式,分7bit的Opcode和15bit的Opcode两种形式。LMP的传输须知道device feature,在支持的情况下才可以传输响应的MSG。