Hi Youwan, On Tue, Jun 21, 2022 at 6:55 AM Youwan Wang <wangyouwan@xxxxxxxxxxxxx> wrote: > > When I use bluetoothctl to remove a device, > I find that the device has not been deleted. > > static void set_temporary_timer(device, 0) > { > ...... > if (!timeout) > return; > ...... > } > > Now I want to delete the connected device > when call remove. > I don't know whether this modification is > feasible, please give me some suggestions. > --- > src/device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/device.c b/src/device.c > index 7b451e458..d38ad74fc 100644 > --- a/src/device.c > +++ b/src/device.c > @@ -3159,7 +3159,7 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type) > DEVICE_INTERFACE, "Connected"); > > if (remove_device) > - set_temporary_timer(device, 0); > + set_temporary_timer(device, 1); > } Don't think this is right, in fact the original code could have been clearer since all we want is to call clear_temporary_timeout thus why we passed 0, perhaps you are after the following fix: https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=5ebc2b5a3e48dbe67a2d315979b096a1b4d1eb99 > guint device_add_disconnect_watch(struct btd_device *device, > -- > 2.20.1 > > > -- Luiz Augusto von Dentz