linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Inga Stotland <ingas@codeaurora.org>
Cc: linux-bluetooth@vger.kernel.org, rshaffer@codeaurora.org,
	marcel@holtmann.org
Subject: Re: [PATCH 6/6] Support for generating dictionary value of service UUIDs.
Date: Tue, 3 Aug 2010 11:36:41 +0300	[thread overview]
Message-ID: <20100803083641.GD5831@jh-x301> (raw)
In-Reply-To: <1280576713-1398-7-git-send-email-ingas@codeaurora.org>

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

      reply	other threads:[~2010-08-03  8:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-31 11:45 [PATCH v5 0/6] Enhanced support for extended inquiry response Inga Stotland
2010-07-31 11:45 ` [PATCH 1/6] Spec constants for Extended Inquiry Response field types Inga Stotland
2010-07-31 11:45 ` [PATCH 2/6] Clean up code that generates extended inquiry response Inga Stotland
2010-08-03  8:12   ` Johan Hedberg
2010-08-03 15:37     ` ingas
2010-08-03 16:26       ` Johan Hedberg
2010-07-31 11:45 ` [PATCH 3/6] Support for adding UUID128 to " Inga Stotland
2010-08-03  8:18   ` Johan Hedberg
2010-07-31 11:45 ` [PATCH 4/6] Fix in logic to write EIR when SDP records are changed Inga Stotland
2010-08-03  8:23   ` Johan Hedberg
2010-07-31 11:45 ` [PATCH 5/6] Handle arrays in device properties dictionary Inga Stotland
2010-07-31 11:45 ` [PATCH 6/6] Support for generating dictionary value of service UUIDs Inga Stotland
2010-08-03  8:36   ` Johan Hedberg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100803083641.GD5831@jh-x301 \
    --to=johan.hedberg@gmail.com \
    --cc=ingas@codeaurora.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=rshaffer@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).