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