|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
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. | |
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.
| 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.
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.| client | OPP Push Client object. |
| buf | Optional response headers buffer, or NULL. |
| 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.
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.| client | OPP Push Client object. |
| rsp_code | Response code from server, bt_opp_rsp_code. |
| version | OBEX version reported by the server. |
| mopl | Maximum OBEX packet length of the server. |
| buf | Optional response headers buffer, or NULL. |
| 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.
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.| client | OPP Push Client object. |
| rsp_code | Response code, bt_opp_rsp_code. |
| buf | Optional response headers buffer, or NULL. |
| 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.
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.| client | OPP Push Client object. |
| rsp_code | Response code, bt_opp_rsp_code. |
| buf | Response headers buffer containing body data, or NULL. |
| 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.
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.| client | OPP Push Client object. |
| rsp_code | Response code, bt_opp_rsp_code. |
| buf | Optional response headers buffer, or NULL. |
| 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.
| conn | ACL connection object. |
| client | OPP Push Client object. |
| 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.
| client | OPP Push Client object. |