From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Cc: Szymon Janc <szymon.janc@tieto.com>
Subject: [PATCH v2 3/3] android/hal: Register adapter and socket interface on HAL init
Date: Mon, 21 Oct 2013 14:56:51 +0200 [thread overview]
Message-ID: <1382360211-3565-3-git-send-email-szymon.janc@tieto.com> (raw)
In-Reply-To: <1382360211-3565-1-git-send-email-szymon.janc@tieto.com>
After daemon is started HAL needs to register those two interfaces
to performe initialization procedure as described in IPC documentation.
---
android/hal-bluetooth.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index 3d3023f..c1e0261 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -257,6 +257,9 @@ static void stop_daemon(void)
static int init(bt_callbacks_t *callbacks)
{
+ struct hal_msg_cmd_register_module cmd;
+ struct hal_msg_rsp_error rsp;
+
DBG("");
if (interface_ready())
@@ -267,7 +270,27 @@ static int init(bt_callbacks_t *callbacks)
bt_hal_cbacks = callbacks;
+ cmd.service_id = HAL_SERVICE_ID_BLUETOOTH;
+
+ if (hal_send_msg(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE,
+ sizeof(cmd), &cmd,
+ sizeof(rsp), &rsp, NULL) < 0)
+ goto fail;
+
+ cmd.service_id = HAL_SERVICE_ID_SOCK;
+
+ if (hal_send_msg(HAL_SERVICE_ID_CORE, HAL_MSG_OP_REGISTER_MODULE,
+ sizeof(cmd), &cmd,
+ sizeof(rsp), &rsp, NULL) < 0)
+ goto fail;
+
return BT_STATUS_SUCCESS;
+
+fail:
+ stop_daemon();
+ bt_hal_cbacks = NULL;
+ return BT_STATUS_FAIL;
+
}
static int enable(void)
--
1.8.4
next prev parent reply other threads:[~2013-10-21 12:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-21 12:56 [PATCH v2 1/3] android: Add missing error status description for Core Service Szymon Janc
2013-10-21 12:56 ` [PATCH v2 2/3] android/hal: Add initial code for sending commands Szymon Janc
2013-10-21 12:56 ` Szymon Janc [this message]
2013-10-21 13:25 ` [PATCH v2 1/3] android: Add missing error status description for Core Service Johan Hedberg
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=1382360211-3565-3-git-send-email-szymon.janc@tieto.com \
--to=szymon.janc@tieto.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