All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinicius Costa Gomes <vinicius.gomes@intel.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ 2/4] doc/gatt-api: Merge RegisterProfile with RegisterApplication
Date: Sat, 07 May 2016 17:15:53 -0300	[thread overview]
Message-ID: <87posxei9y.fsf@intel.com> (raw)
In-Reply-To: <1462561862-500-2-git-send-email-luiz.dentz@gmail.com>

Hi Luiz,

Luiz Augusto von Dentz <luiz.dentz@gmail.com> writes:

> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> Since RegisterApplication makes use of ObjectManager it is also possible
> to verify the existance of GattProfile objects unifying the API for both
> services (GATT server) and profiles (GATT client).
> ---

Just cosmetic stuff.

>  doc/gatt-api.txt    |  37 ++---
>  src/gatt-database.c | 414 +++++++++++++++++++++-------------------------------
>  2 files changed, 172 insertions(+), 279 deletions(-)
>
> diff --git a/doc/gatt-api.txt b/doc/gatt-api.txt
> index 683b1b7..9404986 100644
> --- a/doc/gatt-api.txt
> +++ b/doc/gatt-api.txt
> @@ -218,8 +218,8 @@ Properties	string UUID [read-only]
>  				"encrypt-authenticated-read"
>  				"encrypt-authenticated-write"
>

[...]

> +static void add_profile(void *data, void *user_data)
> +{
> +	struct btd_adapter *adapter = user_data;
> +
> +	btd_profile_register(data);
> +	adapter_add_profile(adapter, data);
> +}
> +
> +static struct external_profile *create_profile(struct gatt_app *app,
> +						GDBusProxy *proxy,
> +						const char *path)
> +

Extra empty line.

> +{
> +	struct external_profile *profile;
> +	DBusMessageIter iter, array;
> +
> +	if (!path || !g_str_has_prefix(path, "/"))
> +		return NULL;
> +
> +	profile = new0(struct external_profile, 1);
> +
> +	profile->app = app;
> +	profile->proxy = g_dbus_proxy_ref(proxy);
> +	profile->profiles = queue_new();
> +
> +	if (!g_dbus_proxy_get_property(proxy, "UUIDs", &iter)) {
> +		DBG("UUIDs property not found");
> +		goto fail;
> +	}
> +
> +	dbus_message_iter_recurse(&iter, &array);
> +
> +	while (dbus_message_iter_get_arg_type(&array) == DBUS_TYPE_STRING) {
> +		const char *uuid;
> +
> +		dbus_message_iter_get_basic(&array, &uuid);
> +
> +		if (profile_add(profile, uuid) < 0)
> +			goto fail;
> +
> +		dbus_message_iter_next(&array);
> +	}
> +
> +	if (queue_isempty(profile->profiles))
> +		goto fail;
> +
> +	queue_foreach(profile->profiles, add_profile, app->database->adapter);
> +	queue_push_tail(app->profiles, profile);
> +
> +	return profile;
> +
> +fail:
> +	profile_free(profile);
> +	return NULL;
> +}
> +


Cheers,
--
Vinicius

  reply	other threads:[~2016-05-07 20:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 19:10 [PATCH BlueZ 1/4] doc/gatt-api: Add options dictionary to ReadValue/WriteValue Luiz Augusto von Dentz
2016-05-06 19:11 ` [PATCH BlueZ 2/4] doc/gatt-api: Merge RegisterProfile with RegisterApplication Luiz Augusto von Dentz
2016-05-07 20:15   ` Vinicius Costa Gomes [this message]
2016-05-06 19:11 ` [PATCH BlueZ 3/4] doc/gatt-api: Add secure flags Luiz Augusto von Dentz
2016-05-06 19:11 ` [PATCH BlueZ 4/4] test: Update GATT examples with the new API Luiz Augusto von Dentz
2016-05-06 22:18 ` [PATCH BlueZ 1/4] doc/gatt-api: Add options dictionary to ReadValue/WriteValue Vinicius Costa Gomes
2016-05-07  7:21   ` Luiz Augusto von Dentz
2016-05-07 19:57     ` Vinicius Costa Gomes
2016-05-08 13:54       ` Luiz Augusto von Dentz
2016-05-07 20:08 ` Vinicius Costa Gomes
2016-05-08 13:52   ` 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=87posxei9y.fsf@intel.com \
    --to=vinicius.gomes@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.