Mistake on this page? Email us
Modules
Logical Link Control and Adaptation Protocol (L2CAP)

Modules

 L2CAP API
 

Detailed Description

Introduction

diagram_l2cap.png
Figure 1. BLE Stack: L2CAP

The L2C subsystem implements the LE L2CAP protocol. It is a substantially scaled-down version of regular Bluetooth L2CAP.

L2C interfaces to HCI to send and receive ACL packets. The ATT and SMP protocol layers interface to L2C to send and receive L2CAP packets. L2C also interfaces to DM to perform the L2CAP connection update procedure.

In the TX data path, the main function of L2C is building L2CAP packets and sending them to HCI. L2C also implements flow control for the TX data path. L2C may in the future implement admission control in the TX path, allowing more optimal buffer sharing between multiple simultaneous links.

In the RX data path, its main function is receiving packets from HCI and routing them to either SMP or ATT. L2C also implements the connection parameter update procedure.

For full API, see L2CAP API

Subsystem Architecture

diagram_l2capss.png
Figure 2. L2CAP Subsystem

Module l2c_api contains the API. Module l2c_main contains the main API function implementation, main event handler, and functions for processing packets. Module l2c_master contains API functions and other functions used only when operating as an LE master. Module l2c_slave contains API functions and other functions used only when operating as an LE slave. Module lcc_coc contains functions for L2CAP Connection Oriented Channels.

Usage Scenarios

This section describes example scenarios for initialization and connection.

Initialization

Figure 2 shows the initialization process. In this example, the system supports operation as both a master and a slave so L2cMasterInit() and L2cSlaveInit() are called. Then function L2cSlaveHandlerInit() is called after L2cSlaveHandler() is set up in the WSF OS implementation.

operation_l2cap_init.png
Figure 3. Initialization

Data Path

Figure 3 shows the operation of the data path with ATT shown as an example L2C client. ATT calls L2cDataReq() to send a packet to L2C. Then L2C calls HciSendAclData() to send the packet to HCI. In the receive direction, HCI calls HciAclDataCback() to send a packet to L2C. L2C calls ATT callback function attDataCback() to send the packet to ATT.

operation_l2cap_datapath.png
Figure 4. Data Path

Connection Parameter Update

Figure 4 shows a connection parameter update procedure with the stack operating as a slave. DM calls L2cDmConnUpdateReq() to initiate the process. L2C builds and sends an L2CAP Connection Parameter Update Request. The peer device receives the request and initiates a connection update procedure. When the procedure completes, an HCI LE Connection Update Complete Event is sent from HCI to DM. Then the L2CAP Connection Parameter Update Response is received from the peer and L2C calls DmL2cConnUpdateCnf().

operation_l2cap_connparamupdate.png
Figure 5. Connection Parameter Update



Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.