From: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Frédéric Dalleau" <frederic.dalleau@linux.intel.com>
Subject: [RFC 2/2] btiotest: Enable deferred setup for sco sockets
Date: Wed, 14 Nov 2012 19:18:00 +0100 [thread overview]
Message-ID: <1352917080-18509-2-git-send-email-frederic.dalleau@linux.intel.com> (raw)
In-Reply-To: <1352917080-18509-1-git-send-email-frederic.dalleau@linux.intel.com>
---
test/btiotest.c | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/test/btiotest.c b/test/btiotest.c
index f090dd9..f157286 100644
--- a/test/btiotest.c
+++ b/test/btiotest.c
@@ -459,24 +459,34 @@ static void sco_connect(const char *src, const char *dst, gint disconn)
}
}
-static void sco_listen(const char *src, gint disconn)
+static void sco_listen(const char *src, gint disconn, gboolean defer)
{
struct io_data *data;
+ BtIOConnect conn;
+ BtIOConfirm cfm;
GIOChannel *sco_srv;
GError *err = NULL;
printf("Listening for SCO connections\n");
+ if (defer) {
+ conn = NULL;
+ cfm = confirm_cb;
+ } else {
+ conn = connect_cb;
+ cfm = NULL;
+ }
+
data = io_data_new(NULL, -1, disconn, -1);
if (src)
- sco_srv = bt_io_listen(connect_cb, NULL, data,
+ sco_srv = bt_io_listen(conn, cfm, data,
(GDestroyNotify) io_data_unref,
&err,
BT_IO_OPT_SOURCE, src,
BT_IO_OPT_INVALID);
else
- sco_srv = bt_io_listen(connect_cb, NULL, data,
+ sco_srv = bt_io_listen(conn, cfm, data,
(GDestroyNotify) io_data_unref,
&err, BT_IO_OPT_INVALID);
@@ -581,7 +591,7 @@ int main(int argc, char *argv[])
if (argc > 1)
sco_connect(opt_dev, argv[1], opt_disconn);
else
- sco_listen(opt_dev, opt_disconn);
+ sco_listen(opt_dev, opt_disconn, opt_defer);
}
signal(SIGTERM, sig_term);
--
1.7.9.5
prev parent reply other threads:[~2012-11-14 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-14 18:17 [RFC 1/2] scotest: Add deferred setup option Frédéric Dalleau
2012-11-14 18:18 ` Frédéric Dalleau [this message]
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=1352917080-18509-2-git-send-email-frederic.dalleau@linux.intel.com \
--to=frederic.dalleau@linux.intel.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