Bluetooth: OTS - Rename client callbacks
Rename client callbacks to be more consistent with common code style. Signed-off-by: Asbjørn Sæbø <asbjorn.sabo@nordicsemi.no>
This commit is contained in:
parent
70eefae1d2
commit
c894b63e9e
3 changed files with 23 additions and 23 deletions
|
@ -844,8 +844,8 @@ struct bt_ots_client_cb {
|
|||
* @return int BT_OTS_STOP or BT_OTS_CONTINUE. BT_OTS_STOP can
|
||||
* be used to stop reading.
|
||||
*/
|
||||
int (*content_cb)(struct bt_conn *conn, uint32_t offset, uint32_t len,
|
||||
uint8_t *data_p, bool is_complete,
|
||||
int (*obj_content_recv)(struct bt_conn *conn, uint32_t offset,
|
||||
uint32_t len, uint8_t *data_p, bool is_complete,
|
||||
struct bt_ots_client *ots_inst);
|
||||
|
||||
/** @brief Callback function for metadata of the selected object.
|
||||
|
@ -860,7 +860,7 @@ struct bt_ots_client_cb {
|
|||
* @param metadata_read Bitfield of the metadata that was
|
||||
* successfully read.
|
||||
*/
|
||||
void (*metadata_cb)(struct bt_conn *conn, int err,
|
||||
void (*obj_metadata_recv)(struct bt_conn *conn, int err,
|
||||
struct bt_ots_client *ots_inst,
|
||||
uint8_t metadata_read);
|
||||
};
|
||||
|
|
|
@ -1451,13 +1451,13 @@ int bt_mcc_init(struct bt_mcc_cb *cb)
|
|||
/* TODO: Have one single content callback. */
|
||||
/* For now: Use the icon callback for content - it is the first, */
|
||||
/* and this will anyway be reset later. */
|
||||
otc_cb.content_cb = on_icon_content;
|
||||
otc_cb.obj_content_recv = on_icon_content;
|
||||
otc_cb.obj_selected = on_obj_selected;
|
||||
otc_cb.metadata_cb = on_object_metadata;
|
||||
otc_cb.obj_metadata_recv = on_object_metadata;
|
||||
|
||||
BT_DBG("Current object selected callback: %p", otc_cb.obj_selected);
|
||||
BT_DBG("Content callback: %p", otc_cb.content_cb);
|
||||
BT_DBG("Metadata callback: %p", otc_cb.metadata_cb);
|
||||
BT_DBG("Object selected callback: %p", otc_cb.obj_selected);
|
||||
BT_DBG("Object content callback: %p", otc_cb.obj_content_recv);
|
||||
BT_DBG("Object metadata callback: %p", otc_cb.obj_metadata_recv);
|
||||
#endif /* CONFIG_BT_MCC_OTS */
|
||||
|
||||
return 0;
|
||||
|
@ -2667,7 +2667,7 @@ int bt_mcc_otc_read_icon_object(struct bt_conn *conn)
|
|||
int err;
|
||||
/* TODO: Add handling for busy - either MCS or OTS */
|
||||
|
||||
cur_mcs_inst->otc.cb->content_cb = on_icon_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_icon_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
@ -2684,7 +2684,7 @@ int bt_mcc_otc_read_track_segments_object(struct bt_conn *conn)
|
|||
/* TODO: Add handling for busy - either MCS or OTS */
|
||||
|
||||
/* TODO: Assumes object is already selected */
|
||||
cur_mcs_inst->otc.cb->content_cb = on_track_segments_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_track_segments_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
@ -2701,7 +2701,7 @@ int bt_mcc_otc_read_current_track_object(struct bt_conn *conn)
|
|||
/* TODO: Add handling for busy - either MCS or OTS */
|
||||
|
||||
/* TODO: Assumes object is already selected */
|
||||
cur_mcs_inst->otc.cb->content_cb = on_current_track_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_current_track_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
@ -2718,7 +2718,7 @@ int bt_mcc_otc_read_next_track_object(struct bt_conn *conn)
|
|||
/* TODO: Add handling for busy - either MCS or OTS */
|
||||
|
||||
/* TODO: Assumes object is already selected */
|
||||
cur_mcs_inst->otc.cb->content_cb = on_next_track_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_next_track_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
@ -2737,7 +2737,7 @@ int bt_mcc_otc_read_parent_group_object(struct bt_conn *conn)
|
|||
/* TODO: Assumes object is already selected */
|
||||
|
||||
/* Reuse callback for current group */
|
||||
cur_mcs_inst->otc.cb->content_cb = on_parent_group_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_parent_group_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
@ -2754,7 +2754,7 @@ int bt_mcc_otc_read_current_group_object(struct bt_conn *conn)
|
|||
/* TODO: Add handling for busy - either MCS or OTS */
|
||||
|
||||
/* TODO: Assumes object is already selected */
|
||||
cur_mcs_inst->otc.cb->content_cb = on_current_group_content;
|
||||
cur_mcs_inst->otc.cb->obj_content_recv = on_current_group_content;
|
||||
|
||||
err = bt_ots_client_read_object_data(conn, &cur_mcs_inst->otc);
|
||||
if (err) {
|
||||
|
|
|
@ -159,7 +159,7 @@ static ssize_t rx_done(struct bt_gatt_ots_l2cap *l2cap_ctx,
|
|||
}
|
||||
|
||||
|
||||
cb_ret = cur_inst->otc_inst->cb->content_cb(conn, offset,
|
||||
cb_ret = cur_inst->otc_inst->cb->obj_content_recv(conn, offset,
|
||||
buf->len, buf->data,
|
||||
is_complete, 0);
|
||||
|
||||
|
@ -1222,8 +1222,8 @@ static void read_next_metadata(struct bt_conn *conn,
|
|||
read_obj_properties_cb);
|
||||
} else {
|
||||
inst->busy = false;
|
||||
if (inst->otc_inst->cb->metadata_cb) {
|
||||
inst->otc_inst->cb->metadata_cb(
|
||||
if (inst->otc_inst->cb->obj_metadata_recv) {
|
||||
inst->otc_inst->cb->obj_metadata_recv(
|
||||
conn, inst->metadata_err, inst->otc_inst,
|
||||
inst->metadata_read);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue