Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] Fix BLE infinite advertising #32093

Merged
merged 4 commits into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
26 changes: 23 additions & 3 deletions src/platform/Linux/dbus/bluez/DbusBluez.xml
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,33 @@
<property name="ServiceData" type="a{sv}" access="read"/>
<property name="Data" type="a{yay}" access="read"/>
<property name="Discoverable" type="b" access="read"/>
<!--
Do not expose discoverable timeout property, so BlueZ will set it
internally to zero, effectively disabling the timeout. Becase of BlueZ
bug, which is not fixed until BlueZ 5.73, we can not set it to zero in
woody-apple marked this conversation as resolved.
Show resolved Hide resolved
the application code.

<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"/>
<!-- <property name="Duration" type="q" access="read"/> -->
<!-- <property name="Timeout" type="q" access="read"/> -->
<!-- <property name="SecondaryChannel" type="s" access="read"/> -->
<!--
Do not expose duration, so BlueZ will use the internal default value.

<property name="Duration" type="q" access="read"/>
-->
<!--
Do not expose timeout property, so BlueZ will not call the Release()
method after a timeout.

<property name="Timeout" type="q" access="read"/>
-->
<!--
We are not using SecondaryChannel property, so we do not expose it.

<property name="SecondaryChannel" type="s" access="read"/>
-->
<property name="MinInterval" type="u" access="read"/>
<property name="MaxInterval" type="u" access="read"/>
</interface>
Expand Down
Loading