Return-Path: From: Andrzej Kaczmarek To: CC: Rafal Garbat Subject: [PATCH v4 05/17] heartrate: Process characteristics Date: Thu, 13 Sep 2012 14:13:09 +0200 Message-ID: <1347538401-6417-6-git-send-email-andrzej.kaczmarek@tieto.com> In-Reply-To: <1347538401-6417-1-git-send-email-andrzej.kaczmarek@tieto.com> References: <1347538401-6417-1-git-send-email-andrzej.kaczmarek@tieto.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-bluetooth-owner@vger.kernel.org List-ID: From: Rafal Garbat This patch adds stub to process discovered characteristics. Change-Id: I983c942a33668e86fa73453a7649295bc0c032b6 --- lib/uuid.h | 2 ++ profiles/heartrate/heartrate.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/uuid.h b/lib/uuid.h index 3488e66..0a9db51 100644 --- a/lib/uuid.h +++ b/lib/uuid.h @@ -64,6 +64,8 @@ extern "C" { #define SAP_UUID "0000112D-0000-1000-8000-00805f9b34fb" #define HEART_RATE_UUID "0000180d-0000-1000-8000-00805f9b34fb" +#define HEART_RATE_CONTROL_POINT_UUID "00002a39-0000-1000-8000-00805f9b34fb" +#define BODY_SENSOR_LOCATION_UUID "00002a38-0000-1000-8000-00805f9b34fb" #define HEALTH_THERMOMETER_UUID "00001809-0000-1000-8000-00805f9b34fb" #define TEMPERATURE_MEASUREMENT_UUID "00002a1c-0000-1000-8000-00805f9b34fb" diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c index 140a2fb..3d918e9 100644 --- a/profiles/heartrate/heartrate.c +++ b/profiles/heartrate/heartrate.c @@ -120,6 +120,14 @@ static void destroy_heartrate_adapter(gpointer user_data) g_free(hr); } +static void process_heartrate_char(struct characteristic *ch) +{ + if (g_strcmp0(ch->attr.uuid, HEART_RATE_CONTROL_POINT_UUID) == 0) + DBG("Heart Rate Control Point supported by client"); + else if (g_strcmp0(ch->attr.uuid, BODY_SENSOR_LOCATION_UUID) == 0) + DBG("Body Sensor Location supported by client"); +} + static void configure_heartrate_cb(GSList *characteristics, guint8 status, gpointer user_data) { @@ -144,6 +152,8 @@ static void configure_heartrate_cb(GSList *characteristics, guint8 status, ch->hrdev = hrdev; hrdev->chars = g_slist_append(hrdev->chars, ch); + + process_heartrate_char(ch); } } -- 1.7.11.3