Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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
 

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
}
 
enum  bt_rfcomm_role { BT_RFCOMM_ROLE_ACCEPTOR , BT_RFCOMM_ROLE_INITIATOR }
 Role of RFCOMM session and dlc. 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.
 

Detailed Description

RFCOMM .

Typedef Documentation

◆ bt_rfcomm_role_t

#include <zephyr/bluetooth/classic/rfcomm.h>

Role of RFCOMM session and dlc.

Used only by internal APIs

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

#include <zephyr/bluetooth/classic/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_role

#include <zephyr/bluetooth/classic/rfcomm.h>

Role of RFCOMM session and dlc.

Used only by internal APIs

Enumerator
BT_RFCOMM_ROLE_ACCEPTOR 
BT_RFCOMM_ROLE_INITIATOR 

Function Documentation

◆ bt_rfcomm_create_pdu()

struct net_buf * bt_rfcomm_create_pdu ( struct net_buf_pool * pool)

#include <zephyr/bluetooth/classic/rfcomm.h>

Allocate the buffer from pool after reserving head room for RFCOMM, L2CAP and ACL headers.

Parameters
poolWhich pool to take the buffer from.
Returns
New buffer.

◆ bt_rfcomm_dlc_connect()

int bt_rfcomm_dlc_connect ( struct bt_conn * conn,
struct bt_rfcomm_dlc * dlc,
uint8_t channel )

#include <zephyr/bluetooth/classic/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.

Parameters
connConnection object.
dlcDlc object.
channelServer channel to connect to.
Returns
0 in case of success or negative value in case of error.

◆ bt_rfcomm_dlc_disconnect()

int bt_rfcomm_dlc_disconnect ( struct bt_rfcomm_dlc * dlc)

#include <zephyr/bluetooth/classic/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.

Parameters
dlcDlc object.
Returns
0 in case of success or negative value in case of error.

◆ bt_rfcomm_dlc_send()

int bt_rfcomm_dlc_send ( struct bt_rfcomm_dlc * dlc,
struct net_buf * buf )

#include <zephyr/bluetooth/classic/rfcomm.h>

Send data to RFCOMM.

Send data from buffer to the dlc. Length should be less than or equal to mtu.

Parameters
dlcDlc object.
bufData buffer.
Returns
Bytes sent in case of success or negative value in case of error.

◆ bt_rfcomm_server_register()

int bt_rfcomm_server_register ( struct bt_rfcomm_server * server)

#include <zephyr/bluetooth/classic/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.

Parameters
serverServer structure.
Returns
0 in case of success or negative value in case of error.