Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
rfcomm.h File Reference

Bluetooth RFCOMM handling. More...

Go to the source code of this file.

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_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.
 

Enumerations

enum  {
  BT_RFCOMM_CHAN_HFP_HF = 1 , BT_RFCOMM_CHAN_HFP_AG , BT_RFCOMM_CHAN_HSP_AG , BT_RFCOMM_CHAN_HSP_HS ,
  BT_RFCOMM_CHAN_SPP , BT_RFCOMM_CHAN_DYNAMIC_START
}
 
enum  bt_rfcomm_role { BT_RFCOMM_ROLE_ACCEPTOR , BT_RFCOMM_ROLE_INITIATOR }
 Role of RFCOMM session and dlc. More...
 
enum  {
  BT_RFCOMM_RPN_BAUD_RATE_2400 = 0x0 , BT_RFCOMM_RPN_BAUD_RATE_4800 = 0x1 , BT_RFCOMM_RPN_BAUD_RATE_7200 = 0x2 , BT_RFCOMM_RPN_BAUD_RATE_9600 = 0x3 ,
  BT_RFCOMM_RPN_BAUD_RATE_19200 = 0x4 , BT_RFCOMM_RPN_BAUD_RATE_38400 = 0x5 , BT_RFCOMM_RPN_BAUD_RATE_57600 = 0x6 , BT_RFCOMM_RPN_BAUD_RATE_115200 = 0x7 ,
  BT_RFCOMM_RPN_BAUD_RATE_230400 = 0x8
}
 RFCOMM RPN baud rate values. More...
 
enum  { BT_RFCOMM_RPN_DATA_BITS_5 = 0x0 , BT_RFCOMM_RPN_DATA_BITS_6 = 0x1 , BT_RFCOMM_RPN_DATA_BITS_7 = 0x2 , BT_RFCOMM_RPN_DATA_BITS_8 = 0x3 }
 RFCOMM RPN data bit values. More...
 
enum  { BT_RFCOMM_RPN_STOP_BITS_1 = 0 , BT_RFCOMM_RPN_STOP_BITS_1_5 = 1 }
 RFCOMM RPN stop bit values. More...
 
enum  {
  BT_RFCOMM_RPN_PARITY_NONE = 0x0 , BT_RFCOMM_RPN_PARITY_ODD = 0x1 , BT_RFCOMM_RPN_PARITY_EVEN = 0x3 , BT_RFCOMM_RPN_PARITY_MARK = 0x5 ,
  BT_RFCOMM_RPN_PARITY_SPACE = 0x7
}
 RFCOMM RPN parity bit values. More...
 

Functions

int bt_rfcomm_server_register (struct bt_rfcomm_server *server)
 Register 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_bufbt_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.
 

Detailed Description

Bluetooth RFCOMM handling.