bluetoothandroid-bluetoothrfcomml2cap

Bluetooth protocol (RFCOMM, L2CAP and ACL)


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

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

L2CAP actually serves as the transport protocol for RFCOMM, so every RFCOMM connection is actually encapsulated within an L2CAP connection.

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. Since RFCOMM connection is encapsulated, then how serial port profile(SPP) can use RFCOMM connection? It should use L2CAP as well.

  2. 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.

Thanks for any explanation here.


Solution

  • 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.

    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