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

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

 



Hi Hemant,

On Wed, Apr 25, 2012 at 12:34 AM, Hemant Gupta
<hemant.gupta@xxxxxxxxxxxxxx> wrote:
> -       /* FIXME: Get the correct LE addr type (public/random) */
> -       device = device_create(connection, adapter, key, ADDR_TYPE_LE_PUBLIC);
> +       /* Check if address type and space can be parsed properly */
> +       if (sscanf(value, "%d ", &addr_type) == 2)

Are you sure "2" is the correct return value here? The manpage says:

"These functions return the number of input items successfully matched
and assigned [...]"

So I would imagine it should return 1 if addr_type is filled, 0
otherwise. Can you verify this?

(unless sscanf() counts the whitespace as input.)

> +               /* Increment by 2 (address type and space) */
> +               value += 2;
> +
> +       device = device_create(connection, adapter, key, addr_type);
>        if (!device)
>                return;

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