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]

 





On 11/20/2024 8:43 PM, Luiz Augusto von Dentz wrote:
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.

Thanks Luiz for the input, re-framing the sentence and sending in upcoming patch.

Below is the snippet of btmon logs for advertise broadcast failure.

*****************************
@ MGMT Command: Add Extended Advertising Data (0x0055) plen 22
                         {0x0001} [hci0] 160.010453
        Instance: 1
        Advertising data length: 3
        Flags: 0x04
          BR/EDR Not Supported
        Scan response length: 8
        Name (complete): prathm
@ MGMT Event: Advertising Added (0x0023) plen 1
                         {0x0002} [hci0] 160.010474
        Instance: 1
> HCI Event: Command Complete (0x0e) plen 4
                               #46 [hci0] 160.010849
      LE Set Extended Advertising Data (0x08|0x0037) ncmd 2
        Status: Invalid HCI Command Parameters (0x12)
*******************************

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


Got it. Thank you for info.

Thanks
Prathibha

---
  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








[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