Re: [PATCH BlueZ] Store LE device address type with primary list

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

 



Hi Hemant,

On Thu, Apr 19, 2012 at 7:48 AM, Hemant Gupta
<hemant.gupta@xxxxxxxxxxxxxx> wrote:
> @@ -1920,13 +1920,17 @@ static void create_stored_device_from_primary(char *key, char *value,
>        struct btd_adapter *adapter = user_data;
>        struct btd_device *device;
>        GSList *services, *uuids, *l;
> +       addr_type_t addr_type;
>
>        if (g_slist_find_custom(adapter->devices,
>                        key, (GCompareFunc) device_address_cmp))
>                return;
>
> -       /* FIXME: Get the correct LE addr type (public/random) */
> -       device = device_create(connection, adapter, key, ADDR_TYPE_LE_PUBLIC);
> +       sscanf(value, "%d ", &addr_type);
> +       /* Increment by 2 (address type and space) */
> +       value += 2;

I think it is a good idea to check for sscanf() return and if it
fails, assume addr_type as ADDR_TYPE_LE_PUBLIC the value as primary
data only. Remember that the system may have previously stored primary
data in the old format.

> +
> +       device = device_create(connection, adapter, key, addr_type);
>        if (!device)
>                return;
>


Are you planning to add support for other address types in BlueZ GATT
server? It would be nice if you could share your plans on this topic.


Best Regards,
-- 
Anderson Lizardo
Instituto Nokia de Tecnologia - INdT
Manaus - Brazil
--
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