Zephyr Project API 4.2.99
A Scalable Open Source RTOS
|
Data Structures | |
struct | bt_goep_transport_l2cap_server |
GOEP Server structure for GOEP v2.0 and later. More... | |
Functions | |
int | bt_goep_transport_l2cap_server_register (struct bt_goep_transport_l2cap_server *server) |
Register GOEP L2CAP server. | |
int | bt_goep_transport_l2cap_connect (struct bt_conn *conn, struct bt_goep *goep, uint16_t psm) |
Connect GOEP transport over L2CAP. | |
int | bt_goep_transport_l2cap_disconnect (struct bt_goep *goep) |
Disconnect GOEP transport from L2CAP channel. | |
#include <include/zephyr/bluetooth/classic/goep.h>
Connect GOEP transport over L2CAP.
Connect GOEP transport by L2CAP, 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_L2CAP_MTU
. The L2CAP PSM is passed as third parameter. It is the RFCOMM channel of RFCOMM server of peer device.
conn | Connection object. |
goep | GOEP object. |
psm | L2CAP PSM to connect to. |
int bt_goep_transport_l2cap_disconnect | ( | struct bt_goep * | goep | ) |
#include <include/zephyr/bluetooth/classic/goep.h>
Disconnect GOEP transport from L2CAP channel.
Disconnect GOEP L2CAP transport.
goep | GOEP object. |
int bt_goep_transport_l2cap_server_register | ( | struct bt_goep_transport_l2cap_server * | server | ) |
#include <include/zephyr/bluetooth/classic/goep.h>
Register GOEP L2CAP server.
Register GOEP server for a L2CAP PSM bt_l2cap_server::psm. each new connection is authorized using the bt_goep_transport_l2cap_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.
For L2CAP PSM, for fixed, SIG-assigned PSMs (in the range 0x0001-0x0eff) the PSM should not be used. For dynamic PSMs (in the range 0x1000-0xffff), bt_l2cap_server::psm may be pre-set to a given value (not recommended however). And it shall have the least significant bit of the most significant octet equal to 0 and the least significant bit of all other octets equal to 1. Or be left as 0, in which case the channel will be auto-allocated by L2CAP.
server | Server structure. |