Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH 1/2] Change Battery Service on attribute sample server
@ 2010-10-06 20:39 Claudio Takahasi
  2010-10-06 20:39 ` [PATCH 2/2] Client Characteristic Configuration on attribute server Claudio Takahasi
  2010-10-06 21:40 ` [PATCH 1/2] Change Battery Service on attribute sample server Johan Hedberg
  0 siblings, 2 replies; 5+ messages in thread
From: Claudio Takahasi @ 2010-10-06 20:39 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

Add an optional Client Characteristic Configuration attribute for
Battery State to control which clients want notification/indication
when this attribute value changes.
---
 attrib/example.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/attrib/example.c b/attrib/example.c
index 76afce9..c29e1e4 100644
--- a/attrib/example.c
+++ b/attrib/example.c
@@ -161,10 +161,15 @@ static int register_attributes(void)
 
 	/* Battery: battery state attribute */
 	sdp_uuid16_create(&uuid, BATTERY_STATE_UUID);
-	u16 = htons(BATTERY_STATE_UUID);
 	atval[0] = 0x04;
 	attrib_db_add(0x0110, &uuid, atval, 1);
 
+	/* Battery: Client Characteristic Configuration */
+	sdp_uuid16_create(&uuid, GATT_CLIENT_CHARAC_CFG_UUID);
+	atval[0] = 0x00;
+	atval[1] = 0x00;
+	attrib_db_add(0x0111, &uuid, atval, 2);
+
 	timeout_id = g_timeout_add_seconds(10, change_battery_state, NULL);
 
 	/* Thermometer: primary service definition */
-- 
1.7.3.1


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

end of thread, other threads:[~2010-10-07 13:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-06 20:39 [PATCH 1/2] Change Battery Service on attribute sample server Claudio Takahasi
2010-10-06 20:39 ` [PATCH 2/2] Client Characteristic Configuration on attribute server Claudio Takahasi
2010-10-06 21:43   ` Johan Hedberg
2010-10-07 13:50     ` Claudio Takahasi
2010-10-06 21:40 ` [PATCH 1/2] Change Battery Service on attribute sample server Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox