Skip to content

Commit 26065ec

Browse files
lylezhu2012cfriedt
authored andcommitted
Bluetooth: Classic: GOEP: Support multiple OBEX sessions
Split the structure `struct bt_obex` into two parts. Part 1 `struct bt_obex`, it is the common part and shared by all OBEX sessions which share the same one transport. Part 2 `struct bt_obex_server` and `struct bt_obex_client`. The `struct bt_obex_server` is used to manage the OBEX session of server role. The `struct bt_obex_client` is used to manage the OBEX session of client role. Add function `bt_obex_server_register()` to register the OBEX server with specific uuid. Add function `bt_obex_server_unregister()` to unregister the OBEX server. Add function `bt_obex_make_uuid()` to make UUID. Signed-off-by: Lyle Zhu <[email protected]>
1 parent b62be03 commit 26065ec

File tree

6 files changed

+1171
-472
lines changed

6 files changed

+1171
-472
lines changed

include/zephyr/bluetooth/classic/goep.h

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ struct bt_goep_transport_rfcomm_server {
143143
* This callback is called whenever a new incoming GOEP connection requires
144144
* authorization.
145145
*
146+
* Before returning the callback, @ref bt_goep::transport_ops should be initialized with
147+
* valid address of type @ref bt_goep_transport_ops object. The field `mtu` of
148+
* @ref bt_obex::rx could be passed with valid value. Or set it to zero, the mtu will be
149+
* calculated according to @kconfig{CONFIG_BT_GOEP_RFCOMM_MTU}.
150+
*
146151
* @warning It is the responsibility of the caller to zero out the parent of the GOEP
147152
* object.
148153
*
@@ -184,10 +189,9 @@ int bt_goep_transport_rfcomm_server_register(struct bt_goep_transport_rfcomm_ser
184189
* The GOEP object is passed (over an address of it) as second parameter, application should
185190
* create transport dedicated GOEP object @ref bt_goep. Then pass to this API the location
186191
* (address).
187-
* Before calling the API, @ref bt_obex::client_ops and @ref bt_goep::transport_ops should
188-
* be initialized with valid address of type @ref bt_obex_client_ops object and
189-
* @ref bt_goep_transport_ops object. The field `mtu` of @ref bt_obex::rx could be passed with
190-
* valid value. Or set it to zero, the mtu will be calculated according to
192+
* Before calling the API, @ref bt_goep::transport_ops should be initialized with valid address
193+
* of type @ref bt_goep_transport_ops object. The field `mtu` of @ref bt_obex::rx could be passed
194+
* with valid value. Or set it to zero, the mtu will be calculated according to
191195
* @kconfig{CONFIG_BT_GOEP_RFCOMM_MTU}.
192196
* The RFCOMM channel is passed as third parameter. It is the RFCOMM channel of RFCOMM server of
193197
* peer device.
@@ -241,6 +245,11 @@ struct bt_goep_transport_l2cap_server {
241245
* This callback is called whenever a new incoming GOEP connection requires
242246
* authorization.
243247
*
248+
* Before returning the callback, @ref bt_goep::transport_ops should be initialized with
249+
* valid address of type @ref bt_goep_transport_ops object. The field `mtu` of
250+
* @ref bt_obex::rx could be passed with valid value. Or set it to zero, the mtu will be
251+
* calculated according to @kconfig{CONFIG_BT_GOEP_L2CAP_MTU}.
252+
*
244253
* @warning It is the responsibility of the caller to zero out the parent of the GOEP
245254
* object.
246255
*
@@ -286,10 +295,9 @@ int bt_goep_transport_l2cap_server_register(struct bt_goep_transport_l2cap_serve
286295
* The GOEP object is passed (over an address of it) as second parameter, application should
287296
* create transport dedicated GOEP object @ref bt_goep. Then pass to this API the location
288297
* (address).
289-
* Before calling the API, @ref bt_obex::client_ops and @ref bt_goep::transport_ops should
290-
* be initialized with valid address of type @ref bt_obex_client_ops object and
291-
* @ref bt_goep_transport_ops object. The field `mtu` of @ref bt_obex::rx could be passed with
292-
* valid value. Or set it to zero, the mtu will be calculated according to
298+
* Before calling the API, @ref bt_goep::transport_ops should be initialized with valid address
299+
* of type @ref bt_goep_transport_ops object. The field `mtu` of @ref bt_obex::rx could be passed
300+
* with valid value. Or set it to zero, the mtu will be calculated according to
293301
* @kconfig{CONFIG_BT_GOEP_L2CAP_MTU}.
294302
* The L2CAP PSM is passed as third parameter. It is the RFCOMM channel of RFCOMM server of peer
295303
* device.

0 commit comments

Comments
 (0)