Re: [PATCH BlueZ] adapter: Don't remove temporary devices on disconnect

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

 



Hi,

On Fri, Jul 17, 2020 at 5:50 PM Luiz Augusto von Dentz
<luiz.dentz@xxxxxxxxx> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>
>
> This makes the disconnect logic just update last seen field of the
> device so in case it is temporary it would trigger its timer and be
> removed after the timeout which is consistent with the discovery
> session givin a grace time for application to react to such events.
> ---
>  src/adapter.c | 7 -------
>  src/device.c  | 2 ++
>  2 files changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/src/adapter.c b/src/adapter.c
> index c757447e2..5e896a9f0 100644
> --- a/src/adapter.c
> +++ b/src/adapter.c
> @@ -6837,13 +6837,6 @@ static void adapter_remove_connection(struct btd_adapter *adapter,
>                 return;
>
>         adapter->connections = g_slist_remove(adapter->connections, device);
> -
> -       if (device_is_temporary(device) && !device_is_retrying(device)) {
> -               const char *path = device_get_path(device);
> -
> -               DBG("Removing temporary device %s", path);
> -               btd_adapter_remove_device(adapter, device);
> -       }
>  }
>
>  static void adapter_stop(struct btd_adapter *adapter)
> diff --git a/src/device.c b/src/device.c
> index 470596ee4..2237a7670 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -3039,6 +3039,8 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
>         if (device->bredr_state.connected || device->le_state.connected)
>                 return;
>
> +       device_update_last_seen(device, bdaddr_type);
> +
>         g_dbus_emit_property_changed(dbus_conn, device->path,
>                                                 DEVICE_INTERFACE, "Connected");
>  }
> --
> 2.26.2

Applied.

-- 
Luiz Augusto von Dentz



[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