|
Zephyr API Documentation 4.3.99
A Scalable Open Source RTOS
|
Bluetooth Logical Link Control and Adaptation Protocol (L2CAP) for BR/EDR. More...
Data Structures | |
| struct | bt_l2cap_br_echo_cb |
| ECHO request/response callback structure. More... | |
| struct | bt_l2cap_br_connless_cb |
| Connectionless data channel callback structure. More... | |
Macros | |
| #define | BT_L2CAP_BR_ECHO_REQ_RESERVE BT_L2CAP_BUF_SIZE(4) |
| Headroom needed for outgoing L2CAP ECHO REQ PDUs. | |
| #define | BT_L2CAP_BR_ECHO_RSP_RESERVE BT_L2CAP_BUF_SIZE(4) |
| Headroom needed for outgoing L2CAP ECHO RSP PDUs. | |
| #define | BT_L2CAP_CONNLESS_SDU_HDR_SIZE 2 |
| L2CAP connectionless SDU header size. | |
| #define | BT_L2CAP_CONNLESS_RESERVE BT_L2CAP_BUF_SIZE(BT_L2CAP_CONNLESS_SDU_HDR_SIZE) |
| Headroom needed for outgoing L2CAP PDU format within a connectionless data channel. | |
Functions | |
| int | bt_l2cap_br_echo_cb_register (struct bt_l2cap_br_echo_cb *cb) |
| Register ECHO callbacks. | |
| int | bt_l2cap_br_echo_cb_unregister (struct bt_l2cap_br_echo_cb *cb) |
| Unregister ECHO callbacks. | |
| int | bt_l2cap_br_echo_req (struct bt_conn *conn, struct net_buf *buf) |
| Send ECHO data through ECHO request. | |
| int | bt_l2cap_br_echo_rsp (struct bt_conn *conn, uint8_t identifier, struct net_buf *buf) |
| Send ECHO data through ECHO response. | |
| int | bt_l2cap_br_connless_register (struct bt_l2cap_br_connless_cb *cb) |
| Register connectionless data channel callbacks. | |
| int | bt_l2cap_br_connless_unregister (struct bt_l2cap_br_connless_cb *cb) |
| Unregister connectionless data channel callbacks. | |
| int | bt_l2cap_br_connless_send (struct bt_conn *conn, uint16_t psm, struct net_buf *buf) |
| Send data over connectionless data channel. | |
Bluetooth Logical Link Control and Adaptation Protocol (L2CAP) for BR/EDR.
| #define BT_L2CAP_BR_ECHO_REQ_RESERVE BT_L2CAP_BUF_SIZE(4) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Headroom needed for outgoing L2CAP ECHO REQ PDUs.
| #define BT_L2CAP_BR_ECHO_RSP_RESERVE BT_L2CAP_BUF_SIZE(4) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Headroom needed for outgoing L2CAP ECHO RSP PDUs.
| #define BT_L2CAP_CONNLESS_RESERVE BT_L2CAP_BUF_SIZE(BT_L2CAP_CONNLESS_SDU_HDR_SIZE) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Headroom needed for outgoing L2CAP PDU format within a connectionless data channel.
| #define BT_L2CAP_CONNLESS_SDU_HDR_SIZE 2 |
#include <zephyr/bluetooth/classic/l2cap_br.h>
L2CAP connectionless SDU header size.
| int bt_l2cap_br_connless_register | ( | struct bt_l2cap_br_connless_cb * | cb | ) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Register connectionless data channel callbacks.
Register callbacks to monitor and receive connectionless data channel frames. This allows the application to receive data sent to a specific PSM without establishing a connection.
| cb | Callback struct. Must point to memory that remains valid. The PSM field must be set to the desired Protocol/Service Multiplexer value, or 0 to receive all connectionless data frames. |
| 0 | Success. |
| -EINVAL | If cb is NULL, has invalid PSM value, has invalid recv callback, or has invalid security level. |
| -EEXIST | If a callback with the same PSM was already registered. |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Send data over connectionless data channel.
Send data over a connectionless data channel. This function allows sending data to a specific PSM without establishing the L2CAP channel connection.
The application is required to have reserved BT_L2CAP_CONNLESS_RESERVE bytes in the buffer before sending.
| conn | Connection object. |
| psm | Protocol/Service Multiplexer identifying the destination service. |
| buf | Buffer containing the data to be sent. The application is required to have reserved enough headroom in the buffer for the L2CAP header. |
| 0 | Success. |
| -EINVAL | If conn or buf is NULL, psm is invalid, the reference counter of buf != 1, the head room of buf is less than BT_L2CAP_CONNLESS_RESERVE, or the buf->user_data_size is less than the size of struct closure. |
| -ESHUTDOWN | If the L2CAP channel with connectionless channel is NULL in low level. |
| int bt_l2cap_br_connless_unregister | ( | struct bt_l2cap_br_connless_cb * | cb | ) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Unregister connectionless data channel callbacks.
Unregister callbacks that are used to monitor and receive connectionless data channel frames.
| cb | Registered cb. |
| 0 | Success. |
| -EINVAL | If cb is NULL. |
| -ENOENT | if cb was not registered. |
| int bt_l2cap_br_echo_cb_register | ( | struct bt_l2cap_br_echo_cb * | cb | ) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Register ECHO callbacks.
Register callbacks to monitor the packets of L2CAP BR echo request/response.
| cb | Callback struct. Must point to memory that remains valid. |
| 0 | Success. |
| -EEXIST | if cb was already registered. |
| int bt_l2cap_br_echo_cb_unregister | ( | struct bt_l2cap_br_echo_cb * | cb | ) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Unregister ECHO callbacks.
Unregister callbacks that are used to monitor the packets of L2CAP BR echo request/response.
| cb | Callback struct point to memory that remains valid. |
| 0 | Success. |
| -EINVAL | If cb is NULL. |
| -ENOENT | if cb was not registered. |
| int bt_l2cap_br_echo_req | ( | struct bt_conn * | conn, |
| struct net_buf * | buf ) |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Send ECHO data through ECHO request.
Send ECHO data through ECHO request. The application is required to have reserved BT_L2CAP_BR_ECHO_REQ_RESERVE bytes in the buffer before sending.
| conn | The ACL connection object. |
| buf | Sending ECHO data. |
#include <zephyr/bluetooth/classic/l2cap_br.h>
Send ECHO data through ECHO response.
Send ECHO data through ECHO response. The application is required to have reserved BT_L2CAP_BR_ECHO_RSP_RESERVE bytes in the buffer before sending.
| conn | The ACL connection object. |
| identifier | The identifier of the ECHO request. |
| buf | Sending ECHO data. |