ble_l2cap.h
Go to the documentation of this file.
1 /**
2 ****************************************************************************************
3 *
4 * @file ble_l2cap.h
5 *
6 * @brief BLE L2CAP API
7 *
8 ****************************************************************************************
9 * @attention
10 #####Copyright (c) 2019 GOODIX
11 All rights reserved.
12
13 Redistribution and use in source and binary forms, with or without
14 modification, are permitted provided that the following conditions are met:
15 * Redistributions of source code must retain the above copyright
16 notice, this list of conditions and the following disclaimer.
17 * Redistributions in binary form must reproduce the above copyright
18 notice, this list of conditions and the following disclaimer in the
19 documentation and/or other materials provided with the distribution.
20 * Neither the name of GOODIX nor the names of its contributors may be used
21 to endorse or promote products derived from this software without
22 specific prior written permission.
23
24 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 POSSIBILITY OF SUCH DAMAGE.
35 *****************************************************************************************
36 */
37
38 /**
39 * @addtogroup BLE
40 * @{
41 */
42
43 /**
44 @addtogroup BLE_L2CAP Logical Link Control and Adaptation Protocol (L2CAP)
45 @{
46 @brief Definitions and prototypes for the L2CAP interface.
47 */
48
49 #ifndef __BLE_L2CAP_H__
50 #define __BLE_L2CAP_H__
51
52 #include "ble_error.h"
53 #include <stdint.h>
54 #include <stdbool.h>
55
56 /**@addtogroup BLE_L2CAP_ENUMERATIONS Enumerations
57 * @{ */
58
59 /**@brief LE credit based disconnection reasons. */
60 typedef enum
61 {
62 BLE_L2CAP_REMOTE_USER_TERM_CON = 0x00, /**< Remote user terminates the connection. */
63 BLE_L2CAP_LOCAL_USER_TERM_CON = 0x01, /**< Local user terminates the connection. */
64 } ble_l2cap_lecb_disconn_reason_t;
65
66 /** @} */
67
68 /** @addtogroup BLE_L2CAP_STRUCTURES Structures
69 * @{ */
70 /** @brief The parameter of LE credit based connection request packet sending.
71 * @note The le_psm should be registered by the peer device, otherwise the peer device will reject this request with result of LE_PSM not supported.
72 * @note The local_cid should be 0x0040-0x007F. If the local_cid is set to 0, the stack will assign it dynamically.
73 * @note The local_credit is required to be sure that at least one SDU can be received, otherwise the stack will use the default value: (MTU + MPS + 1) /MPS + 1.
74 * @note The MTU range is [23~max_mtu].
75 * @note The MPS range is [23~max_mps].
76 * @note About max_mtu and max_mps config, please see @ref ble_gap_l2cap_params_set.
77 */
78 typedef struct
79 {
80 uint16_t le_psm; /**< The le_psm number. */
81 uint16_t local_cid; /**< The local CID. */
82 uint16_t local_credits; /**< The local credits indicate the number of LE-frames that the peer device can send to the L2CAP layer entity sending the LE Credit Based Connection Request. */
83 uint16_t mtu; /**< The MTU field specifies the maximum SDU size (in octets) that the L2CAP layer entity sending the LE Credit Based Connection Request can receive on this channel. */
84 uint16_t mps; /**< The MPS field specifies the maximum payload size (in octets) that the L2CAP layer entity sending the LE Credit Based Connection Request is capable of receiving on this channel. */
85 } ble_l2cap_lecb_conn_req_t;
86
87 /** @brief LE credit based connection confirm parameter.
88 * @note The accept flag indicates whether the App accepts the LE Credit Based connection request.
89 * @note The peer_cid represents the channel endpoint on the peer device.
90 * @note The local_cid should be 0x0040-0x007F. If the local_cid is set to 0, the stack will assign it dynamically.
91 * @note The local_credits required to be sure that at least one SDU can be received, otherwise the stack will use the default value: (MTU + MPS + 1) /MPS + 1.
92 * @note The MTU range is [23~max_mtu].
93 * @note The MPS range is [23~max_mps].
94 * @note About the max_mtu and max_mps config, please see @ref ble_gap_l2cap_params_set.
95 */
96 typedef struct
97 {
98 bool accept; /**< Whether to accept the connection request. */
99 uint16_t peer_cid; /**< It represents the channel endpoint on the device sending the request and receiving the response. */
100 uint16_t local_cid; /**< Local CID. */
101 uint16_t local_credits; /**< It indicates the number of LE-frames that the peer device can send to the L2CAP layer entity sending the LE Credit Based Connection Respone. */
102 uint16_t mtu; /**< The MTU field specifies the maximum SDU size (in octets) that the L2CAP layer entity sending
103 the LE Credit Based Connection Request can receive on this channel. */
104 uint16_t mps; /**< The MPS field specifies the maximum payload size (in octets) that the L2CAP layer entity sending
105 the LE Credit Based Connection Request is capable of receiving on this channel. */
106 } ble_l2cap_lecb_cfm_conn_t;
107
108 /** @brief LE flow control credit packet parameter. */
109 typedef struct
110 {
111 uint16_t local_cid; /**< The local source channel ID. */
112 uint16_t credits; /**< Number of credits that the receiving device can increment. */
113 } ble_l2cap_lecb_add_credits_t;
114
115 /** @brief Sdu parameter. */
116 typedef struct
117 {
118 uint16_t cid; /**< The local source channel. */
119 uint16_t credits; /**< The credits is 0 if this packet is being sent, otherwise it represents the number of credits consumed by the sdu. */
120 uint16_t length; /**< The lenght of data. */
121 uint8_t *data; /**< The data of this sdu packet. */
122 } ble_l2cap_lecb_sdu_t;
123
124 /** @brief Receive LE credit based connection request packet indication. */
125 typedef struct
126 {
127 uint16_t le_psm; /**< Le_psm number that should be registered by local device. */
128 uint16_t peer_cid; /**< It represents the channel endpoint on the device sending the request and receiving the response. */
129 uint16_t peer_mtu; /**< It indicates the maximum SDU size (in octets) that the L2CAP layer entity sending the LE Credit
130 Based Connection Request can receive on this channel. */
131 uint16_t peer_mps; /**< It indicates the maximum payload size (in octets) that the L2CAP layer entity sending the LE Credit
132 Based Connection Request is capable of receiving on this channe. */
133 } lecb_conn_req_ind_t;
134
135 /** @brief LE credit based connection created indication. */
136 typedef struct
137 {
138 uint16_t le_psm; /**< Le_psm number. */
139 uint16_t local_cid; /**< The local source channel ID. */
140 uint16_t local_credits; /**< It indicates the number of LE-frames that the local device can receive. */
141 uint16_t peer_credits; /**< It indicates the number of LE-frames that the peer device can receive. */
142 uint16_t peer_mtu; /**< It indicates the maximum SDU size (in octets) that the L2CAP layer entity sending the LE Credit
143 Based Connection Request can receive on this channel. */
144 uint16_t peer_mps; /**< It indicates the maximum payload size (in octets) that the L2CAP layer entity sending the LE Credit
145 Based Connection Request is capable of receiving on this channe. */
146 } lecb_conn_ind_t;
147
148 /** @brief LE credit based disconnect indication. */
149 typedef struct
150 {
151 uint16_t local_cid; /**< The local source channel ID. */
152 uint8_t reason; /**< The reason for disconnection, see @ref ble_l2cap_lecb_disconn_reason_t . */
153 } lecb_disconn_ind_t;
154
155 /** @brief LE credit based connection addition indication. */
156 typedef struct
157 {
158 uint16_t local_cid; /**< The local source channel ID. */
159 uint16_t peer_added_credits; /**< Represent number of credits the receiving device can increment. */
160 } lecb_add_credits_ind_t;
161
162 /** @brief LE credit based SDU sending complete event. */
163 typedef struct
164 {
165 uint16_t cid; /**< Channel ID that is the local CID. */
166 uint16_t credits; /**< Number of peer credit used. */
167 } lecb_sdu_send_evt_t;
168
169 /** @} */
170 /** @brief L2cap Connect Request event for @ref BLE_L2CAP_EVT_CONN_REQ. */
171 typedef struct
172 {
173 uint16_t le_psm; /**< Le_psm number that should be registered by local device. */
174 uint16_t peer_cid; /**< It represents the channel endpoint on the device sending the request and receiving the response. */
175 uint16_t peer_mtu; /**< It indicates the maximum SDU size (in octets) that the L2CAP layer entity sending the LE Credit
176 Based Connection Request can receive on this channel. */
177 uint16_t peer_mps; /**< It indicates the maximum payload size (in octets) that the L2CAP layer entity sending the LE Credit
178 Based Connection Request is capable of receiving on this channe. */
179 } ble_l2cap_evt_conn_req_t;
180
181 /** @brief L2cap Connected Indicate event for @ref BLE_L2CAP_EVT_CONN_IND. */
182 typedef struct
183 {
184 uint16_t le_psm; /**< Le_psm number. */
185 uint16_t local_cid; /**< The local source channel ID. */
186 uint16_t local_credits; /**< It indicates the number of LE-frames that the local device can receive. */
187 uint16_t peer_credits; /**< It indicates the number of LE-frames that the peer device can receive. */
188 uint16_t peer_mtu; /**< It indicates the maximum SDU size (in octets) that the L2CAP layer entity sending the LE Credit
189 Based Connection Request can receive on this channel. */
190 uint16_t peer_mps; /**< It indicates the maximum payload size (in octets) that the L2CAP layer entity sending the LE Credit
191 Based Connection Request is capable of receiving on this channe. */
192 } ble_l2cap_evt_conn_ind_t;
193
194 /** @brief L2cap Credits Add Indicate event for @ref BLE_L2CAP_EVT_ADD_CREDITS_IND. */
195 typedef struct
196 {
197 uint16_t local_cid; /**< The local source channel ID. */
198 uint16_t peer_added_credits; /**< Represent number of credits the receiving device can increment. */
199 } ble_l2cap_evt_add_credits_ind_t;
200
201 /** @brief L2cap disconnect event for @ref BLE_L2CAP_EVT_DISCONNECTED. */
202 typedef struct
203 {
204 uint16_t local_cid; /**< The local source channel ID. */
205 ble_l2cap_lecb_disconn_reason_t reason; /**< The reason for disconnection, see @ref ble_l2cap_lecb_disconn_reason_t . */
206 } ble_l2cap_evt_disconnect_t;
207
208 /**@brief L2cap SDU Receive event for @ref BLE_L2CAP_EVT_SDU_RECV. */
209 typedef struct
210 {
211 uint16_t cid; /**< The local source channel. */
212 uint16_t credits; /**< The credits is 0 if this packet is being sent, otherwise it represents the number of credits consumed by the sdu. */
213 uint16_t length; /**< The lenght of data. */
214 uint8_t *data; /**< The data of this sdu packet. */
215 } ble_l2cap_evt_sdu_recv_t;
216
217 /**@brief L2cap SDU Send event for @ref BLE_L2CAP_EVT_SDU_SEND. */
218 typedef struct
219 {
220 uint16_t cid; /**< Channel ID that is the local CID. */
221 uint16_t credits; /**< Number of peer credit used. */
222 } ble_l2cap_evt_sdu_send_t;
223
224 /**@brief L2cap Credits Add Completed event for @ref BLE_L2CAP_EVT_ADD_CREDITS_CPLT. */
225 typedef struct
226 {
227 uint16_t local_cid; /**< Channel ID that is the local CID. */
228 } ble_l2cap_evt_add_credits_cplt_t;
229
230 /**@brief BLE L2CAP event structure. */
231 typedef struct
232 {
233 uint8_t index; /**< Index of connection. */
234 union
235 {
236 ble_l2cap_evt_conn_req_t conn_req; /**< Link Encrypte Request event. */
237 ble_l2cap_evt_conn_ind_t conn_ind; /**< Link Encrypted event. */
238 ble_l2cap_evt_add_credits_ind_t add_credits_ind; /**< Key Press Notify event. */
239 ble_l2cap_evt_disconnect_t disconnected; /**< Key Missing event. */
240 ble_l2cap_evt_sdu_recv_t sdu_recv; /**< Link Encrypte Request event. */
241 ble_l2cap_evt_sdu_send_t sdu_send; /**< Link Encrypted event. */
242 ble_l2cap_evt_add_credits_cplt_t add_credits_cplt; /**< Key Press Notify event. */
243 } params;
244 } ble_l2cap_evt_t;
245
246 /** @addtogroup BLE_L2CAP_FUNCTIONS Functions
247 * @{ */
248 /**
249 ****************************************************************************************
250 * @brief Create the LE credit based connection.
251 *
252 * @param[in] conn_idx: ACL connection index.
253 * @param[in] p_conn_req: Pointer to the LE Credit Based Connection Request structure.
254 *
255 * @retval ::SDK_SUCCESS: The LE Credit Based connection request is successfully set to the BLE stack.
256 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
257 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
258 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
259 ****************************************************************************************
260 */
261 uint16_t ble_l2cap_lecb_conn_create(uint8_t conn_idx, const ble_l2cap_lecb_conn_req_t *p_conn_req);
262
263 /**
264 ****************************************************************************************
265 * @brief Confirm the LE credit based connection after receiving the connection request packet from the peer device.
266 * @param[in] conn_idx: ACL connection index.
267 * @param[in] p_cfm_conn: Pointer to the LE Credit Based Connection Confirm structure.
268 *
269 * @retval ::SDK_SUCCESS: The LE Credit Based connection confirmation is successfully set to the BLE stack.
270 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
271 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
272 * @retval ::SDK_ERR_INVALID_PARAM: Invalid parameter supplied.
273 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
274 ****************************************************************************************
275 */
276 uint16_t ble_l2cap_lecb_conn_cfm(uint8_t conn_idx, const ble_l2cap_lecb_cfm_conn_t *p_cfm_conn);
277
278 /**
279 ****************************************************************************************
280 * @brief Disconnect the LE credit based connection.
281 *
282 * @param[in] conn_idx: ACL connection index.
283 * @param[in] local_cid: The local source channel ID.
284 *
285 * @retval ::SDK_SUCCESS: LE Credit Based disconnection request is successfully set to the BLE stack.
286 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
287 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
288 ****************************************************************************************
289 */
290 uint16_t ble_l2cap_lecb_disconnect(uint8_t conn_idx, uint16_t local_cid);
291
292 /**
293 ****************************************************************************************
294 * @brief Send a LE Flow Control Credit packet when the device is capable of receiving additional LE-frames.
295 *
296 * @param[in] conn_idx: ACL connection index.
297 * @param[in] p_add_credits: Pointer to the LE Flow Control Credit structure.
298 *
299 * @retval ::SDK_SUCCESS: LE Flow Control Credit packet is successfully set to the BLE stack.
300 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
301 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
302 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
303 ****************************************************************************************
304 */
305 uint16_t ble_l2cap_lecb_credits_add(uint8_t conn_idx, const ble_l2cap_lecb_add_credits_t *p_add_credits);
306
307 /**
308 ****************************************************************************************
309 * @brief Send an SDU packet to the peer device.
310 *
311 * @param[in] conn_idx: ACL connection index.
312 * @param[in] p_sdu: Pointer to the sdu packet structure.
313 *
314 * @retval ::SDK_SUCCESS: The sdu packet is successfully set to the BLE stack.
315 * @retval ::SDK_ERR_POINTER_NULL: Invalid pointer supplied.
316 * @retval ::SDK_ERR_INVALID_CONN_IDX: Invalid connection index supplied.
317 * @retval ::SDK_ERR_NO_RESOURCES: Not enough resources.
318 ****************************************************************************************
319 */
320 uint16_t ble_l2cap_lecb_sdu_send(uint8_t conn_idx, const ble_l2cap_lecb_sdu_t *p_sdu);
321
322 /**
323 ****************************************************************************************
324 * @brief Get reamin credits.
325 *
326 * @param[in] conn_idx: ACL connection index.
327 * @param[in] local_cid: The local source channel ID.
328 *
329 * @return The number of remain credits.
330 ****************************************************************************************
331 */
332 uint16_t ble_l2cap_get_remain_credits(uint8_t conn_idx, uint16_t local_cid);
333 /** @} */
334
335 #endif
336
337 /**
338 @}
339 */
340 /** @} */
ble_l2cap_evt_conn_req_t::peer_cid
uint16_t peer_cid
Definition: ble_l2cap.h:174
ble_l2cap_evt_conn_req_t::peer_mtu
uint16_t peer_mtu
Definition: ble_l2cap.h:175
ble_l2cap_evt_add_credits_ind_t::peer_added_credits
uint16_t peer_added_credits
Definition: ble_l2cap.h:198
ble_l2cap_evt_t::index
uint8_t index
Definition: ble_l2cap.h:233
ble_l2cap_lecb_cfm_conn_t::mtu
uint16_t mtu
Definition: ble_l2cap.h:102
ble_l2cap_lecb_conn_req_t
The parameter of LE credit based connection request packet sending.
Definition: ble_l2cap.h:79
ble_l2cap_get_remain_credits
uint16_t ble_l2cap_get_remain_credits(uint8_t conn_idx, uint16_t local_cid)
Get reamin credits.
lecb_conn_req_ind_t::peer_cid
uint16_t peer_cid
Definition: ble_l2cap.h:128
ble_l2cap_evt_conn_req_t
L2cap Connect Request event for BLE_L2CAP_EVT_CONN_REQ.
Definition: ble_l2cap.h:172
lecb_add_credits_ind_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:158
ble_l2cap_evt_conn_ind_t::peer_mtu
uint16_t peer_mtu
Definition: ble_l2cap.h:188
ble_l2cap_lecb_conn_req_t::le_psm
uint16_t le_psm
Definition: ble_l2cap.h:80
ble_l2cap_lecb_add_credits_t
LE flow control credit packet parameter.
Definition: ble_l2cap.h:110
ble_l2cap_evt_add_credits_cplt_t
L2cap Credits Add Completed event for BLE_L2CAP_EVT_ADD_CREDITS_CPLT.
Definition: ble_l2cap.h:226
ble_l2cap_lecb_cfm_conn_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:100
lecb_add_credits_ind_t
LE credit based connection addition indication.
Definition: ble_l2cap.h:157
ble_l2cap_evt_conn_ind_t::local_credits
uint16_t local_credits
Definition: ble_l2cap.h:186
BLE_L2CAP_REMOTE_USER_TERM_CON
@ BLE_L2CAP_REMOTE_USER_TERM_CON
Definition: ble_l2cap.h:62
ble_l2cap_lecb_sdu_t::cid
uint16_t cid
Definition: ble_l2cap.h:118
ble_l2cap_evt_sdu_recv_t::length
uint16_t length
Definition: ble_l2cap.h:213
ble_l2cap_evt_conn_req_t::le_psm
uint16_t le_psm
Definition: ble_l2cap.h:173
ble_l2cap_evt_conn_ind_t::peer_credits
uint16_t peer_credits
Definition: ble_l2cap.h:187
ble_l2cap_evt_t::disconnected
ble_l2cap_evt_disconnect_t disconnected
Definition: ble_l2cap.h:239
ble_l2cap_evt_t
BLE L2CAP event structure.
Definition: ble_l2cap.h:232
ble_l2cap_evt_add_credits_ind_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:197
ble_l2cap_lecb_sdu_t::length
uint16_t length
Definition: ble_l2cap.h:120
ble_l2cap_lecb_sdu_send
uint16_t ble_l2cap_lecb_sdu_send(uint8_t conn_idx, const ble_l2cap_lecb_sdu_t *p_sdu)
Send an SDU packet to the peer device.
ble_l2cap_lecb_disconnect
uint16_t ble_l2cap_lecb_disconnect(uint8_t conn_idx, uint16_t local_cid)
Disconnect the LE credit based connection.
ble_l2cap_evt_sdu_recv_t::credits
uint16_t credits
Definition: ble_l2cap.h:212
lecb_conn_ind_t::peer_mtu
uint16_t peer_mtu
Definition: ble_l2cap.h:142
ble_l2cap_evt_conn_ind_t::le_psm
uint16_t le_psm
Definition: ble_l2cap.h:184
ble_l2cap_lecb_conn_req_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:81
lecb_conn_ind_t::peer_credits
uint16_t peer_credits
Definition: ble_l2cap.h:141
lecb_conn_req_ind_t::peer_mps
uint16_t peer_mps
Definition: ble_l2cap.h:131
ble_l2cap_lecb_add_credits_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:111
ble_l2cap_evt_t::sdu_send
ble_l2cap_evt_sdu_send_t sdu_send
Definition: ble_l2cap.h:241
BLE_L2CAP_LOCAL_USER_TERM_CON
@ BLE_L2CAP_LOCAL_USER_TERM_CON
Definition: ble_l2cap.h:63
ble_l2cap_lecb_conn_create
uint16_t ble_l2cap_lecb_conn_create(uint8_t conn_idx, const ble_l2cap_lecb_conn_req_t *p_conn_req)
Create the LE credit based connection.
ble_l2cap_evt_conn_ind_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:185
ble_l2cap_evt_t::add_credits_cplt
ble_l2cap_evt_add_credits_cplt_t add_credits_cplt
Definition: ble_l2cap.h:242
lecb_conn_req_ind_t::le_psm
uint16_t le_psm
Definition: ble_l2cap.h:127
ble_l2cap_evt_t::sdu_recv
ble_l2cap_evt_sdu_recv_t sdu_recv
Definition: ble_l2cap.h:240
lecb_disconn_ind_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:151
ble_error.h
File that contains error codes.
ble_l2cap_evt_sdu_send_t
L2cap SDU Send event for BLE_L2CAP_EVT_SDU_SEND.
Definition: ble_l2cap.h:219
ble_l2cap_lecb_add_credits_t::credits
uint16_t credits
Definition: ble_l2cap.h:112
ble_l2cap_evt_sdu_recv_t::cid
uint16_t cid
Definition: ble_l2cap.h:211
ble_l2cap_lecb_disconn_reason_t
ble_l2cap_lecb_disconn_reason_t
LE credit based disconnection reasons.
Definition: ble_l2cap.h:61
ble_l2cap_lecb_cfm_conn_t::accept
bool accept
Definition: ble_l2cap.h:98
lecb_disconn_ind_t::reason
uint8_t reason
Definition: ble_l2cap.h:152
lecb_disconn_ind_t
LE credit based disconnect indication.
Definition: ble_l2cap.h:150
ble_l2cap_evt_add_credits_ind_t
L2cap Credits Add Indicate event for BLE_L2CAP_EVT_ADD_CREDITS_IND.
Definition: ble_l2cap.h:196
ble_l2cap_lecb_conn_cfm
uint16_t ble_l2cap_lecb_conn_cfm(uint8_t conn_idx, const ble_l2cap_lecb_cfm_conn_t *p_cfm_conn)
Confirm the LE credit based connection after receiving the connection request packet from the peer de...
lecb_conn_ind_t
LE credit based connection created indication.
Definition: ble_l2cap.h:137
ble_l2cap_evt_t::add_credits_ind
ble_l2cap_evt_add_credits_ind_t add_credits_ind
Definition: ble_l2cap.h:238
ble_l2cap_evt_add_credits_cplt_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:227
ble_l2cap_lecb_cfm_conn_t::peer_cid
uint16_t peer_cid
Definition: ble_l2cap.h:99
lecb_add_credits_ind_t::peer_added_credits
uint16_t peer_added_credits
Definition: ble_l2cap.h:159
lecb_conn_ind_t::peer_mps
uint16_t peer_mps
Definition: ble_l2cap.h:144
ble_l2cap_evt_sdu_recv_t::data
uint8_t * data
Definition: ble_l2cap.h:214
ble_l2cap_evt_conn_ind_t
L2cap Connected Indicate event for BLE_L2CAP_EVT_CONN_IND.
Definition: ble_l2cap.h:183
ble_l2cap_lecb_sdu_t
Sdu parameter.
Definition: ble_l2cap.h:117
lecb_conn_ind_t::le_psm
uint16_t le_psm
Definition: ble_l2cap.h:138
ble_l2cap_evt_t::conn_req
ble_l2cap_evt_conn_req_t conn_req
Definition: ble_l2cap.h:236
ble_l2cap_evt_t::conn_ind
ble_l2cap_evt_conn_ind_t conn_ind
Definition: ble_l2cap.h:237
lecb_sdu_send_evt_t::cid
uint16_t cid
Definition: ble_l2cap.h:165
ble_l2cap_lecb_credits_add
uint16_t ble_l2cap_lecb_credits_add(uint8_t conn_idx, const ble_l2cap_lecb_add_credits_t *p_add_credits)
Send a LE Flow Control Credit packet when the device is capable of receiving additional LE-frames.
lecb_conn_req_ind_t
Receive LE credit based connection request packet indication.
Definition: ble_l2cap.h:126
ble_l2cap_lecb_cfm_conn_t::local_credits
uint16_t local_credits
Definition: ble_l2cap.h:101
ble_l2cap_lecb_sdu_t::credits
uint16_t credits
Definition: ble_l2cap.h:119
ble_l2cap_lecb_conn_req_t::local_credits
uint16_t local_credits
Definition: ble_l2cap.h:82
ble_l2cap_lecb_cfm_conn_t::mps
uint16_t mps
Definition: ble_l2cap.h:104
lecb_conn_ind_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:139
ble_l2cap_evt_sdu_recv_t
L2cap SDU Receive event for BLE_L2CAP_EVT_SDU_RECV.
Definition: ble_l2cap.h:210
ble_l2cap_lecb_cfm_conn_t
LE credit based connection confirm parameter.
Definition: ble_l2cap.h:97
ble_l2cap_lecb_conn_req_t::mtu
uint16_t mtu
Definition: ble_l2cap.h:83
ble_l2cap_evt_disconnect_t
L2cap disconnect event for BLE_L2CAP_EVT_DISCONNECTED.
Definition: ble_l2cap.h:203
lecb_conn_ind_t::local_credits
uint16_t local_credits
Definition: ble_l2cap.h:140
ble_l2cap_lecb_conn_req_t::mps
uint16_t mps
Definition: ble_l2cap.h:84
ble_l2cap_evt_conn_ind_t::peer_mps
uint16_t peer_mps
Definition: ble_l2cap.h:190
lecb_sdu_send_evt_t
LE credit based SDU sending complete event.
Definition: ble_l2cap.h:164
ble_l2cap_evt_disconnect_t::reason
ble_l2cap_lecb_disconn_reason_t reason
Definition: ble_l2cap.h:205
ble_l2cap_evt_disconnect_t::local_cid
uint16_t local_cid
Definition: ble_l2cap.h:204
ble_l2cap_evt_sdu_send_t::cid
uint16_t cid
Definition: ble_l2cap.h:220
lecb_sdu_send_evt_t::credits
uint16_t credits
Definition: ble_l2cap.h:166
ble_l2cap_evt_sdu_send_t::credits
uint16_t credits
Definition: ble_l2cap.h:221
ble_l2cap_lecb_sdu_t::data
uint8_t * data
Definition: ble_l2cap.h:121
lecb_conn_req_ind_t::peer_mtu
uint16_t peer_mtu
Definition: ble_l2cap.h:129
ble_l2cap_evt_conn_req_t::peer_mps
uint16_t peer_mps
Definition: ble_l2cap.h:177