Skip to content

Commit

Permalink
Bluetooth: HFP: Add data sent callback
Browse files Browse the repository at this point in the history
Set struct bt_rfcomm_dlc_ops::sent.

Get the data sending result through
sent callback.

Signed-off-by: Lyle Zhu <[email protected]>
  • Loading branch information
lylezhu2012 authored and fabiobaltieri committed Mar 12, 2024
1 parent cb3d1c9 commit 3e8d118
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions subsys/bluetooth/host/classic/hfp_hf.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ int hfp_hf_send_cmd(struct bt_hfp_hf *hf, at_resp_cb_t resp,
net_buf_add(buf, ret);
net_buf_add_u8(buf, '\r');

LOG_DBG("HF %p, DLC %p sending buf %p", hf, &hf->rfcomm_dlc, buf);

ret = bt_rfcomm_dlc_send(&hf->rfcomm_dlc, buf);
if (ret < 0) {
LOG_ERR("Rfcomm send error :(%d)", ret);
Expand Down Expand Up @@ -640,13 +642,19 @@ static void hfp_hf_recv(struct bt_rfcomm_dlc *dlc, struct net_buf *buf)
}
}

static void hfp_hf_sent(struct bt_rfcomm_dlc *dlc, struct net_buf *buf, int err)
{
LOG_DBG("DLC %p sent cb buf %p (err %d)", dlc, buf, err);
}

static int bt_hfp_hf_accept(struct bt_conn *conn, struct bt_rfcomm_dlc **dlc)
{
int i;
static struct bt_rfcomm_dlc_ops ops = {
.connected = hfp_hf_connected,
.disconnected = hfp_hf_disconnected,
.recv = hfp_hf_recv,
.sent = hfp_hf_sent,
};

LOG_DBG("conn %p", conn);
Expand Down

0 comments on commit 3e8d118

Please sign in to comment.