* [PATCH BlueZ] advertising: Fix advertising flags
@ 2020-05-26 19:33 Luiz Augusto von Dentz
2020-05-27 17:14 ` Luiz Augusto von Dentz
0 siblings, 1 reply; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-26 19:33 UTC (permalink / raw)
To: linux-bluetooth
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
When an instance wants to force being discoverable the code shall
actually check if the adapter is in general disverable mode already and
if not set BR/EDR as not supported so that devices scanning don't
assume BR/EDR PHY is connectable when in fact it isn't.
---
src/advertising.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/advertising.c b/src/advertising.c
index 45ff19fa0..829c481f6 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -697,9 +697,12 @@ static bool parse_discoverable(DBusMessageIter *iter,
dbus_message_iter_get_basic(iter, &discoverable);
- if (discoverable)
- flags = 0x02;
- else
+ if (discoverable) {
+ /* Set BR/EDR Not Supported if adapter is no discoverable */
+ if (!btd_adapter_get_discoverable(client->manager->adapter))
+ flags = 0x04;
+ flags |= 0x02;
+ } else
flags = 0x00;
if (!set_flags(client , flags))
--
2.25.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH BlueZ] advertising: Fix advertising flags
2020-05-26 19:33 [PATCH BlueZ] advertising: Fix advertising flags Luiz Augusto von Dentz
@ 2020-05-27 17:14 ` Luiz Augusto von Dentz
0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2020-05-27 17:14 UTC (permalink / raw)
To: linux-bluetooth
Hi,
On Tue, May 26, 2020 at 12:33 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> When an instance wants to force being discoverable the code shall
> actually check if the adapter is in general disverable mode already and
> if not set BR/EDR as not supported so that devices scanning don't
> assume BR/EDR PHY is connectable when in fact it isn't.
> ---
> src/advertising.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/src/advertising.c b/src/advertising.c
> index 45ff19fa0..829c481f6 100644
> --- a/src/advertising.c
> +++ b/src/advertising.c
> @@ -697,9 +697,12 @@ static bool parse_discoverable(DBusMessageIter *iter,
>
> dbus_message_iter_get_basic(iter, &discoverable);
>
> - if (discoverable)
> - flags = 0x02;
> - else
> + if (discoverable) {
> + /* Set BR/EDR Not Supported if adapter is no discoverable */
> + if (!btd_adapter_get_discoverable(client->manager->adapter))
> + flags = 0x04;
> + flags |= 0x02;
> + } else
> flags = 0x00;
>
> if (!set_flags(client , flags))
> --
> 2.25.3
Pushed.
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-27 17:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 19:33 [PATCH BlueZ] advertising: Fix advertising flags Luiz Augusto von Dentz
2020-05-27 17:14 ` Luiz Augusto von Dentz
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).