From: Johan Hedberg <johan.hedberg@gmail.com>
To: Andrzej Kaczmarek <andrzej.kaczmarek@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v6 08/13] heartrate: Add support to enable notifications
Date: Fri, 21 Sep 2012 16:42:00 +0300 [thread overview]
Message-ID: <20120921134200.GC16944@x220> (raw)
In-Reply-To: <1348139690-26985-9-git-send-email-andrzej.kaczmarek@tieto.com>
Hi Andrzej,
On Thu, Sep 20, 2012, Andrzej Kaczmarek wrote:
> @@ -238,6 +249,18 @@ static void discover_ccc_cb(guint8 status, const guint8 *pdu,
>
> if (uuid == GATT_CLIENT_CHARAC_CFG_UUID) {
> hr->measurement_ccc_handle = handle;
> +
> + if (g_slist_length(hr->hradapter->watchers) > 0) {
> + uint8_t value[2];
> + char *msg;
> +
> + att_put_u16(GATT_CLIENT_CHARAC_CFG_NOTIF_BIT,
> + value);
> + msg = g_strdup("Enable measurement");
> +
> + gatt_write_char(hr->attrib, handle, value,
> + sizeof(value), char_write_cb, msg);
> + }
> break;
> }
Seems like you could avoid the extra indentation above by inverting the
g_slist_length test:
if (g_slist_length(hr->hradapter->watchers) == 0)
break;
...
break;
> g_dbus_remove_watch(conn, watcher->id);
> +
> +
> + if (g_slist_length(hradapter->watchers) == 0)
Two consecutive empty lines should never be needed. Please remove one.
Johan
next prev parent reply other threads:[~2012-09-21 13:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 11:14 [PATCH v6 00/13] Heart Rate Profile plugin Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 01/13] Heart Rate Profile (HRP) client API Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 02/13] heartrate: Add initial HRP client support Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 03/13] heartrate: Add attio callbacks Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 04/13] heartrate: Discover HRS characteristics Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 05/13] heartrate: Discover Heart Rate Measurement CCC Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 06/13] heartrate: Read Body Sensor Location characteristics Andrzej Kaczmarek
2012-09-21 13:35 ` Johan Hedberg
2012-09-20 11:14 ` [PATCH v6 07/13] heartrate: Add HeartRateManager interface Andrzej Kaczmarek
2012-09-21 13:39 ` Johan Hedberg
2012-09-20 11:14 ` [PATCH v6 08/13] heartrate: Add support to enable notifications Andrzej Kaczmarek
2012-09-21 13:42 ` Johan Hedberg [this message]
2012-09-20 11:14 ` [PATCH v6 09/13] heartrate: Process measurement notifications Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 10/13] heartrate: Add support to reset Energy Expended Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 11/13] heartrate: Add GetProperties method Andrzej Kaczmarek
2012-09-21 13:45 ` Johan Hedberg
2012-09-20 11:14 ` [PATCH v6 12/13] heartrate: Add HeartRateWatcher interface to default policy Andrzej Kaczmarek
2012-09-20 11:14 ` [PATCH v6 13/13] heartrate: Add test script Andrzej Kaczmarek
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=20120921134200.GC16944@x220 \
--to=johan.hedberg@gmail.com \
--cc=andrzej.kaczmarek@tieto.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;
as well as URLs for NNTP newsgroup(s).