linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v3 9/9] a2dp: Add reverse discovery
Date: Tue, 22 Jan 2019 15:45:24 +0200	[thread overview]
Message-ID: <20190122134524.20509-9-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20190122134524.20509-1-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Now that remote endpoints are exposed there is a chance that a
configured device will reconnect and initiate SetConfiguration skipping
the discovery phase which is now required in order to be able to switch
endpoints, so this introduces the reverse discovery logic in order to
find out about remote endpoints capabilities if they have not been
found yet.
---
 profiles/audio/a2dp.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index ff384cd23..4001ea0ea 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -583,6 +583,12 @@ static gboolean endpoint_match_codec_ind(struct avdtp *session,
 	return TRUE;
 }
 
+static void reverse_discover(struct avdtp *session, GSList *seps, int err,
+							void *user_data)
+{
+	DBG("err %d", err);
+}
+
 static gboolean endpoint_setconf_ind(struct avdtp *session,
 						struct avdtp_local_sep *sep,
 						struct avdtp_stream *stream,
@@ -638,8 +644,14 @@ static gboolean endpoint_setconf_ind(struct avdtp *session,
 						setup_ref(setup),
 						endpoint_setconf_cb,
 						a2dp_sep->user_data);
-		if (ret == 0)
+		if (ret == 0) {
+			/* Attempt to reverve discover if there are no remote
+			 * SEPs.
+			 */
+			if (queue_isempty(setup->chan->seps))
+				a2dp_discover(session, reverse_discover, NULL);
 			return TRUE;
+		}
 
 		setup_unref(setup);
 		setup->err = g_new(struct avdtp_error, 1);
-- 
2.17.2


  parent reply	other threads:[~2019-01-22 13:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-22 13:45 [PATCH v3 1/9] doc/media-api: Enable MediaEndpoint to expose remote SEP Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 2/9] a2dp: Expose " Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 3/9] doc/media-api: Add Endpoint property to MediaTransport Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 4/9] a2dp: Implement MediaTransport.Endpoint Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 5/9] doc/settings-storage: Add Endpoint group to cache Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 6/9] a2dp: Cache remote endpoints Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 7/9] doc/media-api: Add Device property to MediaEndpoint Luiz Augusto von Dentz
2019-01-22 13:45 ` [PATCH v3 8/9] a2dp: Add implementation of MediaEndpoint.Device Luiz Augusto von Dentz
2019-01-22 13:45 ` Luiz Augusto von Dentz [this message]
2019-01-22 14:20 ` [PATCH v3 1/9] doc/media-api: Enable MediaEndpoint to expose remote SEP Luiz Augusto von Dentz
2019-01-22 17:56   ` Pali Rohár
2019-01-23 11:24     ` Luiz Augusto von Dentz
2019-01-27  2:00       ` Pali Rohár
2019-03-27 11:14         ` Pali Rohár
2019-04-19  8:03           ` Pali Rohár
2019-04-19 10:04             ` Luiz Augusto von Dentz
2019-04-19 11:01               ` Pali Rohár
2019-04-19 11:48                 ` Luiz Augusto von Dentz
2019-04-19 12:04                   ` Pali Rohár
2019-04-20  6:43                     ` Luiz Augusto von Dentz
2019-04-20  7:00                       ` Pali Rohár
2019-04-20  7:31                         ` Luiz Augusto von Dentz
2019-04-05 16:47       ` Pali Rohár
2019-04-08  9:41         ` Luiz Augusto von Dentz
2019-04-08  9:47           ` Luiz Augusto von Dentz
2019-04-08  9:53             ` Pali Rohár
2019-04-19  8:03           ` Pali Rohár
2019-05-03  6:17       ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190122134524.20509-9-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).