45 #define L2C_CTRL_FLOW_ENABLE_IND 0 46 #define L2C_CTRL_FLOW_DISABLE_IND 1 50 #define L2C_COC_REG_ID_NONE 0 53 #define L2C_COC_CID_NONE 0 56 #define L2C_SIGNAL_ID_INVALID 0 62 #define L2C_COC_ROLE_NONE 0x00 63 #define L2C_COC_ROLE_INITIATOR 0x01 64 #define L2C_COC_ROLE_ACCEPTOR 0x02 71 #define L2C_COC_DATA_SUCCESS 0 72 #define L2C_COC_DATA_ERR_MEMORY 1 73 #define L2C_COC_DATA_ERR_OVERFLOW 2 80 #define L2C_COC_CBACK_START 0x70 92 #define L2C_COC_CBACK_CBACK_END L2C_COC_DATA_CNF 353 void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket);
367 void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam);
460 void L2cCocDataReq(uint16_t cid, uint16_t len, uint8_t *pPayload);
476 uint16_t credits, uint8_t numChan);
492 uint8_t numChan, uint16_t *pChanList);
uint16_t dataLen
packet data length
uint16_t cid
Local channel ID.
void L2cDataReq(uint16_t cid, uint16_t handle, uint16_t len, uint8_t *pL2cPacket)
Send an L2CAP data packet on the given CID.
wsfMsgHdr_t hdr
Header structure.
Connection oriented channel registration structure.
void L2cInit(void)
Initialize L2C subsystem.
wsfMsgHdr_t hdr
Header structure.
uint8_t dmConnId_t
Connection identifier.
void(* l2cCocCback_t)(l2cCocEvt_t *pMsg)
This callback function sends data and other events to connection oriented channels clients...
uint16_t cid
Local channel ID.
void L2cCocDataReq(uint16_t cid, uint16_t len, uint8_t *pPayload)
Send an L2CAP data packet on the given connection oriented CID.
uint16_t psm
Connected PSM.
void L2cCocCreditSendTest(uint16_t cid, uint16_t credits)
For testing purposes only.
uint16_t mps
Maximum receive PDU fragment size.
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...
void L2cCocDisconnectReq(uint16_t cid)
Disconnect the channel for the given CID.
uint16_t cid
Local channel ID.
void(* l2cDataCback_t)(uint16_t handle, uint16_t len, uint8_t *pPacket)
This callback function sends a received L2CAP packet to the client.
bool_t authoriz
TRUE if authorization is required.
uint16_t L2cCocConnectReq(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
Initiate a connection to the given peer PSM.
l2cCocConnectInd_t connectInd
Channel connect indication.
Received enhanced reconfiguration indication.
uint8_t role
Channel initiator/acceptor role.
uint16_t(* l2cCocAuthorCback_t)(dmConnId_t connId, l2cCocRegId_t regId, uint16_t psm)
This callback function is used for authoriztion of connection oriented channels.
bool_t req
TRUE if indicating a request, else a response.
#define L2C_MAX_EN_CHAN
Max number of channels per enhanced connection request.
wsfMsgHdr_t hdr
Header structure.
Connection oriented channel disconnect indication structure.
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.
Connection oriented channel connect indication structure.
void L2cDmSigReq(uint16_t handle, uint8_t code, uint16_t len, uint8_t *pParam)
Build and send a signaling packet.
Channel disconnect indication.
uint8_t cidLen
Number of channels in cidList.
uint16_t reqTimeout
Request timeout in seconds.
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...
Connection oriented channel event structure.
uint8_t * pData
Pointer to packet data.
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.
L2CAP constants and definitions from the Bluetooth specification.
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.
uint8_t secLevel
Channel minimum security level requirements.
Received enhanced connection indication.
void(* l2cCtrlCback_t)(wsfMsgHdr_t *pMsg)
This callback function sends control messages to the client.
Connection specification type.
uint16_t l2cCocRegId_t
Connection oriented channel registration ID.
Enhanced connection oriented channel reconfiguration indication structure.
void L2cCocSetAcceptCback(l2cCocRegId_t regId, l2cCocAcceptCb_t cback)
Set the channel accept callback.
void L2cSlaveInit(void)
Initialize L2C for operation as a Bluetooth LE slave.
Connection oriented channel data indication structure.
bool_t req
TRUE if indicating a request, else a response.
uint16_t mtu
Data packet MTU.
uint16_t peerMtu
Data packet MTU peer can receive.
void L2cCocErrorTest(uint16_t result)
For testing purposes only.
L2C callback event starting value.
Device Manager subsystem API.
uint16_t psm
Protocol service multiplexer.
wsfMsgHdr_t hdr
Header structure.
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.
l2cCocDataCnf_t dataCnf
Transmit data confirm.
wsfMsgHdr_t hdr
Header structure.
Connection oriented channel disconnect indication structure.
Received data indication.
l2cCocDataInd_t dataInd
Received data indication.
uint16_t credits
Data packet receive credits for this channel.
uint16_t mtu
Maximum receive data packet size.
l2cCocEnReconfigInd_t enReconfigInd
Enhanced channel reconfigure indication.
wsfMsgHdr_t hdr
Header structure.
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...
uint16_t result
Connection failure result code.
Enhanced connection oriented channel connect indication structure.
uint16_t mps
Data packet MPS peer can receive.
l2cCocDisconnectInd_t disconnectInd
Channel disconnect indication.
void L2cCocDeregister(l2cCocRegId_t regId)
Deregister and deallocate a connection oriented channel registration instance. This function should o...
l2cCocEnConnectInd_t enConnectInd
Enhanced channel connect indication.
void L2cMasterInit(void)
Initialize L2C for operation as a Bluetooth LE master.
uint16_t cid
Local channel ID.
Common message structure passed to event handler.
#define L2C_COC_CBACK_START
L2C callback event starting value.
wsfMsgHdr_t hdr
Header structure.
uint8_t cidLen
Number of channels in cidList.
l2cCfg_t * pL2cCfg
Configuration pointer.
uint16_t mps
Data packet MPS.
uint16_t mtu
Data packet MTU peer can receive.