Skip to content

Commit

Permalink
[Linux] Fix BLE infinite advertising
Browse files Browse the repository at this point in the history
According to BlueZ documentation, discoverable timeout of 0 should
disable the timeout. However, due to a bug, setting timeout to 0
stops advertising immediately after sending ADV frame.
  • Loading branch information
arkq committed Feb 13, 2024
1 parent f216481 commit e8e4a6a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/platform/Linux/bluez/BluezAdvertisement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ BluezLEAdvertisement1 * BluezAdvertisement::CreateLEAdvertisement()
// Bluez to set "BR/EDR Not Supported" flag. Bluez doesn't provide API to do that explicitly
// and the flag is necessary to force using LE transport.
bluez_leadvertisement1_set_discoverable(adv, TRUE);
bluez_leadvertisement1_set_discoverable_timeout(adv, 0 /* infinite */);
// empty discoverable timeout for infinite discoverability

// empty includes
bluez_leadvertisement1_set_local_name(adv, mAdvName);
Expand Down
2 changes: 1 addition & 1 deletion src/platform/Linux/dbus/bluez/DbusBluez.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
<property name="ServiceData" type="a{sv}" access="read"/>
<property name="Data" type="a{yay}" access="read"/>
<property name="Discoverable" type="b" access="read"/>
<property name="DiscoverableTimeout" type="q" access="read"/>
<!-- <property name="DiscoverableTimeout" type="q" access="read"/> -->
<property name="Includes" type="as" access="read"/>
<property name="LocalName" type="s" access="read"/>
<property name="Appearance" type="q" access="read"/>
Expand Down

0 comments on commit e8e4a6a

Please sign in to comment.