bluetooth: avdtp: save avdtp session to ep
when ep is configured, the ep is used by the avdtp session, so combine
them together when ep is configured.
Signed-off-by: Mark Wang <yichang.wang@nxp.com>
diff --git a/subsys/bluetooth/host/classic/avdtp.c b/subsys/bluetooth/host/classic/avdtp.c
index bc89454..c0d4f8e 100644
--- a/subsys/bluetooth/host/classic/avdtp.c
+++ b/subsys/bluetooth/host/classic/avdtp.c
@@ -954,6 +954,7 @@
err = avdtp_send_rsp(session, rsp_buf);
if (!reconfig && !err && !avdtp_err_code) {
+ sep->session = session;
bt_avdtp_set_state(sep, AVDTP_CONFIGURED);
}
@@ -989,6 +990,10 @@
avdtp_set_status(req, buf, msg_type);
}
+ if (req->status == BT_AVDTP_SUCCESS) {
+ SET_CONF_REQ(req)->sep->session = session;
+ }
+
bt_avdtp_clear_req(session);
if (req->func != NULL) {