* RE: client: add public-broadcast advertise helper
2026-03-17 5:58 raghava447
@ 2026-03-17 6:11 ` bluez.test.bot
0 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2026-03-17 6:11 UTC (permalink / raw)
To: linux-bluetooth, raghavendra.rao
[-- Attachment #1: Type: text/plain, Size: 719 bytes --]
This is an automated email and please do not reply to this email.
Dear Submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.
----- Output -----
error: patch failed: client/advertising.c:28
error: client/advertising.c: patch does not apply
error: patch failed: client/advertising.h:35
error: client/advertising.h: patch does not apply
error: patch failed: client/main.c:2922
error: client/main.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Please resolve the issue and submit the patches again.
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH BlueZ 0/1] client: add public-broadcast advertise helper
@ 2026-03-17 14:26 raghava447
2026-03-17 14:26 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command raghava447
0 siblings, 1 reply; 6+ messages in thread
From: raghava447 @ 2026-03-17 14:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: raghava447
This patch adds a bluetoothctl advertise helper for BLE Audio
public broadcast profile advertising.
This series adds a semantic helper:
public-broadcast sq
public-broadcast hq
This matches with current commands:
service 0x1856 0x02 0x00
service 0x1856 0x04 0x00
raghava447 (1):
client: Add public-broadcast profile advertise command
client/advertising.c | 70 ++++++++++++++++++++++++++++++++++++++++++++
client/advertising.h | 2 ++
client/main.c | 19 ++++++++++++
3 files changed, 91 insertions(+)
--
2.53.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command
2026-03-17 14:26 [PATCH BlueZ 0/1] client: add public-broadcast advertise helper raghava447
@ 2026-03-17 14:26 ` raghava447
2026-03-17 16:21 ` client: add public-broadcast advertise helper bluez.test.bot
2026-03-17 18:00 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command Luiz Augusto von Dentz
0 siblings, 2 replies; 6+ messages in thread
From: raghava447 @ 2026-03-17 14:26 UTC (permalink / raw)
To: linux-bluetooth; +Cc: raghava447
Add an advertise submenu command for BLE Audio public broadcast profile
advertising in bluetoothctl.
The new "public-broadcast" command reuses the existing staged AD
ServiceData field for UUID 0x1856.
It supports:
- public-broadcast sq
- public-broadcast hq
- public-broadcast
The sq and hq values map to the existing raw service-data payloads:
- sq -> 0x02 0x00
- hq -> 0x04 0x00
When called without arguments, the command reports the currently staged
public-broadcast state if the staged AD service UUID is 0x1856.
Else it reports that public broadcast is not set.
---
client/advertising.c | 70 ++++++++++++++++++++++++++++++++++++++++++++
client/advertising.h | 2 ++
client/main.c | 19 ++++++++++++
3 files changed, 91 insertions(+)
diff --git a/client/advertising.c b/client/advertising.c
index f9df1b855..30b89a404 100644
--- a/client/advertising.c
+++ b/client/advertising.c
@@ -20,6 +20,8 @@
#include <string.h>
#include <errno.h>
+#include "bluetooth/bluetooth.h"
+#include "bluetooth/uuid.h"
#include "gdbus/gdbus.h"
#include "src/shared/util.h"
#include "src/shared/shell.h"
@@ -27,6 +29,7 @@
#define AD_PATH "/org/bluez/advertising"
#define AD_IFACE "org.bluez.LEAdvertisement1"
+#define AD_PUBLIC_BROADCAST_UUID "0x1856"
struct ad_data {
uint8_t data[245];
@@ -1005,6 +1008,73 @@ static void ad_clear_data(int type)
memset(&ad.data[type], 0, sizeof(ad.data[type]));
}
+static bool ad_is_public_broadcast_uuid(const char *uuid)
+{
+ return uuid && !bt_uuid_strcmp(uuid, AD_PUBLIC_BROADCAST_UUID);
+}
+
+static const char *ad_public_broadcast_state(void)
+{
+ if (!ad_is_public_broadcast_uuid(ad.service[AD_TYPE_AD].uuid))
+ return NULL;
+
+ if (ad.service[AD_TYPE_AD].data.len != 2)
+ return NULL;
+
+ if (ad.service[AD_TYPE_AD].data.data[0] == 0x02 &&
+ ad.service[AD_TYPE_AD].data.data[1] == 0x00)
+ return "sq";
+
+ if (ad.service[AD_TYPE_AD].data.data[0] == 0x04 &&
+ ad.service[AD_TYPE_AD].data.data[1] == 0x00)
+ return "hq";
+
+ return NULL;
+}
+
+void ad_advertise_public_broadcast(DBusConnection *conn, int argc, char *argv[])
+{
+ struct ad_data data = {
+ .data = { 0x00, 0x00 },
+ .len = 2,
+ };
+ const char *state;
+
+ if (argc < 2) {
+ state = ad_public_broadcast_state();
+ if (state)
+ bt_shell_printf("Public Broadcast: %s\n", state);
+ else
+ bt_shell_printf("Public Broadcast not set\n");
+
+ return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+ }
+
+ if (!strlen(argv[1])) {
+ bt_shell_printf("Public broadcast value cannot be empty\n");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ if (!strcasecmp(argv[1], "sq"))
+ data.data[0] = 0x02;
+ else if (!strcasecmp(argv[1], "hq"))
+ data.data[0] = 0x04;
+ else {
+ bt_shell_printf("Invalid argument: accepted values are sq or hq\n");
+ return bt_shell_noninteractive_quit(EXIT_FAILURE);
+ }
+
+ ad_clear_service(AD_TYPE_AD);
+
+ ad.service[AD_TYPE_AD].uuid = g_strdup(AD_PUBLIC_BROADCAST_UUID);
+ ad.service[AD_TYPE_AD].data = data;
+
+ g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE,
+ prop_names.service[AD_TYPE_AD]);
+
+ return bt_shell_noninteractive_quit(EXIT_SUCCESS);
+}
+
void ad_advertise_data(DBusConnection *conn, int type, int argc, char *argv[])
{
char *endptr = NULL;
diff --git a/client/advertising.h b/client/advertising.h
index 9d124c7af..8c3fd041b 100644
--- a/client/advertising.h
+++ b/client/advertising.h
@@ -34,6 +34,8 @@ void ad_advertise_local_appearance(DBusConnection *conn, long int *value);
void ad_advertise_duration(DBusConnection *conn, long int *value);
void ad_advertise_timeout(DBusConnection *conn, long int *value);
void ad_advertise_data(DBusConnection *conn, int type, int argc, char *argv[]);
+void ad_advertise_public_broadcast(DBusConnection *conn, int argc,
+ char *argv[]);
void ad_disable_data(DBusConnection *conn, int type);
void ad_advertise_discoverable(DBusConnection *conn, dbus_bool_t *value);
void ad_advertise_discoverable_timeout(DBusConnection *conn, long int *value);
diff --git a/client/main.c b/client/main.c
index cb016a579..0e050b373 100644
--- a/client/main.c
+++ b/client/main.c
@@ -2892,6 +2892,17 @@ static char *ad_generator(const char *text, int state)
return argument_generator(text, state, ad_arguments);
}
+static const char *public_broadcast_arguments[] = {
+ "sq",
+ "hq",
+ NULL
+};
+
+static char *public_broadcast_generator(const char *text, int state)
+{
+ return argument_generator(text, state, public_broadcast_arguments);
+}
+
static void cmd_advertise_uuids(int argc, char *argv[])
{
ad_advertise_uuids(dbus_conn, AD_TYPE_AD, argc, argv);
@@ -2917,6 +2928,11 @@ static void cmd_advertise_data(int argc, char *argv[])
ad_advertise_data(dbus_conn, AD_TYPE_AD, argc, argv);
}
+static void cmd_advertise_public_broadcast(int argc, char *argv[])
+{
+ ad_advertise_public_broadcast(dbus_conn, argc, argv);
+}
+
static void cmd_advertise_sr_uuids(int argc, char *argv[])
{
ad_advertise_uuids(dbus_conn, AD_TYPE_SRD, argc, argv);
@@ -3600,6 +3616,9 @@ static const struct bt_shell_menu advertise_menu = {
"Set/Get advertise manufacturer data" },
{ "data", "[type] [data=xx xx ...]", cmd_advertise_data,
"Set/Get advertise data" },
+ { "public-broadcast", "[sq/hq]", cmd_advertise_public_broadcast,
+ "Set/Get BLE Audio Public Broadcast Announcement",
+ public_broadcast_generator },
{ "sr-uuids", "[uuid1 uuid2 ...]", cmd_advertise_sr_uuids,
"Set/Get scan response uuids" },
{ "sr-solicit", "[uuid1 uuid2 ...]", cmd_advertise_sr_solicit,
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: client: add public-broadcast advertise helper
2026-03-17 14:26 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command raghava447
@ 2026-03-17 16:21 ` bluez.test.bot
2026-03-17 18:00 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command Luiz Augusto von Dentz
1 sibling, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2026-03-17 16:21 UTC (permalink / raw)
To: linux-bluetooth, raghavendra.rao
[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1068070
---Test result---
Test Summary:
CheckPatch PENDING 0.53 seconds
GitLint PENDING 0.56 seconds
BuildEll PASS 21.05 seconds
BluezMake PASS 643.60 seconds
MakeCheck PASS 19.19 seconds
MakeDistcheck PASS 248.59 seconds
CheckValgrind PASS 300.93 seconds
CheckSmatch PASS 366.26 seconds
bluezmakeextell PASS 191.21 seconds
IncrementalBuild PENDING 0.48 seconds
ScanBuild PASS 1029.10 seconds
Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:
##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:
##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:
https://github.com/bluez/bluez/pull/1967/checks
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command
2026-03-17 14:26 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command raghava447
2026-03-17 16:21 ` client: add public-broadcast advertise helper bluez.test.bot
@ 2026-03-17 18:00 ` Luiz Augusto von Dentz
2026-03-20 8:34 ` raghava447
1 sibling, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2026-03-17 18:00 UTC (permalink / raw)
To: raghava447; +Cc: linux-bluetooth
Hi,
On Tue, Mar 17, 2026 at 10:42 AM raghava447
<raghavendra.rao@collabora.com> wrote:
>
> Add an advertise submenu command for BLE Audio public broadcast profile
> advertising in bluetoothctl.
>
> The new "public-broadcast" command reuses the existing staged AD
> ServiceData field for UUID 0x1856.
> It supports:
> - public-broadcast sq
> - public-broadcast hq
> - public-broadcast
Perhaps we could detect when broadcast is in use and then set the name
as the public broadcast name if one is set.
> The sq and hq values map to the existing raw service-data payloads:
> - sq -> 0x02 0x00
> - hq -> 0x04 0x00
>
> When called without arguments, the command reports the currently staged
> public-broadcast state if the staged AD service UUID is 0x1856.
> Else it reports that public broadcast is not set.
> ---
> client/advertising.c | 70 ++++++++++++++++++++++++++++++++++++++++++++
> client/advertising.h | 2 ++
> client/main.c | 19 ++++++++++++
> 3 files changed, 91 insertions(+)
>
> diff --git a/client/advertising.c b/client/advertising.c
> index f9df1b855..30b89a404 100644
> --- a/client/advertising.c
> +++ b/client/advertising.c
> @@ -20,6 +20,8 @@
> #include <string.h>
> #include <errno.h>
>
> +#include "bluetooth/bluetooth.h"
> +#include "bluetooth/uuid.h"
> #include "gdbus/gdbus.h"
> #include "src/shared/util.h"
> #include "src/shared/shell.h"
> @@ -27,6 +29,7 @@
>
> #define AD_PATH "/org/bluez/advertising"
> #define AD_IFACE "org.bluez.LEAdvertisement1"
> +#define AD_PUBLIC_BROADCAST_UUID "0x1856"
>
> struct ad_data {
> uint8_t data[245];
> @@ -1005,6 +1008,73 @@ static void ad_clear_data(int type)
> memset(&ad.data[type], 0, sizeof(ad.data[type]));
> }
>
> +static bool ad_is_public_broadcast_uuid(const char *uuid)
> +{
> + return uuid && !bt_uuid_strcmp(uuid, AD_PUBLIC_BROADCAST_UUID);
> +}
> +
> +static const char *ad_public_broadcast_state(void)
> +{
> + if (!ad_is_public_broadcast_uuid(ad.service[AD_TYPE_AD].uuid))
> + return NULL;
> +
> + if (ad.service[AD_TYPE_AD].data.len != 2)
> + return NULL;
> +
> + if (ad.service[AD_TYPE_AD].data.data[0] == 0x02 &&
> + ad.service[AD_TYPE_AD].data.data[1] == 0x00)
> + return "sq";
> +
> + if (ad.service[AD_TYPE_AD].data.data[0] == 0x04 &&
> + ad.service[AD_TYPE_AD].data.data[1] == 0x00)
> + return "hq";
> +
> + return NULL;
> +}
> +
> +void ad_advertise_public_broadcast(DBusConnection *conn, int argc, char *argv[])
> +{
> + struct ad_data data = {
> + .data = { 0x00, 0x00 },
> + .len = 2,
> + };
> + const char *state;
> +
> + if (argc < 2) {
> + state = ad_public_broadcast_state();
> + if (state)
> + bt_shell_printf("Public Broadcast: %s\n", state);
> + else
> + bt_shell_printf("Public Broadcast not set\n");
> +
> + return bt_shell_noninteractive_quit(EXIT_SUCCESS);
> + }
> +
> + if (!strlen(argv[1])) {
> + bt_shell_printf("Public broadcast value cannot be empty\n");
> + return bt_shell_noninteractive_quit(EXIT_FAILURE);
> + }
> +
> + if (!strcasecmp(argv[1], "sq"))
> + data.data[0] = 0x02;
> + else if (!strcasecmp(argv[1], "hq"))
> + data.data[0] = 0x04;
> + else {
> + bt_shell_printf("Invalid argument: accepted values are sq or hq\n");
> + return bt_shell_noninteractive_quit(EXIT_FAILURE);
> + }
> +
> + ad_clear_service(AD_TYPE_AD);
> +
> + ad.service[AD_TYPE_AD].uuid = g_strdup(AD_PUBLIC_BROADCAST_UUID);
> + ad.service[AD_TYPE_AD].data = data;
> +
> + g_dbus_emit_property_changed(conn, AD_PATH, AD_IFACE,
> + prop_names.service[AD_TYPE_AD]);
> +
> + return bt_shell_noninteractive_quit(EXIT_SUCCESS);
> +}
> +
> void ad_advertise_data(DBusConnection *conn, int type, int argc, char *argv[])
> {
> char *endptr = NULL;
> diff --git a/client/advertising.h b/client/advertising.h
> index 9d124c7af..8c3fd041b 100644
> --- a/client/advertising.h
> +++ b/client/advertising.h
> @@ -34,6 +34,8 @@ void ad_advertise_local_appearance(DBusConnection *conn, long int *value);
> void ad_advertise_duration(DBusConnection *conn, long int *value);
> void ad_advertise_timeout(DBusConnection *conn, long int *value);
> void ad_advertise_data(DBusConnection *conn, int type, int argc, char *argv[]);
> +void ad_advertise_public_broadcast(DBusConnection *conn, int argc,
> + char *argv[]);
> void ad_disable_data(DBusConnection *conn, int type);
> void ad_advertise_discoverable(DBusConnection *conn, dbus_bool_t *value);
> void ad_advertise_discoverable_timeout(DBusConnection *conn, long int *value);
> diff --git a/client/main.c b/client/main.c
> index cb016a579..0e050b373 100644
> --- a/client/main.c
> +++ b/client/main.c
> @@ -2892,6 +2892,17 @@ static char *ad_generator(const char *text, int state)
> return argument_generator(text, state, ad_arguments);
> }
>
> +static const char *public_broadcast_arguments[] = {
> + "sq",
> + "hq",
> + NULL
> +};
> +
> +static char *public_broadcast_generator(const char *text, int state)
> +{
> + return argument_generator(text, state, public_broadcast_arguments);
> +}
> +
> static void cmd_advertise_uuids(int argc, char *argv[])
> {
> ad_advertise_uuids(dbus_conn, AD_TYPE_AD, argc, argv);
> @@ -2917,6 +2928,11 @@ static void cmd_advertise_data(int argc, char *argv[])
> ad_advertise_data(dbus_conn, AD_TYPE_AD, argc, argv);
> }
>
> +static void cmd_advertise_public_broadcast(int argc, char *argv[])
> +{
> + ad_advertise_public_broadcast(dbus_conn, argc, argv);
> +}
> +
> static void cmd_advertise_sr_uuids(int argc, char *argv[])
> {
> ad_advertise_uuids(dbus_conn, AD_TYPE_SRD, argc, argv);
> @@ -3600,6 +3616,9 @@ static const struct bt_shell_menu advertise_menu = {
> "Set/Get advertise manufacturer data" },
> { "data", "[type] [data=xx xx ...]", cmd_advertise_data,
> "Set/Get advertise data" },
> + { "public-broadcast", "[sq/hq]", cmd_advertise_public_broadcast,
> + "Set/Get BLE Audio Public Broadcast Announcement",
> + public_broadcast_generator },
> { "sr-uuids", "[uuid1 uuid2 ...]", cmd_advertise_sr_uuids,
> "Set/Get scan response uuids" },
> { "sr-solicit", "[uuid1 uuid2 ...]", cmd_advertise_sr_solicit,
> --
> 2.53.0
>
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command
2026-03-17 18:00 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command Luiz Augusto von Dentz
@ 2026-03-20 8:34 ` raghava447
0 siblings, 0 replies; 6+ messages in thread
From: raghava447 @ 2026-03-20 8:34 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Raghavendra Rao
From: Raghavendra Rao <raghavendra.rao@collabora.com>
Thanks for the suggestion.
My intention with this patch was to keep it limited to the semantic helper
for the Public Broadcast Announcement service.
I can work on a follow-up patch to integrate the broadcast name handling so
that when public broadcast is in use, a configured name can also be staged
as the Public Broadcast Name AD field.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-03-20 8:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-17 14:26 [PATCH BlueZ 0/1] client: add public-broadcast advertise helper raghava447
2026-03-17 14:26 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command raghava447
2026-03-17 16:21 ` client: add public-broadcast advertise helper bluez.test.bot
2026-03-17 18:00 ` [PATCH BlueZ 1/1] client: Add public-broadcast profile advertise command Luiz Augusto von Dentz
2026-03-20 8:34 ` raghava447
-- strict thread matches above, loose matches on Subject: below --
2026-03-17 5:58 raghava447
2026-03-17 6:11 ` client: add public-broadcast advertise helper bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox