All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bartosz Szatkowski <bulislaw@linux.com>
To: Bartosz Szatkowski <bulislaw@linux.com>, linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/3] Add SetRemoteProperties method for OOB COD setting
Date: Mon, 22 Aug 2011 10:12:11 +0200	[thread overview]
Message-ID: <CAPGrrxUDgQOzX7zgHy28dxux3LkRy4Ap=dtuGZJSYPovNqELBg@mail.gmail.com> (raw)
In-Reply-To: <20110822072228.GA31063@dell>

On Mon, Aug 22, 2011 at 9:22 AM, Johan Hedberg <johan.hedberg@gmail.com> wrote:
> Hi Bartosz,
>
> On Fri, Aug 12, 2011, Bartosz Szatkowski wrote:
>> +struct oob_remote_parameters {
>> +     bdaddr_t local;
>> +     bdaddr_t peer;
>> +     const char *address;
>> +     uint32_t class;
>> +};
>
> Could you add a "gboolean device_found;" to this struct and then use it
> as follows:

OK

>
>> +static DBusMessage *parse_class(DBusMessageIter *value,
>> +                     struct oob_remote_parameters *params, DBusMessage *msg)
>> +{
>> +     if (dbus_message_iter_get_arg_type(value) != DBUS_TYPE_UINT32)
>> +             return btd_error_invalid_args(msg);
>> +
>> +     dbus_message_iter_get_basic(value, &params->class);
>
>        params->device_found = TRUE;

I would move (above) line to set_class function (and same for other
patches) as there is no point of emiting device_found in case of some
error when trying to set it, it would look something like:

static void set_class(struct oob_remote_parameters *params)
+{
+	if (write_remote_class(&params->local, &params->peer,
+							params->class) < 0) {
+		error("Setting device class failed");
+
+		return;
+	}

        params->device_found = TRUE;
+}


-- 
Pozdrowienia,
Bartosz Szatkowski

      reply	other threads:[~2011-08-22  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-11 11:14 [PATCH BlueZ 1/3] Add SetRemoteProperties method for OOB COD setting Bartosz Szatkowski
2011-08-11 11:14 ` [PATCH BlueZ 2/3] Add support for OOB data in SetRemoteProperties Bartosz Szatkowski
2011-08-11 11:14 ` [PATCH BlueZ 3/3] Add support for name in OOB SetRemoteProperties Bartosz Szatkowski
2011-08-11 16:51 ` [PATCH BlueZ 1/3] Add SetRemoteProperties method for OOB COD setting Vinicius Costa Gomes
2011-08-11 19:16   ` Bartosz Szatkowski
2011-08-12  7:15     ` [PATCH " Bartosz Szatkowski
2011-08-22  7:22       ` Johan Hedberg
2011-08-22  8:12         ` Bartosz Szatkowski [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='CAPGrrxUDgQOzX7zgHy28dxux3LkRy4Ap=dtuGZJSYPovNqELBg@mail.gmail.com' \
    --to=bulislaw@linux.com \
    --cc=linux-bluetooth@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.