Re: [PATCH] Add UUID property to GATT service object

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

 



Hi Elvis,

On Fri, Feb 04, 2011, Elvis Pf??tzenreuter wrote:
> @@ -962,6 +963,10 @@ static DBusMessage *prim_get_properties(DBusConnection *conn, DBusMessage *msg,
>  
>  	dict_append_array(&dict, "Characteristics", DBUS_TYPE_OBJECT_PATH,
>  								&chars, i);
> +	uuid = g_strdup(prim->att->uuid);
> +	dict_append_entry(&dict, "UUID", DBUS_TYPE_STRING, &uuid);
> +
> +	g_free(uuid);
>  	g_free(chars);
>  
>  	dbus_message_iter_close_container(&iter, &dict);

I'd rather avoid the unnecessary memory allocation here. The following
should be enough:

const char *uuid;
...
uuid = prim->att->uuid;
dict_append_entry(..., DBUS_TYPE_STRING, &uuid);

Johan
--
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