From: Johan Hedberg <johan.hedberg@gmail.com>
To: chen.ganir@ti.com
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH v4] gatt: Translate Characteristic names
Date: Mon, 3 Sep 2012 15:59:40 +0300 [thread overview]
Message-ID: <20120903125940.GA942@x220> (raw)
In-Reply-To: <1346671769-10072-1-git-send-email-chen.ganir@ti.com>
Hi Chen,
On Mon, Sep 03, 2012, chen.ganir@ti.com wrote:
> +static const struct characteristic_info charInfo[] = {
Only lower-case symbol names please, i.e. char_info[].
> +static const char *get_char_name(const char *uuid)
> +{
> + const struct characteristic_info *c;
> +
> + for (c = charInfo; c->uuid; c++) {
> + if (g_strcmp0(c->uuid, uuid) == 0)
Since these strings are in hexadecimal format you'd need to check both
lower and upper case characters. So probably strcasecmp is best (you
should anyway have a guarantee that both c->uuid and uuid are non-NULL).
You could also use bt_uuid_strcmp from lib/uuid.h which was recently
added to help g_slist_find_custom and similar situations.
> + if (name != NULL)
> + dict_append_entry(&dict, "Name", DBUS_TYPE_STRING, &name);
"if (name)" would be more consistent with the rest of the code, such as
the lines coming right after it:
> if (chr->desc)
> dict_append_entry(&dict, "Description", DBUS_TYPE_STRING,
Johan
prev parent reply other threads:[~2012-09-03 12:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-03 11:29 [PATCH v4] gatt: Translate Characteristic names chen.ganir
2012-09-03 12:59 ` Johan Hedberg [this message]
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=20120903125940.GA942@x220 \
--to=johan.hedberg@gmail.com \
--cc=chen.ganir@ti.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).