Re: [RFC BlueZ v0 08/13] dbus: Add state property to org.bluez.Service1

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

 



Hi Luiz,

On Mon, May 6, 2013 at 12:00 PM, Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
> Hi Mikel,
>
> On Mon, May 6, 2013 at 11:43 AM, Mikel Astiz <mikel.astiz.oss@xxxxxxxxx> wrote:
>> +static gboolean service_get_state(const GDBusPropertyTable *property,
>> +                                       DBusMessageIter *iter, void *data)
>> +{
>> +       struct btd_service *service = data;
>> +       const char *str;
>> +
>> +       str = state2dbus(service->state);
>> +
>> +       dbus_message_iter_append_basic(iter, DBUS_TYPE_STRING, &str);
>
> The code about would break if state2dbus returns NULL for
> BTD_SERVICE_STATE_UNAVAILABLE, perhaps if service is unavailable it
> should not have an object path representing it?

That's exactly the case. The service is exposed in D-Bus only while
it's *not* unavailable, i.e. it's probed and usable.

The code already implements this behavior but if it's not clear enough
we could make it more explicit by adding assertions here and there.

Cheers,
Mikel
--
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