Re: [PATCH v2 BlueZ 3/7] src/device: Added function to set connection parameters

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

 



Hi,

On 16/02/17 18:03, Felipe F. Tonello wrote:
> 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 | 16 ++++++++++++++++
>  src/device.h |  4 ++++
>  2 files changed, 20 insertions(+)
> 
> diff --git a/src/device.c b/src/device.c
> index 8693eb826b54..d4aa7f90561e 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -6122,3 +6122,19 @@ void btd_device_cleanup(void)
>  {
>  	btd_service_remove_state_cb(service_state_cb_id);
>  }
> +
> +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_assert(device != NULL);

This assert shouldn't be here. I'll fix next revision.

> +
> +	adapter_store_conn_param(device->adapter, &device->bdaddr,
> +					device->bdaddr_type, min_interval,
> +					max_interval, latency,
> +					timeout);
> +	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 3cab366eeaea..88076d2d196d 100644
> --- a/src/device.h
> +++ b/src/device.h
> @@ -163,3 +163,7 @@ int btd_device_connect_services(struct btd_device *dev, GSList *services);
>  
>  void btd_device_init(void);
>  void btd_device_cleanup(void);
> +
> +void btd_device_set_conn_param(struct btd_device *device, uint16_t min_interval,
> +					uint16_t max_interval, uint16_t latency,
> +					uint16_t timeout);
> 

-- 
Felipe

Attachment: 0x92698E6A.asc
Description: application/pgp-keys


[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