Linux-Bluetooth Archive on lore.kernel.org
 help / Atom feed
* Bug: no PropertiesChanged signal for org.bluez.Device1.AdvertisingData
@ 2019-01-08 16:03 Arnaud Mouiche
  2019-01-08 16:12 ` Von Dentz, Luiz
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Mouiche @ 2019-01-08 16:03 UTC (permalink / raw)
  To: linux-bluetooth, Luiz Augusto von Dentz

Hello Luiz,

I was playing with latest sources (git) and experimental features 
enabled in order to:
- perform a BLE scan
- find AdvertisingData (in particularly the BT_AD_INDOOR_POSITIONING (0x25))

I found that:
- once scanning is done org.bluez.Device1.AdvertisingData is correctly 
set to the expected value (the one advertised)
- yet, there was no PropertiesChanged signal corresponding to this 
AdvertisingData property update (despite I received PropertiesChanged 
for RSSI)


Indeed src/device.c:: add_data() performs a particular filtering to only 
signal EIR_TRANSPORT_DISCOVERY data.

> static void add_data(void *data, void *user_data)
> {
>     struct eir_ad *ad = data;
>     struct btd_device *dev = user_data;
>
>     if (!bt_ad_add_data(dev->ad, ad->type, ad->data, ad->len))
>         return;
>
>     if (ad->type == EIR_TRANSPORT_DISCOVERY)
>         g_dbus_emit_property_changed(dbus_conn, dev->path,
>                         DEVICE_INTERFACE,
>                         "AdvertisingData");
> }

Is there a particular reason for this behavior ?

Regards,
Arnaud


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug: no PropertiesChanged signal for org.bluez.Device1.AdvertisingData
  2019-01-08 16:03 Bug: no PropertiesChanged signal for org.bluez.Device1.AdvertisingData Arnaud Mouiche
@ 2019-01-08 16:12 ` Von Dentz, Luiz
  2019-01-08 19:00   ` Arnaud Mouiche
  0 siblings, 1 reply; 3+ messages in thread
From: Von Dentz, Luiz @ 2019-01-08 16:12 UTC (permalink / raw)
  To: Arnaud Mouiche; +Cc: linux-bluetooth

Hi Arnaud,

On Tue, Jan 8, 2019 at 1:03 PM Arnaud Mouiche
<arnaud.mouiche@invoxia.com> wrote:
>
> Hello Luiz,
>
> I was playing with latest sources (git) and experimental features
> enabled in order to:
> - perform a BLE scan
> - find AdvertisingData (in particularly the BT_AD_INDOOR_POSITIONING (0x25))
>
> I found that:
> - once scanning is done org.bluez.Device1.AdvertisingData is correctly
> set to the expected value (the one advertised)
> - yet, there was no PropertiesChanged signal corresponding to this
> AdvertisingData property update (despite I received PropertiesChanged
> for RSSI)

Is the Data changing? If you want to get informed of each
advertisement regardless if it has changed you should set
DuplicateData filter:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt#n107

If that doesn't work then perhaps we have a bug somewhere.

>
> Indeed src/device.c:: add_data() performs a particular filtering to only
> signal EIR_TRANSPORT_DISCOVERY data.
>
> > static void add_data(void *data, void *user_data)
> > {
> >     struct eir_ad *ad = data;
> >     struct btd_device *dev = user_data;
> >
> >     if (!bt_ad_add_data(dev->ad, ad->type, ad->data, ad->len))
> >         return;
> >
> >     if (ad->type == EIR_TRANSPORT_DISCOVERY)
> >         g_dbus_emit_property_changed(dbus_conn, dev->path,
> >                         DEVICE_INTERFACE,
> >                         "AdvertisingData");
> > }
>
> Is there a particular reason for this behavior ?

If I recall this is not to spam the bus if we are not actively discovery.

> Regards,
> Arnaud
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bug: no PropertiesChanged signal for org.bluez.Device1.AdvertisingData
  2019-01-08 16:12 ` Von Dentz, Luiz
@ 2019-01-08 19:00   ` Arnaud Mouiche
  0 siblings, 0 replies; 3+ messages in thread
From: Arnaud Mouiche @ 2019-01-08 19:00 UTC (permalink / raw)
  To: Von Dentz, Luiz; +Cc: linux-bluetooth

Hello Luiz,

On 08/01/2019 17:12, Von Dentz, Luiz wrote:
> Hi Arnaud,
>
> On Tue, Jan 8, 2019 at 1:03 PM Arnaud Mouiche
> <arnaud.mouiche@invoxia.com> wrote:
>> Hello Luiz,
>>
>> I was playing with latest sources (git) and experimental features
>> enabled in order to:
>> - perform a BLE scan
>> - find AdvertisingData (in particularly the BT_AD_INDOOR_POSITIONING (0x25))
>>
>> I found that:
>> - once scanning is done org.bluez.Device1.AdvertisingData is correctly
>> set to the expected value (the one advertised)
>> - yet, there was no PropertiesChanged signal corresponding to this
>> AdvertisingData property update (despite I received PropertiesChanged
>> for RSSI)
> Is the Data changing? If you want to get informed of each
> advertisement regardless if it has changed you should set
> DuplicateData filter:
>
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt#n107
>
> If that doesn't work then perhaps we have a bug somewhere.

Yes "duplicate" is true

>
>> Indeed src/device.c:: add_data() performs a particular filtering to only
>> signal EIR_TRANSPORT_DISCOVERY data.
>>
>>> static void add_data(void *data, void *user_data)
>>> {
>>>      struct eir_ad *ad = data;
>>>      struct btd_device *dev = user_data;
>>>
>>>      if (!bt_ad_add_data(dev->ad, ad->type, ad->data, ad->len))
>>>          return;
>>>
>>>      if (ad->type == EIR_TRANSPORT_DISCOVERY)
>>>          g_dbus_emit_property_changed(dbus_conn, dev->path,
>>>                          DEVICE_INTERFACE,
>>>                          "AdvertisingData");
>>> }
>> Is there a particular reason for this behavior ?
> If I recall this is not to spam the bus if we are not actively discovery.

I did some tracing and the "ad->type == EIR_TRANSPORT_DISCOVERY" test is 
the one filtering the property change signal.

Should we set a white/black list for this kind of filtering ? or 
something else... ?

Regards,
Arnaud


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-08 16:03 Bug: no PropertiesChanged signal for org.bluez.Device1.AdvertisingData Arnaud Mouiche
2019-01-08 16:12 ` Von Dentz, Luiz
2019-01-08 19:00   ` Arnaud Mouiche

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox