Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

OPP Push Client callback operations structure. More...

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

Data Fields

void(* transport_connected )(struct bt_conn *conn, struct bt_opp_client *client)
 Transport connected callback.
void(* transport_disconnected )(struct bt_opp_client *client)
 Transport disconnected callback.
void(* connect )(struct bt_opp_client *client, uint8_t rsp_code, uint8_t version, uint16_t mopl, struct net_buf *buf)
 OBEX connect response callback.
void(* disconnect )(struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)
 OBEX disconnect response callback.
void(* push )(struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)
 Object push (PUT) response callback.
void(* pull )(struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)
 Business card pull (GET) response callback.
void(* abort )(struct bt_opp_client *client, struct net_buf *buf)
 Abort response callback.

Detailed Description

OPP Push Client callback operations structure.

Every callback is mandatory except bt_opp_client_cb::pull(), and bt_opp_client_transport_connect validates that they are all set. The transport callbacks are the only report of the transport coming up or going away, and the OPP Spec requires the Connect, Disconnect, Put and Abort operations. Get is optional, so pull() is only needed by a client that pulls the server's business card; bt_opp_client_pull rejects the request when it is NULL.

The structure must remain valid and constant for the entire lifetime of the Push Client instance.

Field Documentation

◆ abort

void(* bt_opp_client_cb::abort) (struct bt_opp_client *client, struct net_buf *buf)

Abort response callback.

Called when the server answers the OBEX ABORT request with BT_OPP_RSP_CODE_SUCCESS, which tells the client that the server is resynchronized with it.

Any other response code leaves the client without that guarantee, so the stack closes the transport without calling this callback. The application only gets bt_opp_client_cb::transport_disconnected() and never sees the response code.

Note
buf is owned by the stack and is only valid for the duration of this callback. The application must not unref it and has to copy any data it needs afterwards.
Parameters
clientOPP Push Client object.
bufOptional response headers buffer, or NULL.

◆ connect

void(* bt_opp_client_cb::connect) (struct bt_opp_client *client, uint8_t rsp_code, uint8_t version, uint16_t mopl, struct net_buf *buf)

OBEX connect response callback.

Called when the OBEX CONNECT response is received from the Push Server.

Note
buf is owned by the stack and is only valid for the duration of this callback. The application must not unref it and has to copy any data it needs afterwards.
Parameters
clientOPP Push Client object.
rsp_codeResponse code from server, bt_opp_rsp_code.
versionOBEX version reported by the server.
moplMaximum OBEX packet length of the server.
bufOptional response headers buffer, or NULL.

◆ disconnect

void(* bt_opp_client_cb::disconnect) (struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)

OBEX disconnect response callback.

Called when the OBEX DISCONNECT response is received. With rsp_code BT_OPP_RSP_CODE_SUCCESS the OBEX connection is gone once this is called. Any other rsp_code means the server did not accept the disconnect: the OBEX connection is still established while this callback runs, and the transport is closed right after it returns, which the bt_opp_client_cb::transport_disconnected() callback reports.

Note
buf is owned by the stack and is only valid for the duration of this callback. The application must not unref it and has to copy any data it needs afterwards.
Parameters
clientOPP Push Client object.
rsp_codeResponse code, bt_opp_rsp_code.
bufOptional response headers buffer, or NULL.

◆ pull

void(* bt_opp_client_cb::pull) (struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)

Business card pull (GET) response callback.

Called when a GET response is received while pulling the server's Default Get Object. The server returns BT_OPP_RSP_CODE_NOT_FOUND when no default object is available.

This callback is optional; only a client that pulls the server's business card needs it.

Note
buf is owned by the stack and is only valid for the duration of this callback. The application must not unref it and has to copy any data it needs afterwards.
Parameters
clientOPP Push Client object.
rsp_codeResponse code, bt_opp_rsp_code.
bufResponse headers buffer containing body data, or NULL.

◆ push

void(* bt_opp_client_cb::push) (struct bt_opp_client *client, uint8_t rsp_code, struct net_buf *buf)

Object push (PUT) response callback.

Called when a PUT response is received from the Push Server. For multi-packet transfers this is called for each response packet. BT_OPP_RSP_CODE_CONTINUE indicates the server is ready for the next body chunk; BT_OPP_RSP_CODE_SUCCESS indicates the transfer is complete.

Note
buf is owned by the stack and is only valid for the duration of this callback. The application must not unref it and has to copy any data it needs afterwards.
Parameters
clientOPP Push Client object.
rsp_codeResponse code, bt_opp_rsp_code.
bufOptional response headers buffer, or NULL.

◆ transport_connected

void(* bt_opp_client_cb::transport_connected) (struct bt_conn *conn, struct bt_opp_client *client)

Transport connected callback.

Called when the transport connection to the Push Server is established. After this, call bt_opp_client_connect to establish the OBEX connection.

Parameters
connACL connection object.
clientOPP Push Client object.

◆ transport_disconnected

void(* bt_opp_client_cb::transport_disconnected) (struct bt_opp_client *client)

Transport disconnected callback.

Called when the transport connection to the Push Server is closed, either by the peer or on completion of bt_opp_client_transport_disconnect. It is also called, without a preceding bt_opp_client_cb::transport_connected(), when a connection attempt fails after bt_opp_client_transport_connect has returned 0.

Parameters
clientOPP Push Client object.

The documentation for this struct was generated from the following file:
  • zephyr/bluetooth/classic/opp.h