Linux bluetooth development
 help / color / mirror / Atom feed
From: Andrei Emeltchenko <Andrei.Emeltchenko.news@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC 3/6] android/hal: Handle acl_state_changed event
Date: Fri,  1 Nov 2013 13:30:15 +0200	[thread overview]
Message-ID: <1383305418-13619-3-git-send-email-Andrei.Emeltchenko.news@gmail.com> (raw)
In-Reply-To: <1383305418-13619-1-git-send-email-Andrei.Emeltchenko.news@gmail.com>

From: Andrei Emeltchenko <andrei.emeltchenko@intel.com>

---
 android/hal-bluetooth.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/android/hal-bluetooth.c b/android/hal-bluetooth.c
index a0ee844..91c5f97 100644
--- a/android/hal-bluetooth.c
+++ b/android/hal-bluetooth.c
@@ -254,6 +254,18 @@ static void handle_device_state_changed(void *buf, uint16_t len)
 	device_hal_props_cleanup(props, ev->num_props);
 }
 
+static void handle_acl_state_changed(void *buf)
+{
+	struct hal_ev_acl_state_changed *ev = buf;
+	bt_bdaddr_t *addr = (bt_bdaddr_t *) ev->bdaddr;
+
+	DBG("state %u", ev->state);
+
+	if (bt_hal_cbacks->acl_state_changed_cb)
+		bt_hal_cbacks->acl_state_changed_cb(ev->status, addr,
+								ev->state);
+}
+
 /* will be called from notification thread context */
 void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len)
 {
@@ -287,6 +299,9 @@ void bt_notify_adapter(uint16_t opcode, void *buf, uint16_t len)
 	case HAL_EV_SSP_REQUEST:
 		handle_ssp_request(buf);
 		break;
+	case HAL_EV_ACL_STATE_CHANGED:
+		handle_acl_state_changed(buf);
+		break;
 	default:
 		DBG("Unhandled callback opcode=0x%x", opcode);
 		break;
-- 
1.7.10.4


  parent reply	other threads:[~2013-11-01 11:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-01 11:30 [RFC 1/6] android/daemon: Implement mgmt device connected event Andrei Emeltchenko
2013-11-01 11:30 ` [RFC 2/6] android/ipc: Update HAL IPC header Andrei Emeltchenko
2013-11-01 11:30 ` Andrei Emeltchenko [this message]
2013-11-01 11:30 ` [RFC 4/6] android/daemon: Add handlers for auth_failed and connect_failed evt Andrei Emeltchenko
2013-11-01 11:30 ` [RFC 5/6] android/hal: Add debug prints for every HAL callback Andrei Emeltchenko
2013-11-01 11:30 ` [RFC 6/6] android/daemon: Add handler for device disconnected Andrei Emeltchenko
2013-11-01 12:06 ` [RFC 1/6] android/daemon: Implement mgmt device connected event 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=1383305418-13619-3-git-send-email-Andrei.Emeltchenko.news@gmail.com \
    --to=andrei.emeltchenko.news@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