本文介绍了蓝牙协议(RFCOMM、L2CAP 和 ACL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从我从Bluetooth Essentials for Programmers 中读到的,这本书提到了一些我不太明白的点.

From what I've read from Bluetooth Essentials for Programmers, this books mentions some points that I dont quite understand.

RFCOMM 是一种可靠的基于流的协议.L2CAP 是一种基于数据包的协议,可配置为具有不同级别的可靠性.

RFCOMM is a reliable stream-based protocol. L2CAP is a packet-based protocol that can be configured with varying levels of reliability.

L2CAP 实际上充当 RFCOMM 的传输协议,因此每个 RFCOMM 连接实际上都封装在一个 L2CAP 连接中.

这真的让我很困惑,因为这两种协议是不同类型的协议(一种是基于流的,另一种是基于数据包的).所以根据它的解释,我有以下几个问题.

This really confuses me since these two protocol are different types of protocols (one is stream based while the other is packet based). So based on its explanation, I have some questions in the following.

  1. 既然封装了RFCOMM连接,那么串口配置文件(SPP)如何使用RFCOMM连接呢?它也应该使用 L2CAP.

  1. Since RFCOMM connection is encapsulated, then how serial port profile(SPP) can use RFCOMM connection? It should use L2CAP as well.

A2DP 使用 L2CAP 连接.这对我来说是一样的,因为 L2CAP 和 RFCOMM 被封装在 ACL 连接中,这是否意味着 A2DP 使用 ACL 连接?我知道这是不正确的,但如何在这里解释.

A2DP uses L2CAP connection. This means the same to me since L2CAP and RFCOMM are encapsulated within ACL connection, should this mean A2DP uses ACL connection? I know this is incorrect but how to explain this here.

感谢您的解释.

推荐答案

封装可以在设备"驱动程序级别,因此它对您不可见,就像您从未创建"以太网数据包一样,但您仍然能够在本地使用 TCP/IP,这是怎么回事?同样,RFCOMM 使用 L2CAP,但并不意味着您需要了解 L2CAP 才能使用.

The encapsulation could be at the "device" driver level so it would be invisible to you, its like you never "created" an Ethernet packet, but you still able to use TCP/IP natively, how come? same thing here, RFCOMM uses L2CAP, but doesn't mean you need to know L2CAP to use.

通常在您不想麻烦其他事情时使用封装,在这种情况下,他们不想麻烦信令问题,RFCOMM 用于串行接口,因此他们不想处理Serial接口的信令问题

Usually encapsulation is used when you don't want to hassle with something else, in this case they didn't want to hassle with the signalling issue, RFCOMM is used for Serial interface, so they didn't want to handle the signalling issue of Serial interfaces

这篇关于蓝牙协议(RFCOMM、L2CAP 和 ACL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-26 08:33