Re: [PATCH 6/6] Support for generating dictionary value of service UUIDs.

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

 



Hi Inga,

On Sat, Jul 31, 2010, Inga Stotland wrote:
> Add service UUIDs from EIR to device properties in "Device Found" signal.
> ---
>  src/adapter.c  |   95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
>  src/adapter.h  |    4 +-
>  src/dbus-hci.c |    6 ++--
>  3 files changed, 97 insertions(+), 8 deletions(-)

A few more coding style issues:

> +	while (len < EIR_DATA_LENGTH) {
> +		uint8_t type = eir_data[1];
> +		uint8_t field_len = eir_data[0];

Add an empty line here (it's almost always a good thing to have after
variable declarations).

> +		if (type == EIR_UUID16_SOME || type == EIR_UUID16_ALL)
> +			count += field_len/2;

Space before and after /

> +		else if (type == EIR_UUID32_SOME || type == EIR_UUID32_ALL)
> +			count += field_len/4;

Same here.

> +		else if (type == EIR_UUID128_SOME || type == EIR_UUID128_ALL)
> +			count += field_len/16;

And here

> +			count = field_len/size;

And here

> +			count = field_len/size;

And here


> +					val32 = (val32<<8) + data[k];

Space before and after <<

> +			count = field_len/size;

Space before and after /

> +					service.value.uuid128.data[k] = data[size-k-1];

Space before and after -

> +	/* Extract UUIDs from extended inquiry response if any*/
> +	if (eir_data != NULL)
> +		uuid_count = get_uuid_count_eir(eir_data);
> +
> +	if (uuid_count > 0) {
> +		uuids = g_new0(char *, uuid_count + 1);
> +		get_uuids_eir(uuids, eir_data);
> +	}
> +

I don't think these two get_uuids_eir and get_uuid_count_eir functions
are really needed. Could you change it to just one function:

char **get_eir_uuids(const uint8_t *eir_data, size_t *count)

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