All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] event: Store Class of Device after connection
@ 2012-03-27 13:06 Anderson Lizardo
  2012-03-28  9:40 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Anderson Lizardo @ 2012-03-27 13:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Anderson Lizardo

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] event: Store Class of Device after connection
  2012-03-27 13:06 [PATCH BlueZ] event: Store Class of Device after connection Anderson Lizardo
@ 2012-03-28  9:40 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2012-03-28  9:40 UTC (permalink / raw)
  To: Anderson Lizardo; +Cc: linux-bluetooth

Hi Lizardo,

On Tue, Mar 27, 2012, Anderson Lizardo wrote:
> 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(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-28  9:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 13:06 [PATCH BlueZ] event: Store Class of Device after connection Anderson Lizardo
2012-03-28  9:40 ` Johan Hedberg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.