Re: [PATCH BlueZ v1 04/10] gatt: Add storing Appearance

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

 



Hi Claudio,

On Thu, Aug 16, 2012, Claudio Takahasi wrote:
> This patch stores the Appearance characteristic value read from the
> remote GAP service.
> ---
>  profiles/gatt/gas.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
> index 2fb12ce..bf603e8 100644
> --- a/profiles/gatt/gas.c
> +++ b/profiles/gatt/gas.c
> @@ -68,8 +68,11 @@ static gint cmp_device(gconstpointer a, gconstpointer b)
>  static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen,
>  							gpointer user_data)
>  {
> +	struct gas *gas = user_data;
>  	struct att_data_list *list =  NULL;
> +	bdaddr_t src, dst;
>  	uint16_t app;
> +	uint8_t type;
>  	uint8_t *atval;
>  
>  	if (status != 0) {
> @@ -92,6 +95,11 @@ static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen,
>  
>  	DBG("GAP Appearance: 0x%04x", app);
>  
> +	adapter_get_address(device_get_adapter(gas->device), &src);
> +	device_get_address(gas->device, &dst, &type);
> +
> +	write_remote_appearance(&src, &dst, type, app);

I'm not so sure it's a good idea to have plugins use the storage
functions directly. Instead I'd put this into the device_set_appearance
function which you add later in this patch set. If there really is a
need to access storage functions from within plugins (which there isn't
for this particular case) then we need to prefix all of the storage
functions with btd_* since those are the only types of symbols that
should be exported from the core daemon to plugins.

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