public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Anderson Lizardo <anderson.lizardo@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Cc: Anderson Lizardo <anderson.lizardo@openbossa.org>
Subject: [PATCH BlueZ] event: Store Class of Device after connection
Date: Tue, 27 Mar 2012 09:06:14 -0400	[thread overview]
Message-ID: <1332853574-26832-1-git-send-email-anderson.lizardo@openbossa.org> (raw)

The Class of Device is usually sent on the EIR returned by the Device
Connected mgmt event. For hciops, the Class of Device is always NULL on
the connection complete event.

The stored Class of Device is used later for Class/Icon device
properties.
---
 src/event.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/event.c b/src/event.c
index 113a2b6..78d2757 100644
--- a/src/event.c
+++ b/src/event.c
@@ -455,6 +455,14 @@ void btd_event_conn_complete(bdaddr_t *local, bdaddr_t *peer, addr_type_t type,
 
 	update_lastused(local, peer);
 
+	if (dev_class != NULL) {
+		uint32_t class = dev_class[0] | (dev_class[1] << 8) |
+							(dev_class[2] << 16);
+
+		if (class != 0)
+			write_remote_class(local, peer, class);
+	}
+
 	device_set_addr_type(device, type);
 
 	adapter_add_connection(adapter, device);
-- 
1.7.5.4


             reply	other threads:[~2012-03-27 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-27 13:06 Anderson Lizardo [this message]
2012-03-28  9:40 ` [PATCH BlueZ] event: Store Class of Device after connection 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=1332853574-26832-1-git-send-email-anderson.lizardo@openbossa.org \
    --to=anderson.lizardo@openbossa.org \
    --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