diff mbox series

[BlueZ,v1,2/3] device: Add btd_device_set_connectable

Message ID 20240125142936.3373953-2-luiz.dentz@gmail.com
State New
Headers show
Series [BlueZ,v1,1/3] btdev: Fix not clearing le_pa_sync_handle on reset | expand

Commit Message

Luiz Augusto von Dentz Jan. 25, 2024, 2:29 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

In case of devices advertising BCAA, aka. Broadcast Source, it shall be
possible to connect to them using something LE Audio Broadcast
procedures so this introduces btd_device_set_connectable so driver can
inform the core when the device is connectable even when it is
advertising using GAP broadcaster role for example.
---
 src/device.c | 5 +++++
 src/device.h | 1 +
 2 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/src/device.c b/src/device.c
index 17bcfbc499aa..afd073c6c2a5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -4495,6 +4495,11 @@  void device_update_last_seen(struct btd_device *device, uint8_t bdaddr_type,
 	set_temporary_timer(device, btd_opts.tmpto);
 }
 
+void btd_device_set_connectable(struct btd_device *device, bool connectable)
+{
+	device_update_last_seen(device, device->bdaddr_type, connectable);
+}
+
 /* It is possible that we have two device objects for the same device in
  * case it has first been discovered over BR/EDR and has a private
  * address when discovered over LE for the first time. In such a case we
diff --git a/src/device.h b/src/device.h
index 8bb38669d457..96f41d47971d 100644
--- a/src/device.h
+++ b/src/device.h
@@ -95,6 +95,7 @@  void device_set_paired(struct btd_device *dev, uint8_t bdaddr_type);
 void device_set_unpaired(struct btd_device *dev, uint8_t bdaddr_type);
 void btd_device_set_temporary(struct btd_device *device, bool temporary);
 void btd_device_set_trusted(struct btd_device *device, gboolean trusted);
+void btd_device_set_connectable(struct btd_device *device, bool connectable);
 void device_set_bonded(struct btd_device *device, uint8_t bdaddr_type);
 void device_set_legacy(struct btd_device *device, bool legacy);
 void device_set_rssi_with_delta(struct btd_device *device, int8_t rssi,