diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index a2ce320..15e211b 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
struct avdtp_error *err, void *user_data)
{
struct a2dp_setup *setup = user_data;
+ uint16_t version = avdtp_get_version(session);
- DBG("err %p", err);
+ DBG("version 0x%04x err %p", version, err);
setup->seps = seps;
setup->err = err;
if (!err) {
g_slist_foreach(seps, register_remote_sep, setup->chan);
- store_remote_seps(setup->chan);
+
+ /* Only store version has been initialized as features like
+ * Delay Reporting may not be queried if the version in
+ * unknown.
+ */
+ if (version)
+ store_remote_seps(setup->chan);
}
finalize_discover(setup);
diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index b632e41..1fd2be0 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
const sdp_record_t *rec;
sdp_list_t *protos;
sdp_data_t *proto_desc;
- uint16_t ver = 0x0100;
+ uint16_t ver = 0x0000;
rec = btd_device_get_record(session->device, A2DP_SINK_UUID);
if (!rec)
return session;
}
+uint16_t avdtp_get_version(struct avdtp *session)
+{
+ return session->version;
+}
+
static GIOChannel *l2cap_connect(struct avdtp *session)
{
GError *err = NULL;
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index ad2cb9b..f1e51d4 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
struct avdtp *avdtp_new(GIOChannel *chan, struct btd_device *device,
struct queue *lseps);
+uint16_t avdtp_get_version(struct avdtp *session);