Mistake on this page? Email us
Data Structures | Macros | Typedefs
l2c_api.h File Reference

L2CAP subsystem API. More...

#include "dm_api.h"
#include "l2c_defs.h"
Include dependency graph for l2c_api.h:

Go to the source code of this file.

Data Structures

struct  l2cCocReg_t
 Connection oriented channel registration structure. More...
 
struct  l2cCocConnectInd_t
 Connection oriented channel connect indication structure. More...
 
struct  l2cCocDisconnectInd_t
 Connection oriented channel disconnect indication structure. More...
 
struct  l2cCocDataInd_t
 Connection oriented channel data indication structure. More...
 
struct  l2cCocDataCnf_t
 Connection oriented channel disconnect indication structure. More...
 
union  l2cCocEvt_t
 Connection oriented channel event structure. More...
 
struct  l2cCfg_t
 Configurable parameters. More...
 

Macros

#define L2C_COC_REG_ID_NONE   0
 Invalid channel registration ID for connection oriented channels.
 
#define L2C_COC_CID_NONE   0
 Invalid channel ID for connection oriented channels.
 
#define L2C_SIGNAL_ID_INVALID   0
 Invalid signal identifier.
 
L2CAP Control Callback Events

Control callback message events

#define L2C_CTRL_FLOW_ENABLE_IND   0
 Data flow enabled.
 
#define L2C_CTRL_FLOW_DISABLE_IND   1
 Data flow disabled.
 
L2CAP COC Channel Roles

Connection oriented channel initiator/acceptor role

#define L2C_COC_ROLE_NONE   0x00
 No role (unallocated)
 
#define L2C_COC_ROLE_INITIATOR   0x01
 Channel initiator.
 
#define L2C_COC_ROLE_ACCEPTOR   0x02
 Channel acceptor.
 
L2CAP COC Data Confirm Codes

Connection oriented channel data confirm status values

#define L2C_COC_DATA_SUCCESS   0
 Data request successful.
 
#define L2C_COC_DATA_ERR_MEMORY   1
 Out of memory.
 
#define L2C_COC_DATA_ERR_OVERFLOW   2
 Transaction overflow.
 

Typedefs

typedef uint16_t l2cCocRegId_t
 Connection oriented channel registration ID.
 
typedef void(* l2cDataCback_t) (uint16_t handle, uint16_t len, uint8_t *pPacket)
 This callback function sends a received L2CAP packet to the client. More...
 
typedef void(* l2cCtrlCback_t) (wsfMsgHdr_t *pMsg)
 This callback function sends control messages to the client. More...
 
typedef void(* l2cCocCback_t) (l2cCocEvt_t *pMsg)
 This callback function sends data and other events to connection oriented channels clients. More...
 
typedef uint16_t(* l2cCocAuthorCback_t) (dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
 This callback function is used for authoriztion of connection oriented channels. More...
 

Functions

L2CAP Initialization

Initialization and registration functions

void L2cInit (void)
 Initialize L2C subsystem. More...
 
void L2cMasterInit (void)
 Initialize L2C for operation as a Bluetooth LE master. More...
 
void L2cSlaveInit (void)
 Initialize L2C for operation as a Bluetooth LE slave. More...
 
L2CAP CID Functions

Register and send data over a CID

void L2cRegister (uint16_t cid, l2cDataCback_t dataCback, l2cCtrlCback_t ctrlCback)
 called by the L2C client, such as ATT or SMP, to register for the given CID. More...
 
void L2cDataReq (uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket)
 Send an L2CAP data packet on the given CID. More...
 
void L2cDmSigReq (uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam)
 Build and send a signaling packet. More...
 
L2CAP COC Functions

Connection Oriented Channels Functions

void L2cCocInit (void)
 Initialize L2C connection oriented channel subsystem. More...
 
l2cCocRegId_t L2cCocRegister (l2cCocCback_t cback, l2cCocReg_t *pReg)
 Register to use a connection oriented channel, as either a channel acceptor, initiator, or both. If registering as channel acceptor then the PSM is specified. After registering a connection can be established by the client using this registration instance. More...
 
void L2cCocDeregister (l2cCocRegId_t regId)
 Deregister and deallocate a connection oriented channel registration instance. This function should only be called if there are no active channels using this registration instance. More...
 
uint16_t L2cCocConnectReq (dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
 Initiate a connection to the given peer PSM. More...
 
void L2cCocDisconnectReq (uint16_t cid)
 Disconnect the channel for the given CID. More...
 
void L2cCocDataReq (uint16_t cid, uint16_t len, uint8_t *pPayload)
 Send an L2CAP data packet on the given connection oriented CID. More...
 
void L2cCocErrorTest (uint16_t result)
 For testing purposes only. More...
 
void L2cCocCreditSendTest (uint16_t cid, uint16_t credits)
 For testing purposes only. More...
 
L2CAP Connection Parameter Update Functions
void L2cDmConnUpdateReq (uint16_t handle, hciConnSpec_t *pConnSpec)
 For internal use only. This function is called by DM to send an L2CAP connection update request. More...
 
void L2cDmConnUpdateRsp (uint8_t identifier, uint16_t handle, uint16_t result)
 For internal use only. This function is called by DM to send an L2CAP connection update response. More...
 

Variables

L2CAP Configuration Structure

Pointer to structure containing initialization details of the L2CAP Subsystem. To be configured by Application.

l2cCfg_tpL2cCfg
 Configuration pointer.
 

L2CAP COC Callback Events

Connection oriented channel callback events.

#define L2C_COC_CBACK_START   0x70
 L2C callback event starting value.
 
#define L2C_COC_CBACK_CBACK_END   L2C_COC_DATA_CNF
 L2C callback event ending value.
 
enum  { L2C_COC_CONNECT_IND = L2C_COC_CBACK_START, L2C_COC_DISCONNECT_IND, L2C_COC_DATA_IND, L2C_COC_DATA_CNF }
 COC callback events. More...
 

Detailed Description

L2CAP subsystem API.

Copyright (c) 2009-2018 Arm Ltd. All Rights Reserved. ARM Ltd. confidential and proprietary.

IMPORTANT. Your use of this file is governed by a Software License Agreement ("Agreement") that must be accepted in order to download or otherwise receive a copy of this file. You may not use or copy this file for any purpose other than as described in the Agreement. If you do not agree to all of the terms of the Agreement do not use this file and delete all copies in your possession or control; if you do not have a copy of the Agreement, you must contact Arm Ltd. prior to any use, copying or further distribution of this software.

Definition in file l2c_api.h.

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.