[PATCH BlueZ v3 3/4] src/device: Added function to set connection parameters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Felipe F. Tonello" <eu@xxxxxxxxxxxxxxxxx>

This function allows plugins to set the connection parameters of the
respective btd_device object.

It is useful for GAP Peripheral Preferred Connection Parameters
characteristic for example.
---
 src/device.c | 14 ++++++++++++++
 src/device.h |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/src/device.c b/src/device.c
index 1d4b8ab36720..79d8bb7ebc9b 100644
--- a/src/device.c
+++ b/src/device.c
@@ -7322,3 +7322,17 @@ void btd_device_foreach_ad(struct btd_device *dev, bt_ad_func_t func,
 {
 	bt_ad_foreach_data(dev->ad, func, data);
 }
+
+void btd_device_set_conn_param(struct btd_device *device, uint16_t min_interval,
+					uint16_t max_interval, uint16_t latency,
+					uint16_t timeout)
+{
+	btd_adapter_store_conn_param(device->adapter, &device->bdaddr,
+					device->bdaddr_type, min_interval,
+					max_interval, latency,
+					timeout);
+	btd_adapter_load_conn_param(device->adapter, &device->bdaddr,
+					device->bdaddr_type, min_interval,
+					max_interval, latency,
+					timeout);
+}
diff --git a/src/device.h b/src/device.h
index 5722ca9cafe0..1a9f7e72a00f 100644
--- a/src/device.h
+++ b/src/device.h
@@ -204,3 +204,6 @@ typedef void (*bt_device_ad_func_t)(void *data, void *user_data);
 
 void btd_device_foreach_ad(struct btd_device *dev, bt_device_ad_func_t func,
 							void *data);
+void btd_device_set_conn_param(struct btd_device *device, uint16_t min_interval,
+					uint16_t max_interval, uint16_t latency,
+					uint16_t timeout);
-- 
2.44.0





[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