Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ v3 0/4] Add Channel Sounding Dbus support and
@ 2026-07-12 12:17 Naga Bhavani Akella
  2026-07-12 12:17 ` [PATCH BlueZ v3 1/4] rap: Add Channel Sounding parameter types and APIs Naga Bhavani Akella
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Naga Bhavani Akella @ 2026-07-12 12:17 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.dentz, quic_mohamull, quic_hbandi, quic_anubhavg,
	Naga Bhavani Akella

This series adds user-facing control and configuration support for
Bluetooth LE Channel Sounding (CS) through a new DBus interface and
bluetoothctl integration.

The RAP profile is extended to expose an
org.bluez.ChannelSounding1 interface, allowing external applications
to configure default Channel Sounding settings and start or stop
measurement procedures. CS configuration, frequency, and default
settings are moved from hardcoded values into shared parameter
structures and accessor APIs, enabling runtime configuration from the
DBus layer.

To make the new functionality accessible from the command line,
bluetoothctl adds a dedicated "cs" submenu for configuring parameters,
starting and stopping measurements, and monitoring active sessions.

The series also ensures the Channel Sounding interface is available on
reflector devices by registering relevant GATT profiles even when GATT
client discovery is skipped

Changes in v3:
- Add an explicit case CS_TARGET_SETTINGS to satisfy the condition

Changes in v2:
- Add patches 3-4 to support channel sounding dbus implementation


Naga Bhavani Akella (4):
  rap: Add Channel Sounding parameter types and APIs
  src: Register GATT profiles for Channel Sounding reflector
  profiles: Add D-Bus Channel Sounding control APIs
  client: Add Channel Sounding shell submenu

 Makefile.am                |    2 +-
 Makefile.tools             |    3 +-
 client/cs.c                | 1157 ++++++++++++++++++++++++++++++++++++
 client/cs.h                |   18 +
 client/main.c              |   27 +-
 profiles/ranging/rap.c     |  350 ++++++++++-
 profiles/ranging/rap_hci.c |  531 +++++++++++------
 src/device.c               |   28 +-
 src/shared/cs-types.h      |   50 ++
 src/shared/rap.h           |   27 +-
 10 files changed, 2003 insertions(+), 190 deletions(-)
 create mode 100644 client/cs.c
 create mode 100644 client/cs.h
 create mode 100644 src/shared/cs-types.h

-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread
* [PATCH BlueZ v2 1/4] rap: Add Channel Sounding parameter types and APIs
@ 2026-07-10  9:49 Naga Bhavani Akella
  2026-07-10 11:57 ` Add Channel Sounding Dbus support and bluez.test.bot
  0 siblings, 1 reply; 7+ messages in thread
From: Naga Bhavani Akella @ 2026-07-10  9:49 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: luiz.dentz, quic_mohamull, quic_hbandi, quic_anubhavg,
	Naga Bhavani Akella

Add shared Channel Sounding parameter structures
(bt_rap_le_cs_config, bt_rap_le_cs_frequency and
bt_rap_le_cs_default_settings) for exchanging
CS configuration, frequency, and default settings
between the RAP DBus layer and HCI state machine.

Add getter/setter APIs for CS config, frequency
and default settings, add measurement.
---
 Makefile.am           |  2 +-
 src/shared/cs-types.h | 50 +++++++++++++++++++++++++++++++++++++++++++
 src/shared/rap.h      | 27 ++++++++++++++++++++++-
 3 files changed, 77 insertions(+), 2 deletions(-)
 create mode 100644 src/shared/cs-types.h

diff --git a/Makefile.am b/Makefile.am
index 76c4ab5d4..a7b063c6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -249,7 +249,7 @@ shared_sources = src/shared/io.h src/shared/timeout.h \
 			src/shared/asha.h src/shared/asha.c \
 			src/shared/battery.h src/shared/battery.c \
 			src/shared/uinput.h src/shared/uinput.c \
-			src/shared/rap.h src/shared/rap.c
+			src/shared/rap.h src/shared/rap.c src/shared/cs-types.h
 
 
 if READLINE
diff --git a/src/shared/cs-types.h b/src/shared/cs-types.h
new file mode 100644
index 000000000..0d53d4ab8
--- /dev/null
+++ b/src/shared/cs-types.h
@@ -0,0 +1,50 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#pragma once
+
+#include <stdint.h>
+
+struct bt_rap_le_cs_config {
+	uint8_t config_id;
+	uint8_t main_mode_type;
+	uint8_t sub_mode_type;
+	uint8_t main_mode_min_steps;
+	uint8_t main_mode_max_steps;
+	uint8_t main_mode_repetition;
+	uint8_t mode0_steps;
+	uint8_t role;
+	uint8_t rtt_types;
+	uint8_t cs_sync_phy;
+	uint8_t channel_map[10];
+	uint8_t channel_map_repetition;
+	uint8_t channel_selection_type;
+	uint8_t channel_shape;
+	uint8_t channel_jump;
+	uint8_t companion_signal_enable;
+};
+
+struct bt_rap_le_cs_frequency {
+	uint16_t max_procedure_duration;
+	uint16_t min_period_between_procedures;
+	uint16_t max_period_between_procedures;
+	uint16_t max_procedure_count;
+	uint8_t  min_sub_event_len[3];
+	uint8_t  max_sub_event_len[3];
+	uint8_t  tone_antenna_config_selection;
+	uint8_t  phy;
+	uint8_t  tx_power_delta;
+	uint8_t  preferred_peer_antenna;
+	uint8_t  snr_control_initiator;
+	uint8_t  snr_control_reflector;
+};
+
+struct bt_rap_le_cs_default_settings {
+	uint8_t role;
+	uint8_t cs_sync_ant_sel;
+	int8_t  max_tx_power;
+};
diff --git a/src/shared/rap.h b/src/shared/rap.h
index 7bc49f03d..5582635e6 100644
--- a/src/shared/rap.h
+++ b/src/shared/rap.h
@@ -9,8 +9,8 @@
 #include <inttypes.h>
 
 #include "src/shared/io.h"
-#include "bluetooth/mgmt.h"
 #include "src/shared/hci.h"
+#include "src/shared/cs-types.h"
 
 struct bt_rap;
 struct gatt_db;
@@ -189,6 +189,23 @@ bool bt_rap_unregister(unsigned int id);
 
 struct bt_rap *bt_rap_new(struct gatt_db *ldb, struct gatt_db *rdb);
 
+bool bt_rap_set_cs_config_params(void *hci_sm,
+				const struct bt_rap_le_cs_config *config);
+bool bt_rap_set_cs_freq_params(void *hci_sm,
+				const struct bt_rap_le_cs_frequency *frequency);
+bool bt_rap_set_default_settings_params(void *hci_sm,
+				const struct bt_rap_le_cs_default_settings *s);
+bool bt_rap_get_cs_config_params(void *hci_sm,
+				struct bt_rap_le_cs_config *config);
+bool bt_rap_get_cs_freq_params(void *hci_sm,
+				struct bt_rap_le_cs_frequency *frequency);
+bool bt_rap_get_default_settings_params(void *hci_sm,
+				struct bt_rap_le_cs_default_settings *s);
+/* Distance measurement control */
+bool bt_rap_start_measurement(void *hci_sm, uint16_t conn_handle,
+				uint32_t duration_secs);
+bool bt_rap_stop_measurement(void *hci_sm);
+
 /* HCI Raw Channel Approach */
 void bt_rap_hci_cs_config_complete_callback(uint16_t length,
 					     const void *param,
@@ -220,3 +237,11 @@ bool bt_rap_set_conn_hndl(void *hci_sm,
 			bool is_central);
 
 void bt_rap_clear_conn_handle(void *hci_sm, uint16_t handle);
+
+bool bt_rap_is_procedure_active(void *hci_sm);
+
+void bt_rap_set_timeout_cb(void *hci_sm, void (*func)(void *),
+				void *user_data);
+
+void bt_rap_set_proc_active_cb(void *hci_sm, void (*func)(bool, void *),
+				void *user_data);
-- 


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-12 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-12 12:17 [PATCH BlueZ v3 0/4] Add Channel Sounding Dbus support and Naga Bhavani Akella
2026-07-12 12:17 ` [PATCH BlueZ v3 1/4] rap: Add Channel Sounding parameter types and APIs Naga Bhavani Akella
2026-07-12 13:24   ` Add Channel Sounding Dbus support and bluez.test.bot
2026-07-12 12:17 ` [PATCH BlueZ v3 2/4] src: Register GATT profiles for Channel Sounding reflector Naga Bhavani Akella
2026-07-12 12:17 ` [PATCH BlueZ v3 3/4] profiles: Add D-Bus Channel Sounding control APIs Naga Bhavani Akella
2026-07-12 12:17 ` [PATCH BlueZ v3 4/4] client: Add Channel Sounding shell submenu Naga Bhavani Akella
  -- strict thread matches above, loose matches on Subject: below --
2026-07-10  9:49 [PATCH BlueZ v2 1/4] rap: Add Channel Sounding parameter types and APIs Naga Bhavani Akella
2026-07-10 11:57 ` Add Channel Sounding Dbus support and 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