From: Gowtham Anandha Babu <gowtham.ab@samsung.com>
To: 'Luiz Augusto von Dentz' <luiz.dentz@gmail.com>,
linux-bluetooth@vger.kernel.org
Subject: RE: [PATCH BlueZ 12/12] client: Handle attribute notifications
Date: Mon, 09 Feb 2015 17:11:50 +0530 [thread overview]
Message-ID: <002f01d0445d$73759f40$5a60ddc0$@samsung.com> (raw)
In-Reply-To: <1423220624-18861-13-git-send-email-luiz.dentz@gmail.com>
Hi Luiz,
> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Luiz Augusto von Dentz
> Sent: Friday, February 06, 2015 4:34 PM
> To: linux-bluetooth@vger.kernel.org
> Subject: [PATCH BlueZ 12/12] client: Handle attribute notifications
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> This enable printing properties changes to the current selected attribute.
> ---
> client/main.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/client/main.c b/client/main.c index 57b1201..fbfd8c8 100644
> --- a/client/main.c
> +++ b/client/main.c
> @@ -158,6 +158,7 @@ static void print_iter(const char *label, const char
> *name,
> dbus_uint32_t valu32;
> dbus_uint16_t valu16;
> dbus_int16_t vals16;
> + unsigned char byte;
> const char *valstr;
> DBusMessageIter subiter;
>
> @@ -192,6 +193,10 @@ static void print_iter(const char *label, const char
> *name,
> dbus_message_iter_get_basic(iter, &vals16);
> rl_printf("%s%s: %d\n", label, name, vals16);
> break;
> + case DBUS_TYPE_BYTE:
> + dbus_message_iter_get_basic(iter, &byte);
> + rl_printf("%s%s: 0x%02x\n", label, name, byte);
> + break;
> case DBUS_TYPE_VARIANT:
> dbus_message_iter_recurse(iter, &subiter);
> print_iter(label, name, &subiter);
> @@ -494,6 +499,14 @@ static void property_changed(GDBusProxy *proxy,
> const char *name,
>
> print_iter(str, name, iter);
> g_free(str);
> + } else if (proxy == default_attr) {
> + char *str;
> +
> + str = g_strdup_printf("[" COLORED_CHG "] Attribute %s ",
> +
> g_dbus_proxy_get_path(proxy));
> +
> + print_iter(str, name, iter);
Here I suppose, g_free(str) should come. Because the returned string (str)
should be freed when no longer needed.
And str = g_strdup(""); seems like Dead assignment. Other than that
everything applied cleanly with no warnings/errors.
Regards,
Gowtham Anandha Babu
> + str = g_strdup("");
> }
> }
>
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth"
in
> the body of a message to majordomo@vger.kernel.org More majordomo
> info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2015-02-09 11:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-06 11:03 [PATCH BlueZ 00/12] client: Add support for GATT API Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 01/12] client: Add support for GattService1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 02/12] client: Add support for GattCharacteristic1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 03/12] client: Add support for GattDescriptor1 Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 04/12] client: Make commands relative to device Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 05/12] client: Add command list-attributes Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 06/12] client: Add command select-attribute Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 07/12] client: Add attribute-info command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 08/12] client/display: Add rl_hexdump Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 09/12] client: Add read command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 10/12] client: Add write command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 11/12] client: Add notify command Luiz Augusto von Dentz
2015-02-06 11:03 ` [PATCH BlueZ 12/12] client: Handle attribute notifications Luiz Augusto von Dentz
2015-02-09 11:41 ` Gowtham Anandha Babu [this message]
2015-02-09 13:14 ` Luiz Augusto von Dentz
2015-02-10 11:42 ` [PATCH BlueZ 00/12] client: Add support for GATT API Luiz Augusto von Dentz
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='002f01d0445d$73759f40$5a60ddc0$@samsung.com' \
--to=gowtham.ab@samsung.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
/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