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... | |
| struct | l2cCocEnConnectInd_t |
| Enhanced connection oriented channel connect indication structure. More... | |
| struct | l2cCocEnReconfigInd_t |
| Enhanced connection oriented channel reconfiguration 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. More... | |
| #define | L2C_COC_CID_NONE 0 |
| Invalid channel ID for connection oriented channels. More... | |
| #define | L2C_SIGNAL_ID_INVALID 0 |
| Invalid signal identifier. More... | |
| #define | L2C_MAX_EN_CHAN 5 |
| Max number of channels per enhanced connection request. More... | |
| #define | L2C_PAYLOAD_START (HCI_ACL_HDR_LEN + L2C_HDR_LEN) |
| Start of L2CAP payload in an HCI ACL packet buffer. More... | |
| #define | L2C_SIG_PKT_BASE_LEN (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_SIG_HDR_LEN) |
| L2CAP signaling packet base length, including HCI header. More... | |
| #define | L2C_LE_SDU_PKT_BASE_LEN (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_LE_SDU_HDR_LEN) |
| L2CAP LE SDU packet base length, including HCI header. More... | |
| #define | L2C_SIG_RSP_FLAG 0x01 |
| Signaling response code flag. More... | |
Typedefs | |
| typedef uint16_t | l2cCocRegId_t |
| Connection oriented channel registration ID. More... | |
| 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 uint8_t(* | l2cCocAcceptCb_t) (dmConnId_t connId, uint8_t numChans) |
| This callback function asks clients of connection oriented channels if a given number of channels can be created on the PSM. 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... | |
L2CAP Control Callback Events | |
| #define | L2C_CTRL_FLOW_ENABLE_IND 0 |
| Data flow enabled. More... | |
| #define | L2C_CTRL_FLOW_DISABLE_IND 1 |
| Data flow disabled. More... | |
L2CAP COC Channel Roles | |
| #define | L2C_COC_ROLE_NONE 0x00 |
| No role (unallocated) More... | |
| #define | L2C_COC_ROLE_INITIATOR 0x01 |
| Channel initiator. More... | |
| #define | L2C_COC_ROLE_ACCEPTOR 0x02 |
| Channel acceptor. More... | |
L2CAP COC Data Confirm Codes | |
| #define | L2C_COC_DATA_SUCCESS 0 |
| Data request successful. More... | |
| #define | L2C_COC_DATA_ERR_MEMORY 1 |
| Out of memory. More... | |
| #define | L2C_COC_DATA_ERR_OVERFLOW 2 |
| Transaction overflow. More... | |
L2CAP COC Callback Events | |
| #define | L2C_COC_CBACK_START 0x70 |
| L2C callback event starting value. More... | |
| #define | L2C_COC_CBACK_CBACK_END L2C_COC_DATA_CNF |
| L2C callback event ending value. More... | |
L2CAP Initialization | |
| 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 | |
| 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 | |
| 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... | |
| void | L2cCocSetAcceptCback (l2cCocRegId_t regId, l2cCocAcceptCb_t cback) |
| Set the channel accept callback. 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... | |
| bool_t | L2cCocEnhancedConnectReq (dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm, uint16_t credits, uint8_t numChan) |
| Send a request to open enhanced credit based channels. More... | |
| bool_t | L2cCocEnhancedReconfigReq (dmConnId_t connId, uint16_t mtu, uint16_t mps, uint8_t numChan, uint16_t *pChanList) |
| Send a request to reconfigure enhanced credit based channels. 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... | |
L2CAP Packet Constants | |
| #define | L2C_HDR_LEN 4 |
| L2CAP packet header length. More... | |
| #define | L2C_MIN_MTU 23 |
| Minimum packet payload MTU for LE. More... | |
| #define | L2C_SIG_HDR_LEN 4 |
| L2CAP signaling command header length. More... | |
| #define | L2C_LE_SDU_HDR_LEN 2 |
| L2CAP LE SDU data header length. More... | |
L2CAP Parameter Lengths | |
| #define | L2C_SIG_CONN_UPDATE_REQ_LEN 8 |
| Connection update request length. More... | |
| #define | L2C_SIG_CONN_UPDATE_RSP_LEN 2 |
| Connection update response length. More... | |
| #define | L2C_SIG_CMD_REJ_LEN 2 |
| Command reject length. More... | |
| #define | L2C_SIG_DISCONN_REQ_LEN 4 |
| Disconnection request length. More... | |
| #define | L2C_SIG_DISCONN_RSP_LEN 4 |
| Disconnection response length. More... | |
| #define | L2C_SIG_LE_CONN_REQ_LEN 10 |
| LE connection request length. More... | |
| #define | L2C_SIG_LE_CONN_RSP_LEN 10 |
| LE connection response length. More... | |
| #define | L2C_SIG_FLOW_CTRL_CREDIT_LEN 4 |
| Flow control credit lenghth. More... | |
| #define | L2C_SIG_EN_CONNECT_REQ_LEN 8 |
| Enhanced credit based connection request. More... | |
| #define | L2C_SIG_EN_CONNECT_RSP_LEN 8 |
| Enhanced credit based connection response. More... | |
| #define | L2C_SIG_EN_RECONFIG_REQ_LEN 4 |
| Enhanced credit based reconfiguration request. More... | |
| #define | L2C_SIG_EN_RECONFIG_RSP_LEN 2 |
| Enhanced credit based reconfiguration response. More... | |
L2CAP Connection Identifiers | |
| #define | L2C_CID_ATT 0x0004 |
| CID for attribute protocol. More... | |
| #define | L2C_CID_LE_SIGNALING 0x0005 |
| CID for LE signaling. More... | |
| #define | L2C_CID_SMP 0x0006 |
| CID for security manager protocol. More... | |
L2CAP Signaling Codes | |
| #define | L2C_SIG_CMD_REJ 0x01 |
| Comand reject. More... | |
| #define | L2C_SIG_DISCONNECT_REQ 0x06 |
| Disconnect request. More... | |
| #define | L2C_SIG_DISCONNECT_RSP 0x07 |
| Disconnect response. More... | |
| #define | L2C_SIG_CONN_UPDATE_REQ 0x12 |
| Connection parameter update request. More... | |
| #define | L2C_SIG_CONN_UPDATE_RSP 0x13 |
| Connection parameter update response. More... | |
| #define | L2C_SIG_LE_CONNECT_REQ 0x14 |
| LE credit based connection request. More... | |
| #define | L2C_SIG_LE_CONNECT_RSP 0x15 |
| LE credit based connection response. More... | |
| #define | L2C_SIG_FLOW_CTRL_CREDIT 0x16 |
| LE flow control credit. More... | |
| #define | L2C_SIG_EN_CONNECT_REQ 0x17 |
| Enhanced credit based connection request. More... | |
| #define | L2C_SIG_EN_CONNECT_RSP 0x18 |
| Enhanced credit based connection response. More... | |
| #define | L2C_SIG_EN_RECONFIG_REQ 0x19 |
| Enhanced credit based reconfiguration request. More... | |
| #define | L2C_SIG_EN_RECONFIG_RSP 0x1A |
| Enhanced credit based reconfiguration response. More... | |
L2CAP Command Rejection Codes | |
| #define | L2C_REJ_NOT_UNDERSTOOD 0x0000 |
| Command not understood. More... | |
| #define | L2C_REJ_MTU_EXCEEDED 0x0001 |
| Signaling MTU exceeded. More... | |
| #define | L2C_REJ_INVALID_CID 0x0002 |
| Invalid CID in request. More... | |
L2CAP Connection Parameter Update Result Codes | |
| #define | L2C_CONN_PARAM_ACCEPTED 0x0000 |
| Connection parameters accepted. More... | |
| #define | L2C_CONN_PARAM_REJECTED 0x0001 |
| Connection parameters rejected. More... | |
L2CAP Connection Result Codes | |
| #define | L2C_CONN_SUCCESS 0x0000 |
| Connection successful. More... | |
| #define | L2C_CONN_NONE 0x0001 |
| No connection result value available. More... | |
| #define | L2C_CONN_FAIL_PSM 0x0002 |
| Connection refused LE_PSM not supported. More... | |
| #define | L2C_CONN_FAIL_RES 0x0004 |
| Connection refused no resources available. More... | |
| #define | L2C_CONN_FAIL_AUTH 0x0005 |
| Connection refused insufficient authentication. More... | |
| #define | L2C_CONN_FAIL_AUTHORIZ 0x0006 |
| Connection refused insufficient authorization. More... | |
| #define | L2C_CONN_FAIL_KEY_SIZE 0x0007 |
| Connection refused insufficient encryption key size. More... | |
| #define | L2C_CONN_FAIL_ENC 0x0008 |
| Connection Refused insufficient encryption. More... | |
| #define | L2C_CONN_FAIL_INVALID_SCID 0x0009 |
| Connection refused invalid source CID. More... | |
| #define | L2C_CONN_FAIL_ALLOCATED_SCID 0x000A |
| Connection refused source CID already allocated. More... | |
| #define | L2C_CONN_FAIL_UNACCEPT_PARAM 0x000B |
| Connection refused unacceptable parameters. More... | |
| #define | L2C_CONN_FAIL_INVALID_PARAM 0x000C |
| Connection refused invalid parameters. More... | |
L2CAP Interal Connection Result Codes | |
| #define | L2C_CONN_FAIL_TIMEOUT 0xF000 |
| Request timeout. More... | |
L2CAP Signaling Parameter Value Ranges | |
| #define | L2C_PSM_MIN 0x0001 |
| PSM minimum. More... | |
| #define | L2C_PSM_MAX 0x00FF |
| PSM maximum. More... | |
| #define | L2C_CID_DYN_MIN 0x0040 |
| CID dynamic minimum. More... | |
| #define | L2C_CID_DYN_MAX 0x007F |
| CID dynamic maximum. More... | |
| #define | L2C_MTU_MIN 0x0017 |
| MTU minimum. More... | |
| #define | L2C_MPS_MIN 0x0017 |
| MPS minimum. More... | |
| #define | L2C_MPS_MAX 0xFFFD |
| MPS maximum. More... | |
| #define | L2C_CREDITS_MAX 0xFFFF |
| Credits maximum. More... | |
L2CAP Enhanced Connection Reconfigure Result Codes | |
| #define | L2C_RECONFIG_FAIL_MTU 0x0001 |
| Enhanced Reconfiguration refuded - cannot reduce MTU. More... | |
| #define | L2C_RECONFIG_FAIL_MPS 0x0002 |
| Enhanced Reconfiguration refuded - cannot reduce MPS on more than one channel. More... | |
| #define | L2C_RECONFIG_FAIL_CID 0x0003 |
| Enhanced Reconfiguration refuded - invalid CID. More... | |
| #define | L2C_RECONFIG_FAIL_PARAM 0x0004 |
| Enhanced Reconfiguration refuded - unacceptable parameters. More... | |
| #define L2C_CID_ATT 0x0004 |
CID for attribute protocol.
Definition at line 82 of file l2c_defs.h.
| #define L2C_CID_DYN_MAX 0x007F |
CID dynamic maximum.
Definition at line 157 of file l2c_defs.h.
| #define L2C_CID_DYN_MIN 0x0040 |
CID dynamic minimum.
Definition at line 156 of file l2c_defs.h.
| #define L2C_CID_LE_SIGNALING 0x0005 |
CID for LE signaling.
Definition at line 83 of file l2c_defs.h.
| #define L2C_CID_SMP 0x0006 |
CID for security manager protocol.
Definition at line 84 of file l2c_defs.h.
| #define L2C_COC_CBACK_CBACK_END L2C_COC_DATA_CNF |
| #define L2C_COC_CBACK_START 0x70 |
| #define L2C_COC_CID_NONE 0 |
| #define L2C_COC_REG_ID_NONE 0 |
| #define L2C_CONN_FAIL_ALLOCATED_SCID 0x000A |
Connection refused source CID already allocated.
Definition at line 138 of file l2c_defs.h.
| #define L2C_CONN_FAIL_AUTH 0x0005 |
Connection refused insufficient authentication.
Definition at line 133 of file l2c_defs.h.
| #define L2C_CONN_FAIL_AUTHORIZ 0x0006 |
Connection refused insufficient authorization.
Definition at line 134 of file l2c_defs.h.
| #define L2C_CONN_FAIL_ENC 0x0008 |
Connection Refused insufficient encryption.
Definition at line 136 of file l2c_defs.h.
| #define L2C_CONN_FAIL_INVALID_PARAM 0x000C |
Connection refused invalid parameters.
Definition at line 140 of file l2c_defs.h.
| #define L2C_CONN_FAIL_INVALID_SCID 0x0009 |
Connection refused invalid source CID.
Definition at line 137 of file l2c_defs.h.
| #define L2C_CONN_FAIL_KEY_SIZE 0x0007 |
Connection refused insufficient encryption key size.
Definition at line 135 of file l2c_defs.h.
| #define L2C_CONN_FAIL_PSM 0x0002 |
Connection refused LE_PSM not supported.
Definition at line 131 of file l2c_defs.h.
| #define L2C_CONN_FAIL_RES 0x0004 |
Connection refused no resources available.
Definition at line 132 of file l2c_defs.h.
| #define L2C_CONN_FAIL_TIMEOUT 0xF000 |
Request timeout.
Definition at line 147 of file l2c_defs.h.
| #define L2C_CONN_FAIL_UNACCEPT_PARAM 0x000B |
Connection refused unacceptable parameters.
Definition at line 139 of file l2c_defs.h.
| #define L2C_CONN_NONE 0x0001 |
No connection result value available.
Definition at line 130 of file l2c_defs.h.
| #define L2C_CONN_PARAM_ACCEPTED 0x0000 |
Connection parameters accepted.
Definition at line 121 of file l2c_defs.h.
| #define L2C_CONN_PARAM_REJECTED 0x0001 |
Connection parameters rejected.
Definition at line 122 of file l2c_defs.h.
| #define L2C_CONN_SUCCESS 0x0000 |
Connection successful.
Definition at line 129 of file l2c_defs.h.
| #define L2C_CREDITS_MAX 0xFFFF |
Credits maximum.
Definition at line 161 of file l2c_defs.h.
| #define L2C_HDR_LEN 4 |
L2CAP packet header length.
Definition at line 42 of file l2c_defs.h.
| #define L2C_LE_SDU_HDR_LEN 2 |
L2CAP LE SDU data header length.
Definition at line 45 of file l2c_defs.h.
| #define L2C_LE_SDU_PKT_BASE_LEN (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_LE_SDU_HDR_LEN) |
L2CAP LE SDU packet base length, including HCI header.
Definition at line 58 of file l2c_defs.h.
| #define L2C_MAX_EN_CHAN 5 |
Max number of channels per enhanced connection request.
Definition at line 49 of file l2c_defs.h.
| #define L2C_MIN_MTU 23 |
Minimum packet payload MTU for LE.
Definition at line 43 of file l2c_defs.h.
| #define L2C_MPS_MAX 0xFFFD |
MPS maximum.
Definition at line 160 of file l2c_defs.h.
| #define L2C_MPS_MIN 0x0017 |
MPS minimum.
Definition at line 159 of file l2c_defs.h.
| #define L2C_MTU_MIN 0x0017 |
MTU minimum.
Definition at line 158 of file l2c_defs.h.
| #define L2C_PAYLOAD_START (HCI_ACL_HDR_LEN + L2C_HDR_LEN) |
Start of L2CAP payload in an HCI ACL packet buffer.
Definition at line 52 of file l2c_defs.h.
| #define L2C_PSM_MAX 0x00FF |
PSM maximum.
Definition at line 155 of file l2c_defs.h.
| #define L2C_PSM_MIN 0x0001 |
PSM minimum.
Definition at line 154 of file l2c_defs.h.
| #define L2C_RECONFIG_FAIL_CID 0x0003 |
Enhanced Reconfiguration refuded - invalid CID.
Definition at line 170 of file l2c_defs.h.
| #define L2C_RECONFIG_FAIL_MPS 0x0002 |
Enhanced Reconfiguration refuded - cannot reduce MPS on more than one channel.
Definition at line 169 of file l2c_defs.h.
| #define L2C_RECONFIG_FAIL_MTU 0x0001 |
Enhanced Reconfiguration refuded - cannot reduce MTU.
Definition at line 168 of file l2c_defs.h.
| #define L2C_RECONFIG_FAIL_PARAM 0x0004 |
Enhanced Reconfiguration refuded - unacceptable parameters.
Definition at line 171 of file l2c_defs.h.
| #define L2C_REJ_INVALID_CID 0x0002 |
Invalid CID in request.
Definition at line 114 of file l2c_defs.h.
| #define L2C_REJ_MTU_EXCEEDED 0x0001 |
Signaling MTU exceeded.
Definition at line 113 of file l2c_defs.h.
| #define L2C_REJ_NOT_UNDERSTOOD 0x0000 |
Command not understood.
Definition at line 112 of file l2c_defs.h.
| #define L2C_SIG_CMD_REJ 0x01 |
Comand reject.
Definition at line 91 of file l2c_defs.h.
| #define L2C_SIG_CMD_REJ_LEN 2 |
Command reject length.
Definition at line 66 of file l2c_defs.h.
| #define L2C_SIG_CONN_UPDATE_REQ 0x12 |
Connection parameter update request.
Definition at line 94 of file l2c_defs.h.
| #define L2C_SIG_CONN_UPDATE_REQ_LEN 8 |
Connection update request length.
Definition at line 64 of file l2c_defs.h.
| #define L2C_SIG_CONN_UPDATE_RSP 0x13 |
Connection parameter update response.
Definition at line 95 of file l2c_defs.h.
| #define L2C_SIG_CONN_UPDATE_RSP_LEN 2 |
Connection update response length.
Definition at line 65 of file l2c_defs.h.
| #define L2C_SIG_DISCONN_REQ_LEN 4 |
Disconnection request length.
Definition at line 67 of file l2c_defs.h.
| #define L2C_SIG_DISCONN_RSP_LEN 4 |
Disconnection response length.
Definition at line 68 of file l2c_defs.h.
| #define L2C_SIG_DISCONNECT_REQ 0x06 |
Disconnect request.
Definition at line 92 of file l2c_defs.h.
| #define L2C_SIG_DISCONNECT_RSP 0x07 |
Disconnect response.
Definition at line 93 of file l2c_defs.h.
| #define L2C_SIG_EN_CONNECT_REQ 0x17 |
Enhanced credit based connection request.
Definition at line 99 of file l2c_defs.h.
| #define L2C_SIG_EN_CONNECT_REQ_LEN 8 |
Enhanced credit based connection request.
Definition at line 72 of file l2c_defs.h.
| #define L2C_SIG_EN_CONNECT_RSP 0x18 |
Enhanced credit based connection response.
Definition at line 100 of file l2c_defs.h.
| #define L2C_SIG_EN_CONNECT_RSP_LEN 8 |
Enhanced credit based connection response.
Definition at line 73 of file l2c_defs.h.
| #define L2C_SIG_EN_RECONFIG_REQ 0x19 |
Enhanced credit based reconfiguration request.
Definition at line 101 of file l2c_defs.h.
| #define L2C_SIG_EN_RECONFIG_REQ_LEN 4 |
Enhanced credit based reconfiguration request.
Definition at line 74 of file l2c_defs.h.
| #define L2C_SIG_EN_RECONFIG_RSP 0x1A |
Enhanced credit based reconfiguration response.
Definition at line 102 of file l2c_defs.h.
| #define L2C_SIG_EN_RECONFIG_RSP_LEN 2 |
Enhanced credit based reconfiguration response.
Definition at line 75 of file l2c_defs.h.
| #define L2C_SIG_FLOW_CTRL_CREDIT 0x16 |
LE flow control credit.
Definition at line 98 of file l2c_defs.h.
| #define L2C_SIG_FLOW_CTRL_CREDIT_LEN 4 |
Flow control credit lenghth.
Definition at line 71 of file l2c_defs.h.
| #define L2C_SIG_HDR_LEN 4 |
L2CAP signaling command header length.
Definition at line 44 of file l2c_defs.h.
| #define L2C_SIG_LE_CONN_REQ_LEN 10 |
LE connection request length.
Definition at line 69 of file l2c_defs.h.
| #define L2C_SIG_LE_CONN_RSP_LEN 10 |
LE connection response length.
Definition at line 70 of file l2c_defs.h.
| #define L2C_SIG_LE_CONNECT_REQ 0x14 |
LE credit based connection request.
Definition at line 96 of file l2c_defs.h.
| #define L2C_SIG_LE_CONNECT_RSP 0x15 |
LE credit based connection response.
Definition at line 97 of file l2c_defs.h.
| #define L2C_SIG_PKT_BASE_LEN (HCI_ACL_HDR_LEN + L2C_HDR_LEN + L2C_SIG_HDR_LEN) |
L2CAP signaling packet base length, including HCI header.
Definition at line 55 of file l2c_defs.h.
| #define L2C_SIG_RSP_FLAG 0x01 |
Signaling response code flag.
Definition at line 106 of file l2c_defs.h.
| typedef uint8_t(* l2cCocAcceptCb_t) (dmConnId_t connId, uint8_t numChans) |
| 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.
| connId | DM connection ID. |
| regId | The registration instance requiring authorization. |
| psm | The PSM of the registration instance. |
| typedef void(* l2cCocCback_t) (l2cCocEvt_t *pMsg) |
| typedef uint16_t l2cCocRegId_t |
| typedef void(* l2cCtrlCback_t) (wsfMsgHdr_t *pMsg) |
| typedef void(* l2cDataCback_t) (uint16_t handle, uint16_t len, uint8_t *pPacket) |
| anonymous enum |
COC callback events.
| uint16_t L2cCocConnectReq | ( | dmConnId_t | connId, |
| l2cCocRegId_t | regId, | ||
| uint16_t | psm | ||
| ) |
Initiate a connection to the given peer PSM.
| connId | DM connection ID. |
| regId | The associated registration instance. |
| psm | Peer PSM. |
| void L2cCocCreditSendTest | ( | uint16_t | cid, |
| uint16_t | credits | ||
| ) |
For testing purposes only.
| cid | The local channel identifier. |
| credits | Credits to send. |
| void L2cCocDataReq | ( | uint16_t | cid, |
| uint16_t | len, | ||
| uint8_t * | pPayload | ||
| ) |
Send an L2CAP data packet on the given connection oriented CID.
| cid | The local channel identifier. |
| len | The length of the payload data in pPacket. |
| pPayload | Packet payload data. |
| 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.
| regId | Registration instance ID. |
| void L2cCocDisconnectReq | ( | uint16_t | cid | ) |
Disconnect the channel for the given CID.
| cid | Channel ID. |
| bool_t L2cCocEnhancedConnectReq | ( | dmConnId_t | connId, |
| l2cCocRegId_t | regId, | ||
| uint16_t | psm, | ||
| uint16_t | credits, | ||
| uint8_t | numChan | ||
| ) |
Send a request to open enhanced credit based channels.
| connId | DM connection ID. |
| regId | The associated registration instance. |
| psm | The protocol slave multiplexer. |
| credits | The initial number of credits for each CID channel. |
| numChan | The number of channels to create - L2C_MAX_EN_CHAN max. |
| bool_t L2cCocEnhancedReconfigReq | ( | dmConnId_t | connId, |
| uint16_t | mtu, | ||
| uint16_t | mps, | ||
| uint8_t | numChan, | ||
| uint16_t * | pChanList | ||
| ) |
Send a request to reconfigure enhanced credit based channels.
| connId | DM connection ID. |
| mtu | The maximum transmission unit of each source CID channel. |
| mps | The maximum payload size on each source CID channel. |
| numChan | The number of channels to create (1 to L2C_MAX_EN_CHAN). |
| pChanList | A list of local CID to reconfigure (L2C_MAX_EN_CHAN channels, set unused to 0). |
| void L2cCocErrorTest | ( | uint16_t | result | ) |
For testing purposes only.
| result | Result code |
| void L2cCocInit | ( | void | ) |
Initialize L2C connection oriented channel subsystem.
| 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.
| cback | Client callback function. |
| pReg | Registration parameter structure. |
| void L2cCocSetAcceptCback | ( | l2cCocRegId_t | regId, |
| l2cCocAcceptCb_t | cback | ||
| ) |
Set the channel accept callback.
| regId | Registration instance ID. |
| cback | Client callback function. |
| void L2cDataReq | ( | uint16_t | cid, |
| uint16_t | handle, | ||
| uint16_t | len, | ||
| uint8_t * | pL2cPacket | ||
| ) |
Send an L2CAP data packet on the given CID.
| cid | The channel identifier. |
| handle | The connection handle. The client receives this handle from DM. |
| len | The length of the payload data in pPacket. |
| pL2cPacket | A buffer containing the packet. |
| 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.
| handle | The connection handle. |
| pConnSpec | Pointer to the connection specification structure. |
| 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.
| identifier | Identifier value previously passed from L2C to DM. |
| handle | The connection handle. |
| result | Connection update response result. |
| void L2cDmSigReq | ( | uint16_t | handle, |
| uint8_t | code, | ||
| uint16_t | len, | ||
| uint8_t * | pParam | ||
| ) |
Build and send a signaling packet.
| handle | The connection handle. |
| code | Type of command. |
| len | Length of the parameter. |
| pParam | parameters of command to send. |
| void L2cInit | ( | void | ) |
Initialize L2C subsystem.
| void L2cMasterInit | ( | void | ) |
Initialize L2C for operation as a Bluetooth LE master.
| 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.
| cid | channel identifier. |
| dataCback | Callback function for L2CAP data received for this CID. |
| ctrlCback | Callback function for control events for this CID. |
| void L2cSlaveInit | ( | void | ) |
Initialize L2C for operation as a Bluetooth LE slave.