Re: [PATCH BlueZ 2/4] doc/gatt-api: Merge RegisterProfile with RegisterApplication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

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

> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>
> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux