linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Unreliable LE advertisement registration through BlueZ advertising API
@ 2015-06-25 18:12 Othman, Ossama
  2015-06-25 18:18 ` Tedd Ho-Jeong An
  0 siblings, 1 reply; 9+ messages in thread
From: Othman, Ossama @ 2015-06-25 18:12 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

I'm trying to leverage the LE advertising API in BlueZ 5.31 but
advertisement registration sometimes fails with an Invalid Parameters
error:

Jun 24 21:56:06 orion bluetoothd[21940]:
src/advertising.c:register_advertisement() RegisterAdvertisement
Jun 24 21:56:06 orion bluetoothd[21940]:
src/advertising.c:advertisement_create() Adding proxy for
/org/iotivity/gatt/advertisement0
Jun 24 21:56:06 orion bluetoothd[21940]:
src/advertising.c:register_advertisement() Registered advertisement at
path /org/iotivity/gatt/advertisement0
Jun 24 21:56:06 orion bluetoothd[21940]:
src/advertising.c:parse_advertising_service_uuids() Adding
ServiceUUID: ADE3D529-C784-4F63-A987-EB69F70EE816
Jun 24 21:56:06 orion bluetoothd[21940]:
src/advertising.c:refresh_advertisement() Refreshing advertisement:
/org/iotivity/gatt/advertisement0
Jun 24 21:56:06 orion bluetoothd[21940]: Failed to add advertisement:
Invalid Parameters (0x0d)

It looks like my LEAdvertisement1 object itself is fine since BlueZ
doesn't complain about it. There are times when registration succeeds,
as well.

Adding an advertisement with the same data through the btmgmt tool
will fail in the same way if I provide a bogus instance ID:

[mgmt]# add-adv -c -g -u ADE3D529-C784-4F63-A987-EB69F70EE816 0
Add Advertising failed with status 0x0d (Invalid Parameters)

but is fine if I provide a suitable instance ID:

[mgmt]# add-adv -c -g -u ADE3D529-C784-4F63-A987-EB69F70EE816 1
Instance added: 1

As a sanity check I ran test/example-advertisement but it fails for
other reasons:

$ ./example-advertisement
Failed to register advertisement: org.bluez.Error.Failed: Failed to
parse advertisement

The log output
Jun 25 11:04:43 void-dev bluetoothd[758]:
src/advertising.c:register_advertisement()
RegisterAdvertisement
Jun 25 11:04:43 void-dev bluetoothd[758]:
src/advertising.c:advertisement_create() Adding proxy for
/org/bluez/example/advertisement0
Jun 25 11:04:43 void-dev bluetoothd[758]:
src/advertising.c:register_advertisement() Registered advertisement at
path /org/bluez/example/advertisement0
Jun 25 11:04:43 void-dev dbus[793]: [system] Rejected send message, 1
matched rules; type="method_call", sender=":1.2" (uid=0 pid=758
comm="/usr/libexec/bluetooth/bluetoothd --experimental -")
interface="org.freedesktop.DBus.Properties" member="GetAll" error
name="(unset)" requested_reply="0" destination=":1.222" (uid=1000
pid=13905 comm="/usr/bin/python ./example-advertisement ")
Jun 25 11:04:43 void-dev bluetoothd[758]: Failed to read "Type"
property of advertisement

Any ideas on what could be causing the intermittent advertisement
registration failures when using the BlueZ D-Bus advertising API?

Thanks,
-Ossama

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

end of thread, other threads:[~2015-06-26 21:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-25 18:12 Unreliable LE advertisement registration through BlueZ advertising API Othman, Ossama
2015-06-25 18:18 ` Tedd Ho-Jeong An
2015-06-25 19:58   ` Othman, Ossama
2015-06-26 11:13     ` Luiz Augusto von Dentz
2015-06-26 12:22       ` jerico.dev
2015-06-26 12:28         ` Luiz Augusto von Dentz
2015-06-26 12:36           ` jerico.dev
2015-06-26 12:40             ` Luiz Augusto von Dentz
2015-06-26 21:11       ` Othman, Ossama

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).