Zephyr API 3.6.99
Loading...
Searching...
No Matches
bt_ots_client_cb Struct Reference

OTS client callback structure. More...

#include <ots.h>

Data Fields

void(* obj_selected )(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err)
 Callback function when a new object is selected.
 
int(* obj_data_read )(struct bt_ots_client *ots_inst, struct bt_conn *conn, uint32_t offset, uint32_t len, uint8_t *data_p, bool is_complete)
 Callback function for the data of the selected object.
 
void(* obj_metadata_read )(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint8_t metadata_read)
 Callback function for metadata of the selected object.
 
void(* obj_data_written )(struct bt_ots_client *ots_inst, struct bt_conn *conn, size_t len)
 Callback function for the data of the write object.
 
void(* obj_checksum_calculated )(struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint32_t checksum)
 Callback function when checksum indication is received.
 

Detailed Description

OTS client callback structure.

Field Documentation

◆ obj_checksum_calculated

void(* bt_ots_client_cb::obj_checksum_calculated) (struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint32_t checksum)

Callback function when checksum indication is received.

Called when the oacp_ind_handler received response of OP BT_GATT_OTS_OACP_PROC_CHECKSUM_CALC.

Parameters
ots_instPointer to the OTC instance.
connThe connection to the peer device.
errError code (bt_gatt_ots_oacp_res_code).
checksumChecksum if error code is BT_GATT_OTS_OACP_RES_SUCCESS, otherwise 0.

◆ obj_data_read

int(* bt_ots_client_cb::obj_data_read) (struct bt_ots_client *ots_inst, struct bt_conn *conn, uint32_t offset, uint32_t len, uint8_t *data_p, bool is_complete)

Callback function for the data of the selected object.

Called when the data of the selected object are read using bt_ots_client_read_object_data().

Parameters
ots_instPointer to the OTC instance.
connThe connection to the peer device.
offsetOffset of the received data.
lenLength of the received data.
data_pPointer to the received data.
is_completeIndicate if the whole object has been received.
Returns
int BT_OTS_STOP or BT_OTS_CONTINUE. BT_OTS_STOP can be used to stop reading.

◆ obj_data_written

void(* bt_ots_client_cb::obj_data_written) (struct bt_ots_client *ots_inst, struct bt_conn *conn, size_t len)

Callback function for the data of the write object.

Called when the data of the selected object is written using bt_ots_client_write_object_data().

Parameters
ots_instPointer to the OTC instance.
connThe connection to the peer device.
lenLength of the written data.

◆ obj_metadata_read

void(* bt_ots_client_cb::obj_metadata_read) (struct bt_ots_client *ots_inst, struct bt_conn *conn, int err, uint8_t metadata_read)

Callback function for metadata of the selected object.

Called when metadata of the selected object are read using bt_ots_client_read_object_metadata(). Not all of the metadata may have been initialized.

Parameters
ots_instPointer to the OTC instance.
connThe connection to the peer device.
errError value. 0 on success, GATT error or ERRNO on fail.
metadata_readBitfield of the metadata that was successfully read.

◆ obj_selected

void(* bt_ots_client_cb::obj_selected) (struct bt_ots_client *ots_inst, struct bt_conn *conn, int err)

Callback function when a new object is selected.

Called when the a new object is selected and the current object has changed. The cur_object in ots_inst will have been reset, and metadata should be read again with bt_ots_client_read_object_metadata().

Parameters
ots_instPointer to the OTC instance.
connThe connection to the peer device.
errError code (bt_ots_olcp_res_code).

The documentation for this struct was generated from the following file: