Linux bluetooth development
 help / color / mirror / Atom feed
From: Szymon Janc <szymon.janc@tieto.com>
To: <linux-bluetooth@vger.kernel.org>
Cc: Szymon Janc <szymon.janc@gmail.com>
Subject: [PATCH 1/5] android: Start command watch after notify channel is connected
Date: Thu, 24 Oct 2013 10:36:49 +0200	[thread overview]
Message-ID: <1382603813-9157-1-git-send-email-szymon.janc@tieto.com> (raw)

From: Szymon Janc <szymon.janc@gmail.com>

Daemon should start processing commands only after both communication
channels were connected.
---
 android/main.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/android/main.c b/android/main.c
index 9879f05..740b532 100644
--- a/android/main.c
+++ b/android/main.c
@@ -288,9 +288,11 @@ static gboolean notif_connect_cb(GIOChannel *io, GIOCondition cond,
 
 	g_io_add_watch(io, cond, notif_watch_cb, NULL);
 
-	info("Successfully connected to HAL");
+	cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
 
-	/* TODO start handling commands */
+	g_io_add_watch(hal_cmd_io, cond, cmd_watch_cb, NULL);
+
+	info("Successfully connected to HAL");
 
 	return FALSE;
 }
@@ -305,10 +307,6 @@ static gboolean cmd_connect_cb(GIOChannel *io, GIOCondition cond,
 		return FALSE;
 	}
 
-	cond = G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL;
-
-	g_io_add_watch(io, cond, cmd_watch_cb, NULL);
-
 	hal_notif_io = connect_hal(notif_connect_cb);
 	if (!hal_notif_io) {
 		error("Cannot connect to HAL, terminating");
-- 
1.8.4


             reply	other threads:[~2013-10-24  8:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-24  8:36 Szymon Janc [this message]
2013-10-24  8:36 ` [PATCH 2/5] android: Fix bt_adapter_init Szymon Janc
2013-10-24  8:36 ` [PATCH 3/5] android: Remove not needed adapter parameter from bt_adapter_ready Szymon Janc
2013-10-24  8:36 ` [PATCH 4/5] android: Use default adapter in adapter functions Szymon Janc
2013-10-24  8:36 ` [PATCH 5/5] android: Use adapter index in mgmt functions Szymon Janc

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=1382603813-9157-1-git-send-email-szymon.janc@tieto.com \
    --to=szymon.janc@tieto.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=szymon.janc@gmail.com \
    /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