Zephyr Project API 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Data Structures

struct  bt_goep_transport_rfcomm_server
 GOEP Server structure GOEP v1.1. More...
 

Functions

int bt_goep_transport_rfcomm_server_register (struct bt_goep_transport_rfcomm_server *server)
 Register GOEP RFCOMM server.
 
int bt_goep_transport_rfcomm_connect (struct bt_conn *conn, struct bt_goep *goep, uint8_t channel)
 Connect GOEP transport over RFCOMM.
 
int bt_goep_transport_rfcomm_disconnect (struct bt_goep *goep)
 Disconnect GOEP transport from RFCOMM.
 

Detailed Description

Function Documentation

◆ bt_goep_transport_rfcomm_connect()

int bt_goep_transport_rfcomm_connect ( struct bt_conn *  conn,
struct bt_goep goep,
uint8_t  channel 
)

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

Connect GOEP transport over RFCOMM.

Connect GOEP transport over RFCOMM, once the connection is completed, the callback bt_goep_transport_ops::connected is called. If the connection is rejected, bt_goep_transport_ops::disconnected callback is called instead. The GOEP object is passed (over an address of it) as second parameter, application should create transport dedicated GOEP object Generic Object Exchange Profile (GOEP). Then pass to this API the location (address). Before calling the API, bt_obex::client_ops and bt_goep::transport_ops should be initialized with valid address of type bt_obex_client_ops object and bt_goep_transport_ops object. The field mtu of bt_obex::rx could be passed with valid value. Or set it to zero, the mtu will be calculated according to

CONFIG_BT_GOEP_RFCOMM_MTU 

. The RFCOMM channel is passed as third parameter. It is the RFCOMM channel of RFCOMM server of peer device.

Warning
It is the responsibility of the caller to zero out the parent of the GOEP object.
Parameters
connConnection object.
goepGOEP object.
channelRFCOMM channel to connect to.
Returns
0 in case of success or negative value in case of error.

◆ bt_goep_transport_rfcomm_disconnect()

int bt_goep_transport_rfcomm_disconnect ( struct bt_goep goep)

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

Disconnect GOEP transport from RFCOMM.

Disconnect GOEP RFCOMM transport.

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

◆ bt_goep_transport_rfcomm_server_register()

int bt_goep_transport_rfcomm_server_register ( struct bt_goep_transport_rfcomm_server server)

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

Register GOEP RFCOMM server.

Register GOEP server for a RFCOMM channel bt_rfcomm_server::channel, each new connection is authorized using the bt_goep_transport_rfcomm_server::accept callback which in case of success shall allocate the GOEP structure Generic Object Exchange Profile (GOEP) to be used by the new GOEP connection.

bt_rfcomm_server::channel may be pre-set to a given value (not recommended however). Or be left as 0, in which case the channel will be auto-allocated by RFCOMM.

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