Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
goep.h
Go to the documentation of this file.
1/* goep.h - Bluetooth Generic Object Exchange Profile handling */
2
3/*
4 * Copyright 2024-2026 NXP
5 *
6 * SPDX-License-Identifier: Apache-2.0
7 */
8
9#ifndef ZEPHYR_INCLUDE_BLUETOOTH_GOEP_H_
10#define ZEPHYR_INCLUDE_BLUETOOTH_GOEP_H_
11
18
19#include <zephyr/kernel.h>
20#include <string.h>
21#include <errno.h>
22#include <stdbool.h>
23
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34struct bt_goep;
35
49 void (*connected)(struct bt_conn *conn, struct bt_goep *goep);
50
58 void (*disconnected)(struct bt_goep *goep);
59};
60
65
73 struct bt_goep *goep;
74};
75
90
98
124
138struct bt_goep {
144
150
152 struct bt_conn *_acl;
153
155 atomic_t _state;
156
163
165 struct bt_obex obex;
166};
167
183#define BT_GOEP_INIT_V1(_goep, _v1) \
184 do { \
185 BUILD_ASSERT(SAME_TYPE(*(_goep), struct bt_goep) && \
186 SAME_TYPE(*(_v1), struct bt_goep_transport_v1), \
187 "pointer type mismatch in BT_GOEP_INIT_V1"); \
188 (_v1)->goep = (_goep); \
189 (_goep)->v1 = (_v1); \
190 (_goep)->v2 = NULL; \
191 } while (0)
192
208#define BT_GOEP_INIT_V2(_goep, _v2) \
209 do { \
210 BUILD_ASSERT(SAME_TYPE(*(_goep), struct bt_goep) && \
211 SAME_TYPE(*(_v2), struct bt_goep_transport_v2), \
212 "pointer type mismatch in BT_GOEP_INIT_V2"); \
213 (_v2)->goep = (_goep); \
214 (_goep)->v2 = (_v2); \
215 (_goep)->v1 = NULL; \
216 } while (0)
217
223
237
270 int (*accept)(struct bt_conn *conn, struct bt_goep_transport_rfcomm_server *server,
271 struct bt_goep **goep);
272
274};
275
290
324int bt_goep_transport_rfcomm_connect(struct bt_conn *conn, struct bt_goep *goep, uint8_t channel);
325
335
337
343
359
392 int (*accept)(struct bt_conn *conn, struct bt_goep_transport_l2cap_server *server,
393 struct bt_goep **goep);
394
396};
397
416
450int bt_goep_transport_l2cap_connect(struct bt_conn *conn, struct bt_goep *goep, uint16_t psm);
451
461
463
475struct net_buf *bt_goep_create_pdu(struct bt_goep *goep, struct net_buf_pool *pool);
476
477#ifdef __cplusplus
478}
479#endif
480
484
485#endif /* ZEPHYR_INCLUDE_BLUETOOTH_GOEP_H_ */
Bluetooth subsystem core APIs.
Bluetooth connection handling.
System error numbers.
long atomic_t
Atomic integer variable.
Definition atomic_types.h:31
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.
int bt_goep_transport_l2cap_server_register(struct bt_goep_transport_l2cap_server *server)
Register GOEP L2CAP server.
int bt_goep_transport_rfcomm_disconnect(struct bt_goep *goep)
Disconnect GOEP transport from RFCOMM.
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.
bt_goep_transport_state
Life-span states of GOEP transport.
Definition goep.h:114
struct net_buf * bt_goep_create_pdu(struct bt_goep *goep, struct net_buf_pool *pool)
Allocate the buffer from given pool after reserving head room for GOEP.
@ BT_GOEP_TRANSPORT_CONNECTING
GOEP in connecting state.
Definition goep.h:118
@ BT_GOEP_TRANSPORT_DISCONNECTING
GOEP in disconnecting state.
Definition goep.h:122
@ BT_GOEP_TRANSPORT_DISCONNECTED
GOEP disconnected.
Definition goep.h:116
@ BT_GOEP_TRANSPORT_CONNECTED
GOEP ready for upper layer traffic on it.
Definition goep.h:120
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:42
Public kernel APIs.
Bluetooth L2CAP handling.
Bluetooth RFCOMM handling.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Opaque type representing a connection to a remote device.
GOEP Server structure for GOEP v2.0 and later.
Definition goep.h:345
struct bt_l2cap_server l2cap
L2CAP PSM for GOEP v2.0 and later.
Definition goep.h:358
int(* accept)(struct bt_conn *conn, struct bt_goep_transport_l2cap_server *server, struct bt_goep **goep)
Server accept callback.
Definition goep.h:392
sys_snode_t node
Definition goep.h:395
GOEP transport operations structure.
Definition goep.h:40
void(* connected)(struct bt_conn *conn, struct bt_goep *goep)
GOEP transport connected callback.
Definition goep.h:49
void(* disconnected)(struct bt_goep *goep)
GOEP transport disconnected callback.
Definition goep.h:58
GOEP Server structure GOEP v1.1.
Definition goep.h:225
sys_snode_t node
Definition goep.h:273
int(* accept)(struct bt_conn *conn, struct bt_goep_transport_rfcomm_server *server, struct bt_goep **goep)
Server accept callback.
Definition goep.h:270
struct bt_rfcomm_server rfcomm
RFCOMM server for GOEP v1.1.
Definition goep.h:236
GOEP v1.1 structure.
Definition goep.h:62
struct bt_rfcomm_dlc dlc
RFCOMM DLC used for transport.
Definition goep.h:64
struct bt_goep * goep
Back-pointer to parent GOEP object.
Definition goep.h:73
GOEP v2 structure.
Definition goep.h:77
struct bt_goep * goep
Back-pointer to parent GOEP object.
Definition goep.h:88
struct bt_l2cap_br_chan chan
L2CAP BR/EDR channel used for transport.
Definition goep.h:79
GOEP transport unified structure.
Definition goep.h:92
struct bt_goep_transport_v2 v2
GOEP v2 transport.
Definition goep.h:96
struct bt_goep_transport_v1 v1
GOEP v1.1 transport.
Definition goep.h:94
GOEP structure.
Definition goep.h:138
struct bt_goep_transport_v2 * v2
To be used for transport v2.
Definition goep.h:149
struct bt_obex obex
OBEX object.
Definition goep.h:165
struct bt_goep_transport_v1 * v1
To be used for transport v1.
Definition goep.h:143
const struct bt_goep_transport_ops * transport_ops
GOEP transport operations.
Definition goep.h:162
BREDR L2CAP Channel structure.
Definition l2cap.h:512
L2CAP Server structure.
Definition l2cap.h:799
OBEX structure.
Definition obex.h:585
RFCOMM DLC structure.
Definition rfcomm.h:112
Definition rfcomm.h:140
Network buffer pool representation.
Definition net_buf.h:1151
Network buffer representation.
Definition net_buf.h:1015