On Mon, Aug 22, 2011 at 9:22 AM, Johan Hedberg <johan.hedberg@xxxxxxxxx> 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, ¶ms->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(¶ms->local, ¶ms->peer, + params->class) < 0) { + error("Setting device class failed"); + + return; + } params->device_found = TRUE; +} -- Pozdrowienia, Bartosz Szatkowski -- 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