|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
RFCOMM. More...
Data Structures | |
| struct | bt_rfcomm_dlc_ops |
| RFCOMM DLC operations structure. More... | |
| struct | bt_rfcomm_dlc |
| RFCOMM DLC structure. More... | |
| struct | bt_rfcomm_server |
| struct | bt_rfcomm_rpn |
| RFCOMM Remote Port Negotiation (RPN) structure. More... | |
Macros | |
| #define | BT_RFCOMM_HDR_MAX_SIZE 4 |
| RFCOMM Maximum Header Size. | |
| #define | BT_RFCOMM_FCS_SIZE 1 |
| RFCOMM FCS Size. | |
| #define | BT_RFCOMM_CREDITS_SIZE 1 |
| RFCOMM Credits Size. | |
| #define | BT_RFCOMM_OVERHEAD_SIZE (BT_RFCOMM_HDR_MAX_SIZE + BT_RFCOMM_FCS_SIZE + BT_RFCOMM_CREDITS_SIZE) |
| RFCOMM Overhead Size. | |
| #define | BT_RFCOMM_BUF_SIZE(mtu) |
| Helper to calculate needed buffer size for RFCOMM PDUs. | |
| #define | BT_RFCOMM_SET_LINE_SETTINGS(data, stop, parity) |
| Combine data bits, stop bits and parity into a single line settings byte. | |
| #define | BT_RFCOMM_RPN_FLOW_NONE 0x00 |
| #define | BT_RFCOMM_RPN_XON_CHAR 0x11 |
| #define | BT_RFCOMM_RPN_XOFF_CHAR 0x13 |
| #define | BT_RFCOMM_RPN_PARAM_MASK_ALL 0x3f7f |
Typedefs | |
| typedef enum bt_rfcomm_role | bt_rfcomm_role_t |
| Role of RFCOMM session and dlc. | |
Functions | |
| int | bt_rfcomm_server_register (struct bt_rfcomm_server *server) |
| Register RFCOMM server. | |
| int | bt_rfcomm_server_unregister (struct bt_rfcomm_server *server) |
| Unregister RFCOMM server. | |
| int | bt_rfcomm_dlc_connect (struct bt_conn *conn, struct bt_rfcomm_dlc *dlc, uint8_t channel) |
| Connect RFCOMM channel. | |
| int | bt_rfcomm_dlc_send (struct bt_rfcomm_dlc *dlc, struct net_buf *buf) |
| Send data to RFCOMM. | |
| int | bt_rfcomm_dlc_disconnect (struct bt_rfcomm_dlc *dlc) |
| Disconnect RFCOMM dlc. | |
| struct net_buf * | bt_rfcomm_create_pdu (struct net_buf_pool *pool) |
| Allocate the buffer from pool after reserving head room for RFCOMM, L2CAP and ACL headers. | |
| int | bt_rfcomm_send_rpn_cmd (struct bt_rfcomm_dlc *dlc, struct bt_rfcomm_rpn *rpn) |
| Send Remote Port Negotiation command. | |
RFCOMM.
| #define BT_RFCOMM_BUF_SIZE | ( | mtu | ) |
#include <rfcomm.h>
Helper to calculate needed buffer size for RFCOMM PDUs.
Useful for creating buffer pools.
| mtu | Needed RFCOMM PDU MTU. |
| #define BT_RFCOMM_CREDITS_SIZE 1 |
#include <rfcomm.h>
RFCOMM Credits Size.
| #define BT_RFCOMM_FCS_SIZE 1 |
#include <rfcomm.h>
RFCOMM FCS Size.
| #define BT_RFCOMM_HDR_MAX_SIZE 4 |
#include <rfcomm.h>
RFCOMM Maximum Header Size.
The length could be 2 bytes, it depends on information length.
| #define BT_RFCOMM_OVERHEAD_SIZE (BT_RFCOMM_HDR_MAX_SIZE + BT_RFCOMM_FCS_SIZE + BT_RFCOMM_CREDITS_SIZE) |
#include <rfcomm.h>
RFCOMM Overhead Size.
The overhead size of RFCOMM includes the maximum header size, FCS size, and credits size.
For the field credits size, in the CFC supported case, the space of credits should be discounted from the maximum frame size. It is used to avoid the SDU length exceeding the maximum frame size if the credits field is included.
| #define BT_RFCOMM_RPN_FLOW_NONE 0x00 |
#include <rfcomm.h>
| #define BT_RFCOMM_RPN_PARAM_MASK_ALL 0x3f7f |
#include <rfcomm.h>
| #define BT_RFCOMM_RPN_XOFF_CHAR 0x13 |
#include <rfcomm.h>
| #define BT_RFCOMM_RPN_XON_CHAR 0x11 |
#include <rfcomm.h>
| #define BT_RFCOMM_SET_LINE_SETTINGS | ( | data, | |
| stop, | |||
| parity ) |
#include <rfcomm.h>
Combine data bits, stop bits and parity into a single line settings byte.
| data | Data bits value (0-3) |
| stop | Stop bits value (0-1) |
| parity | Parity value (0-7) |
| typedef enum bt_rfcomm_role bt_rfcomm_role_t |
| anonymous enum |
#include <rfcomm.h>
RFCOMM RPN parity bit values.
| Enumerator | |
|---|---|
| BT_RFCOMM_RPN_PARITY_NONE | |
| BT_RFCOMM_RPN_PARITY_ODD | |
| BT_RFCOMM_RPN_PARITY_EVEN | |
| BT_RFCOMM_RPN_PARITY_MARK | |
| BT_RFCOMM_RPN_PARITY_SPACE | |
| anonymous enum |
#include <rfcomm.h>
| Enumerator | |
|---|---|
| BT_RFCOMM_CHAN_HFP_HF | |
| BT_RFCOMM_CHAN_HFP_AG | |
| BT_RFCOMM_CHAN_HSP_AG | |
| BT_RFCOMM_CHAN_HSP_HS | |
| BT_RFCOMM_CHAN_SPP | |
| BT_RFCOMM_CHAN_DYNAMIC_START | |
| anonymous enum |
#include <rfcomm.h>
RFCOMM RPN data bit values.
| Enumerator | |
|---|---|
| BT_RFCOMM_RPN_DATA_BITS_5 | |
| BT_RFCOMM_RPN_DATA_BITS_6 | |
| BT_RFCOMM_RPN_DATA_BITS_7 | |
| BT_RFCOMM_RPN_DATA_BITS_8 | |
| anonymous enum |
#include <rfcomm.h>
RFCOMM RPN stop bit values.
| Enumerator | |
|---|---|
| BT_RFCOMM_RPN_STOP_BITS_1 | |
| BT_RFCOMM_RPN_STOP_BITS_1_5 | |
| anonymous enum |
#include <rfcomm.h>
RFCOMM RPN baud rate values.
| enum bt_rfcomm_role |
#include <rfcomm.h>
Role of RFCOMM session and dlc.
Used only by internal APIs
| Enumerator | |
|---|---|
| BT_RFCOMM_ROLE_ACCEPTOR | |
| BT_RFCOMM_ROLE_INITIATOR | |
| struct net_buf * bt_rfcomm_create_pdu | ( | struct net_buf_pool * | pool | ) |
#include <rfcomm.h>
Allocate the buffer from pool after reserving head room for RFCOMM, L2CAP and ACL headers.
| pool | Which pool to take the buffer from. |
| int bt_rfcomm_dlc_connect | ( | struct bt_conn * | conn, |
| struct bt_rfcomm_dlc * | dlc, | ||
| uint8_t | channel ) |
#include <rfcomm.h>
Connect RFCOMM channel.
Connect RFCOMM dlc by channel, once the connection is completed dlc connected() callback will be called. If the connection is rejected disconnected() callback is called instead.
| conn | Connection object. |
| dlc | Dlc object. |
| channel | Server channel to connect to. |
| int bt_rfcomm_dlc_disconnect | ( | struct bt_rfcomm_dlc * | dlc | ) |
#include <rfcomm.h>
Disconnect RFCOMM dlc.
Disconnect RFCOMM dlc, if the connection is pending it will be canceled and as a result the dlc disconnected() callback is called.
| dlc | Dlc object. |
| int bt_rfcomm_dlc_send | ( | struct bt_rfcomm_dlc * | dlc, |
| struct net_buf * | buf ) |
#include <rfcomm.h>
Send data to RFCOMM.
Send data from buffer to the dlc. Length should be less than or equal to mtu.
| dlc | Dlc object. |
| buf | Data buffer. |
| int bt_rfcomm_send_rpn_cmd | ( | struct bt_rfcomm_dlc * | dlc, |
| struct bt_rfcomm_rpn * | rpn ) |
#include <rfcomm.h>
Send Remote Port Negotiation command.
| dlc | Pointer to the RFCOMM DLC |
| rpn | Pointer to the RPN parameters to send |
| int bt_rfcomm_server_register | ( | struct bt_rfcomm_server * | server | ) |
#include <rfcomm.h>
Register RFCOMM server.
Register RFCOMM server for a channel, each new connection is authorized using the accept() callback which in case of success shall allocate the dlc structure to be used by the new connection.
| server | Server structure. |
| int bt_rfcomm_server_unregister | ( | struct bt_rfcomm_server * | server | ) |
#include <rfcomm.h>
Unregister RFCOMM server.
Unregister RFCOMM server for a channel.
| server | Server structure. |