Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3833202iog; Tue, 21 Jun 2022 06:55:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sHFQvkur8a6Hl0cUa4XsnxYrHt/47fBx5HhAP7CL1ttjCx5NDkMm/ruKMqQ0StePYjM+Y2 X-Received: by 2002:a17:902:c40a:b0:163:d38e:3049 with SMTP id k10-20020a170902c40a00b00163d38e3049mr28986196plk.87.1655819724260; Tue, 21 Jun 2022 06:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655819724; cv=none; d=google.com; s=arc-20160816; b=H2cU5nFYBdiG2XVIMBoFO3ZOM4E6gCb1g7mpsE5nA+lRPvt3KEFXBYPflgV3c83AJV iDG7WZ5AhxvzBvajp7yXSga/FwTcVcD7IO8invMNnvxt3KDHL+ZpryLfZUJLyDYOpoug 5J8Vgudnkamou4HGvY4PJ4zFjiaQYaV/rYVobA5e5jUCPPkU67EcfbHNJIg4HkzRAqVD DddGebrolE5CpylAk2MOwPyzKcC/YjytKJWO3BUJg719p61VS+D9J87QhToZcOQjmHav oQ4gG+hG1QquDPV1Ro8Zw+7EBsSILJuSjePtGCSrSdGcAE4ndn+pINoqEqXdK6TTxKgJ XmgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=rNjDYR5o/EsSH8SOkwC5NZ8cLDqYKhFTIu5Htnte+oU=; b=XHdO5BTXsWKqJF5xUa2mTZmnw6QWPJv/LHCTcWuov3vBW5jcTVFPC3WvwmaMk/yRvG bpAzDUxOoJTjR4xASWeuAxxE3wNQz8eKhPszz3m1aGROqr+gZk7jHcqzRAmQC+D8vhZK m6hvEhJLSgLBfsAQJ8rgP6ZbwAmeY+1IroZlyzGoS6UtG9FayG0bjD3Q4QxhKXCxdN/k s7v16COX6wVyEXsstmS/OZmFAzzDBVHSPG2WtdxWfQD6TFZRRhdSRnJm6O+74cZrnYTc d5rfNEYgha4gYtR4VLqhlzQhnEQV+6HFoc+4KPyf41U6L8SteAvcMUzm/VnY4uefO2Ir bBUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a63f509000000b00402854961afsi18550115pgh.366.2022.06.21.06.54.53; Tue, 21 Jun 2022 06:55:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230506AbiFUNsq (ORCPT + 99 others); Tue, 21 Jun 2022 09:48:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351453AbiFUNsp (ORCPT ); Tue, 21 Jun 2022 09:48:45 -0400 Received: from smtpproxy21.qq.com (smtpbg701.qq.com [203.205.195.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7510963CB for ; Tue, 21 Jun 2022 06:48:43 -0700 (PDT) X-QQ-mid: bizesmtp74t1655819312ti55rqcd Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 21 Jun 2022 21:48:22 +0800 (CST) X-QQ-SSF: 00400000002000C0D000B00A0000000 X-QQ-FEAT: Oygdsb2PWc44IuOgY+h9uwUMDsF/xM7B03uo2HjN7A3LdzT7IZAR/lTR4e+1k FKQ6oxExjdO8VJreG1AtTVi+v2hOGWZkyZXsglcD3XxxHOuNS+xI+fsLk5Ueeu21UVmIN1B 5PtptYJkAcErLZMmKJpyBaK/YewlWiM66QF7hgEteF2LxOE17rEE2x6Ff1clbbPxhTlR5e4 JuXd3KixeCOBKe65x0rLScgUqN2i9nW5Er3SMmUk6/pO6R6xVUzJtPTBa2krBlvDYXUu/N3 zRGi4VTsGuMjPX4s9bo5f+ppAqZ7cf1QyNfP4YfwLNMtXYeipjsC+CHVoj8wCttS9cLdbCS b+npsjOrBFiOrAnisU= X-QQ-GoodBg: 2 From: Youwan Wang To: linux-bluetooth@vger.kernel.org Cc: Youwan Wang Subject: [PATCH] device: Fix timeout=1 to remove the device immediately Date: Tue, 21 Jun 2022 21:48:18 +0800 Message-Id: <20220621134818.11515-1-wangyouwan@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org  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); } guint device_add_disconnect_watch(struct btd_device *device, -- 2.20.1