audio: Fix not resetting connect_id 56/51756/1
authorBharat Panda <bharat.panda@samsung.com>
Fri, 13 Nov 2015 13:37:13 +0000 (19:07 +0530)
committerBharat Panda <bharat.panda@samsung.com>
Fri, 13 Nov 2015 13:37:13 +0000 (19:07 +0530)
Ever since discovery can be canceled connect_id is now set while
discovering so it needs to be reset on the callback otherwise it will
cause .connect to always return -EBUSY until .disconnect is called.

git repo link:
http://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=a1a01a6f95fb3715dd7aa27af3543b6cb0a62da7

Change-Id: Ibd5af39c1346536f11a45390d3f262b2fcc15fa1

profiles/audio/sink.c
profiles/audio/source.c

index cdd89b4..80caa09 100644 (file)
@@ -242,6 +242,8 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
        struct sink *sink = user_data;
        int id, perr;
 
+       sink->connect_id = 0;
+
        if (err) {
                avdtp_unref(sink->session);
                sink->session = NULL;
index 11e4cff..e834c77 100644 (file)
@@ -227,6 +227,8 @@ static void discovery_complete(struct avdtp *session, GSList *seps, struct avdtp
        struct source *source = user_data;
        int id, perr;
 
+       source->connect_id = 0;
+
        if (err) {
                avdtp_unref(source->session);
                source->session = NULL;