Re: [PATCH BlueZ] Fix for broadcast mode, not to add any AD flags in advertise Data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, Nov 20, 2024 at 10:00 AM <quic_prathm@xxxxxxxxxxx> wrote:
>
> From: Prathibha Madugonde <quic_prathm@xxxxxxxxxxx>
>
> src/advertising.c
> Include check for broadcast mode:
> Need not set flags in AD flags of Advertise Data

Please reword the last sentence to something like: "AD flags shall
never be set for broadcast", also add traces showing what is
happening.

> Test steps:
> From DUT, bluetoothctl go to menu advertise
> secondary 1M/2M
> name on
> back
> advertise broadcast

In case you don't know it, it is possible to call command from
submenus directly:

advertise.secondary 1M/2M
advertise.name on
advertise broadcast

> ---
>  src/advertising.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/advertising.c b/src/advertising.c
> index bd121e525..2fc6f917d 100644
> --- a/src/advertising.c
> +++ b/src/advertising.c
> @@ -759,10 +759,15 @@ static bool parse_discoverable(DBusMessageIter *iter,
>
>         dbus_message_iter_get_basic(iter, &discoverable);
>
> +       /* For broadcast mode, need not add any flags
> +        * just return true without adding flags.
> +        */
>         if (discoverable)
>                 flags = BT_AD_FLAG_GENERAL;
> -       else
> +       else if (client->type != AD_TYPE_BROADCAST)
>                 flags = 0x00;
> +       else
> +               return true;
>
>         if (!set_flags(client , flags))
>                 goto fail;
> --
> 2.17.1
>
>


-- 
Luiz Augusto von Dentz





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux