* [PATCH BlueZ v1 1/2] rap: Add Channel Sounding parameter types and APIs
2026-07-10 7:08 [PATCH BlueZ v1 0/2] Channel Sounding reflector GATT registration and Naga Bhavani Akella
@ 2026-07-10 7:08 ` Naga Bhavani Akella
2026-07-10 9:27 ` Channel Sounding reflector GATT registration and bluez.test.bot
2026-07-10 7:08 ` [PATCH BlueZ v1 2/2] src: Register GATT profiles for Channel Sounding reflector Naga Bhavani Akella
1 sibling, 1 reply; 4+ messages in thread
From: Naga Bhavani Akella @ 2026-07-10 7:08 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] 4+ messages in thread* [PATCH BlueZ v1 2/2] src: Register GATT profiles for Channel Sounding reflector
2026-07-10 7:08 [PATCH BlueZ v1 0/2] Channel Sounding reflector GATT registration and Naga Bhavani Akella
2026-07-10 7:08 ` [PATCH BlueZ v1 1/2] rap: Add Channel Sounding parameter types and APIs Naga Bhavani Akella
@ 2026-07-10 7:08 ` Naga Bhavani Akella
1 sibling, 0 replies; 4+ messages in thread
From: Naga Bhavani Akella @ 2026-07-10 7:08 UTC (permalink / raw)
To: linux-bluetooth
Cc: luiz.dentz, quic_mohamull, quic_hbandi, quic_anubhavg,
Naga Bhavani Akella
Probe and accept GATT_UUID profiles on non-initiator (reflector)
devices before gatt_client discovery checks,
ensuring RAP's org.bluez.ChannelSounding1 DBus interface is registered
even when GATT client discovery is skipped.
---
src/device.c | 28 +++++++++++++++++++++-------
1 file changed, 21 insertions(+), 7 deletions(-)
diff --git a/src/device.c b/src/device.c
index 65d84be56..cedfe3a20 100644
--- a/src/device.c
+++ b/src/device.c
@@ -6301,17 +6301,31 @@ static void gatt_debug(const char *str, void *user_data)
static void gatt_client_init(struct btd_device *device)
{
uint8_t features;
+ GSList *uuid_list;
gatt_client_cleanup(device);
- if (!btd_device_is_initiator(device) && !btd_opts.reverse_discovery) {
- DBG("Reverse service discovery disabled: skipping GATT client");
- return;
- }
+ if (!btd_device_is_initiator(device)) {
+ /*
+ * For the reflector role GATT client discovery is skipped, but
+ * profiles that match GATT_UUID still need to be probed and
+ * accepted so they can register their D-Bus interfaces (e.g.
+ * org.bluez.ChannelSounding1).
+ */
+ uuid_list = g_slist_append(NULL, (char *)GATT_UUID);
+ device_probe_profiles(device, uuid_list);
+ g_slist_free(uuid_list);
+ device_accept_gatt_profiles(device);
- if (!btd_device_is_initiator(device) && !btd_opts.gatt_client) {
- DBG("GATT client disabled: skipping GATT client");
- return;
+ if (!btd_opts.reverse_discovery) {
+ DBG("Reverse srvc disc disabled: skip GATT client");
+ return;
+ }
+
+ if (!btd_opts.gatt_client) {
+ DBG("GATT client disabled: skipping GATT client");
+ return;
+ }
}
features = BT_GATT_CHRC_CLI_FEAT_ROBUST_CACHING
--
^ permalink raw reply related [flat|nested] 4+ messages in thread