|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Bluetooth L2CAP handling. More...
#include <stddef.h>#include <stdint.h>#include <zephyr/bluetooth/buf.h>#include <zephyr/bluetooth/conn.h>#include <zephyr/bluetooth/hci.h>#include <zephyr/kernel.h>#include <zephyr/net_buf.h>#include <zephyr/sys/atomic.h>#include <zephyr/sys/slist.h>#include <zephyr/sys/util.h>#include <sys/types.h>Go to the source code of this file.
Data Structures | |
| struct | bt_l2cap_chan |
| L2CAP Channel structure. More... | |
| struct | bt_l2cap_le_endpoint |
| LE L2CAP Endpoint structure. More... | |
| struct | bt_l2cap_le_chan |
| LE L2CAP Channel structure. More... | |
| struct | bt_l2cap_fixed_chan |
| Fixed L2CAP Channel structure. More... | |
| struct | bt_l2cap_br_endpoint |
| BREDR L2CAP Endpoint structure. More... | |
| struct | bt_l2cap_br_window |
| I-Frame transmission window for none BASIC mode L2cap connected channel. More... | |
| struct | bt_l2cap_br_chan |
| BREDR L2CAP Channel structure. More... | |
| struct | bt_l2cap_chan_ops |
| L2CAP Channel operations structure. More... | |
| struct | bt_l2cap_server |
| L2CAP Server structure. More... | |
Macros | |
| #define | BT_L2CAP_HDR_SIZE 4 |
| L2CAP PDU header size, used for buffer size calculations. | |
| #define | BT_L2CAP_TX_MTU (CONFIG_BT_L2CAP_TX_MTU) |
| Maximum Transmission Unit (MTU) for an outgoing L2CAP PDU. | |
| #define | BT_L2CAP_RX_MTU (CONFIG_BT_BUF_ACL_RX_SIZE - BT_L2CAP_HDR_SIZE) |
| Maximum Transmission Unit (MTU) for an incoming L2CAP PDU. | |
| #define | BT_L2CAP_BUF_SIZE(mtu) |
| Helper to calculate needed buffer size for L2CAP PDUs. | |
| #define | BT_L2CAP_SDU_HDR_SIZE 2 |
| L2CAP SDU header size, used for buffer size calculations. | |
| #define | BT_L2CAP_SDU_TX_MTU (BT_L2CAP_TX_MTU - BT_L2CAP_SDU_HDR_SIZE) |
| Maximum Transmission Unit for an unsegmented outgoing L2CAP SDU. | |
| #define | BT_L2CAP_SDU_RX_MTU (BT_L2CAP_RX_MTU - BT_L2CAP_SDU_HDR_SIZE) |
| Maximum Transmission Unit for an unsegmented incoming L2CAP SDU. | |
| #define | BT_L2CAP_SDU_BUF_SIZE(mtu) |
| Helper to calculate needed buffer size for L2CAP SDUs. | |
| #define | BT_L2CAP_ECRED_MIN_MTU 64 |
| L2CAP ECRED minimum MTU. | |
| #define | BT_L2CAP_ECRED_MIN_MPS 64 |
| L2CAP ECRED minimum MPS. | |
| #define | BT_L2CAP_MAX_MTU UINT16_MAX |
| L2CAP maximum MTU. | |
| #define | BT_L2CAP_MAX_MPS 65533 |
| L2CAP maximum MPS. | |
| #define | BT_L2CAP_ECRED_CHAN_MAX_PER_REQ 5 |
| The maximum number of channels in ECRED L2CAP signaling PDUs. | |
| #define | BT_L2CAP_CID_BR_SIG 0x0001 |
| BR signaling channel. | |
| #define | BT_L2CAP_CID_ATT 0x0004 |
| Attribute Protocol channel. | |
| #define | BT_L2CAP_CID_LE_SIG 0x0005 |
| LE signaling channel. | |
| #define | BT_L2CAP_CID_SMP 0x0006 |
| Security Manager Protocol channel. | |
| #define | BT_L2CAP_CID_BR_SMP 0x0007 |
| BR Security Manager Protocol channel. | |
| #define | BT_L2CAP_LE_CHAN(_ch) |
| Helper macro getting container object of type bt_l2cap_le_chan address having the same container chan member address as object in question. | |
| #define | BT_L2CAP_FIXED_CHANNEL_DEFINE(_name) |
| Register a fixed L2CAP channel. | |
| #define | BT_L2CAP_BR_LINK_MODE_BASIC 0x00 |
| L2CAP Endpoint Link Mode. | |
| #define | BT_L2CAP_BR_LINK_MODE_RET 0x01 |
| L2CAP Endpoint Link Mode. | |
| #define | BT_L2CAP_BR_LINK_MODE_FC 0x02 |
| L2CAP Endpoint Link Mode. | |
| #define | BT_L2CAP_BR_LINK_MODE_ERET 0x03 |
| L2CAP Endpoint Link Mode. | |
| #define | BT_L2CAP_BR_LINK_MODE_STREAM 0x04 |
| L2CAP Endpoint Link Mode. | |
| #define | BT_L2CAP_BR_FCS_NO 0x00 |
| Frame Check Sequence type. | |
| #define | BT_L2CAP_BR_FCS_16BIT 0x01 |
| Frame Check Sequence type. | |
| #define | BT_L2CAP_CHAN_SEND_RESERVE (BT_L2CAP_BUF_SIZE(0)) |
| Headroom needed for outgoing L2CAP PDUs. | |
| #define | BT_L2CAP_SDU_CHAN_SEND_RESERVE (BT_L2CAP_SDU_BUF_SIZE(0)) |
| Headroom needed for outgoing L2CAP SDUs. | |
Typedefs | |
| typedef void(* | bt_l2cap_chan_destroy_t) (struct bt_l2cap_chan *chan) |
| Channel destroy callback. | |
| typedef enum bt_l2cap_chan_state | bt_l2cap_chan_state_t |
| Life-span states of L2CAP CoC channel. | |
| typedef enum bt_l2cap_chan_status | bt_l2cap_chan_status_t |
| Status of L2CAP channel. | |
Enumerations | |
| enum | bt_l2cap_chan_state { BT_L2CAP_DISCONNECTED , BT_L2CAP_CONNECTING , BT_L2CAP_CONFIG , BT_L2CAP_CONNECTED , BT_L2CAP_DISCONNECTING } |
| Life-span states of L2CAP CoC channel. More... | |
| enum | bt_l2cap_chan_status { BT_L2CAP_STATUS_OUT , BT_L2CAP_STATUS_SHUTDOWN , BT_L2CAP_STATUS_ENCRYPT_PENDING , BT_L2CAP_NUM_STATUS } |
| Status of L2CAP channel. More... | |
Functions | |
| int | bt_l2cap_server_register (struct bt_l2cap_server *server) |
| Register L2CAP server. | |
| int | bt_l2cap_br_server_register (struct bt_l2cap_server *server) |
| Register L2CAP server on BR/EDR oriented connection. | |
| int | bt_l2cap_br_server_unregister (struct bt_l2cap_server *server) |
| Unregister L2CAP server on BR/EDR oriented connection. | |
| int | bt_l2cap_ecred_chan_connect (struct bt_conn *conn, struct bt_l2cap_chan **chans, uint16_t psm) |
| Connect Enhanced Credit Based L2CAP channels. | |
| int | bt_l2cap_ecred_chan_reconfigure (struct bt_l2cap_chan **chans, uint16_t mtu) |
| Reconfigure Enhanced Credit Based L2CAP channels. | |
| int | bt_l2cap_ecred_chan_reconfigure_explicit (struct bt_l2cap_chan **chans, size_t chan_count, uint16_t mtu, uint16_t mps) |
| Reconfigure Enhanced Credit Based L2CAP channels. | |
| int | bt_l2cap_chan_connect (struct bt_conn *conn, struct bt_l2cap_chan *chan, uint16_t psm) |
| Connect L2CAP channel. | |
| int | bt_l2cap_chan_disconnect (struct bt_l2cap_chan *chan) |
| Disconnect L2CAP channel. | |
| int | bt_l2cap_chan_send (struct bt_l2cap_chan *chan, struct net_buf *buf) |
| Send data to L2CAP channel. | |
| int | bt_l2cap_chan_give_credits (struct bt_l2cap_chan *chan, uint16_t additional_credits) |
| Give credits to the remote. | |
| int | bt_l2cap_chan_recv_complete (struct bt_l2cap_chan *chan, struct net_buf *buf) |
| Complete receiving L2CAP channel data. | |
Bluetooth L2CAP handling.