Re: [RFC 1/2] Add Type property to Device

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

 



Hi Marcel/Johan/Luiz,

We need opinions for this change...

Why this information is needed: Appearance characteristic is not
available in the advertising. Currently, BlueZ implements interleaved
discovery: 5.12sec inquiring + 5.12sec scanning.
Found devices are reported through the DeviceFound() signal. The user
space needs to check the "Broadcaster" property inside the DeviceFound
signal to check if the device is Basic Rate or LE, which is not
acceptable(in my opinion). We need a meaningful property to
distinguish LE devices.

Before we push these patches upstream we need to define which
information it exposes: Operational Mode or host/controller
capability?

My opinion:
1. for the Adapter it should represent the operational mode, a
controller can support LE, but the host can disable it. Setting
EnableLE = false(main.conf) should "disable" LE functionalities.
2. for DeviceFound(), the UI needs this info only to distinguish LE
devices. In my opinion UUIDs and Broadcaster properties are not
enough/appropriated for this purpose. "Qualified" devices will not
enable inquiry scan and advertising at same time. Our main target is
to connect to LE only devices. "BR/EDR/LE" can be confusing in this
context. Suggestions here?
3. for the Device, I am not sure if we need to expose this information
to the users, appearance characteristic is mandatory, if a Device
"object" exists in the system the appearance value will be
available(it will be retrieved after discovery primary services)

Comments?

Andre:
You need to check the adapter features, old adapters doesn't support EDR.

Claudio.

On Wed, Mar 30, 2011 at 6:33 PM, Andre Dieb Martins
<andre.dieb@xxxxxxxxxxx> wrote:
> ---
> Âdoc/device-api.txt | Â Â4 ++++
> Âsrc/device.c    |  18 ++++++++++++++++++
> Âsrc/device.h    |  Â2 ++
> Â3 files changed, 24 insertions(+), 0 deletions(-)
>
> diff --git a/doc/device-api.txt b/doc/device-api.txt
> index d1feb18..a667296 100644
> --- a/doc/device-api.txt
> +++ b/doc/device-api.txt
> @@ -130,6 +130,10 @@ Properties string Address [readonly]
> Â Â Â Â Â Â Â Â Â Â Â ÂProposed icon name according to the freedesktop.org
> Â Â Â Â Â Â Â Â Â Â Â Âicon naming specification.
>
> + Â Â Â Â Â Â Â string Type [readonly]
> +
> + Â Â Â Â Â Â Â Â Â Â Â Device type (BR/EDR, LE, BR/EDR/LE).
> +
> Â Â Â Â Â Â Â Âuint32 Class [readonly]
>
> Â Â Â Â Â Â Â Â Â Â Â ÂThe Bluetooth class of device of the remote device.
> diff --git a/src/device.c b/src/device.c
> index d567952..96683de 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -228,6 +228,20 @@ static void device_free(gpointer user_data)
> Â Â Â Âg_free(device);
> Â}
>
> +const char *devtype2str(device_type_t type)

If the plan is to use the same type(device_type_t) for devices and
adapters we should rename this type.


> +{
> + Â Â Â switch (type) {
> + Â Â Â case DEVICE_TYPE_BREDR:
> + Â Â Â Â Â Â Â return "BR/EDR";
> + Â Â Â case DEVICE_TYPE_LE:
> + Â Â Â Â Â Â Â return "LE";
> + Â Â Â case DEVICE_TYPE_DUALMODE:
> + Â Â Â Â Â Â Â return "BR/EDR/LE";
> + Â Â Â default:
> + Â Â Â Â Â Â Â return "Unknown";
> + Â Â Â }
> +}
> +
> Âgboolean device_is_paired(struct btd_device *device)
> Â{
> Â Â Â Âreturn device->paired;
> @@ -302,6 +316,10 @@ static DBusMessage *get_properties(DBusConnection *conn,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â ÂDBUS_TYPE_STRING, &icon);
> Â Â Â Â}
>
> + Â Â Â /* Type */
> + Â Â Â ptr = devtype2str(device->type);
> + Â Â Â dict_append_entry(&dict, "Type", DBUS_TYPE_STRING, &ptr);
> +
> Â Â Â Â/* Paired */
> Â Â Â Âboolean = device_is_paired(device);
> Â Â Â Âdict_append_entry(&dict, "Paired", DBUS_TYPE_BOOLEAN, &boolean);
> diff --git a/src/device.h b/src/device.h
> index 3ce212b..b385070 100644
> --- a/src/device.h
> +++ b/src/device.h
> @@ -41,6 +41,8 @@ typedef enum {
> Â Â Â ÂDEVICE_TYPE_DUALMODE
> Â} device_type_t;
>
> +const char *devtype2str(device_type_t type);
> +
> Âstruct btd_device *device_create(DBusConnection *conn,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âstruct btd_adapter *adapter,
> Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âconst gchar *address, device_type_t type);
> --
> 1.7.1
>
> --
> 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
>
--
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