Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5564966iob; Mon, 9 May 2022 20:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwanuQfao9L0Xcx4flMX+xei01JOh8QaHsf8r0pvvs7hvFWZyV4GkqrIgPDSvZUb/1OnBes X-Received: by 2002:a05:6402:2078:b0:428:1071:d9b2 with SMTP id bd24-20020a056402207800b004281071d9b2mr21483592edb.302.1652154839707; Mon, 09 May 2022 20:53:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652154839; cv=none; d=google.com; s=arc-20160816; b=KKIXZ+WYTI0+liZaqyXXCTqZLQLGfJhtlWsOtXmCcaD12YVMnGZVbIuMfbvNOAnOS6 FnRjKkIU/clC4HZ2rgLqkFaSiR6NFYTU6j21DJkxxebZXJeZok6o0Lo1zIn18U5EswZl NUmrEuVXzcfZkNqo5KBcz0ygaOA558Qp8zs16uR5V89jtvMV9BbvL5M0tKga7edToAdh LXEkQsJNe/dzvPsJEMmFPvgGwjJ6vr3P8fW+DgPg4EUV4cAuItbyL7eDlcb33TgJ2uFW iL0P/CvrvFfvwHWLNWDjPapNX3/aWDVcQU42I+QS9MhvfrXjKiaQD4KCB5wdDBv16+g2 mozg== 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=5q1K6U34GbqmssBNiQWu2HuOeQhx1B9TZokKu0asRHs=; b=o5MKN9DsrJXw6tva4eP259zQoLfuE8URyVTVzp9oEjsEv8ldASXo4XolLSNhqZlN/J VTzvGWhbJ9fMT7Kis+JurmjRhsB+HpQE1ym6ZB/LlqIXfDqm2RXE40HedHF8hJGZucZM 04eCsxQi1BIvYLjEiEYhEIghxbr8q4a6CMmq8f7GCPlUoSJ02kglTCEdK640SVdw6nQQ C9LHQSSihYngJabpSrdGCycESpPD9eINKZ5RND8BIcJyPI0o3lG6R3oPyR2YRc0jQIQA EhpzlmFBQjSNJT6qam4jHm/b8ZOnmzKL5ZfXS8IFH+0B9WUCJI4zQNTPNHg5WSKT3tTJ eBZw== 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 i21-20020a05640242d500b00418c2b5bf21si19864887edc.515.2022.05.09.20.53.16; Mon, 09 May 2022 20:53:59 -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 S232729AbiEJBbs (ORCPT + 99 others); Mon, 9 May 2022 21:31:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234237AbiEJBbr (ORCPT ); Mon, 9 May 2022 21:31:47 -0400 Received: from smtpproxy21.qq.com (smtpbg704.qq.com [203.205.195.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4549D1F0DE3 for ; Mon, 9 May 2022 18:27:50 -0700 (PDT) X-QQ-mid: bizesmtp76t1652146064t83f7f86 Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 10 May 2022 09:27:38 +0800 (CST) X-QQ-SSF: 01400000002000B0D000B00A0000000 X-QQ-FEAT: qfvbM89F700eyl2J/3OYA54UGqiawKMQ7Mn2PjbZg2BA7qG/UVdJXt5kA0J3e n1up7jB9ozlg3WfPtDmHxtnyYs/bVJ29PN3hasRNcDUgyzc8yEku4rQojfBedEQwsWDG2Ek ZFqwyFSdpQ56iSLenjv3DnIumBGWfgYd5SPlemklV+puF/jNE0aF08mEx6a5gaN30KzBEIG 3qOKxGkhVHA+nF74aZ2RgZSUDcJtrTiqnaiFqmGaErqmw/i6QRQVwCMpL+YpfZJlPI1LhIJ TfNBYG6lZWn2eb65MfaiCjOiiR3jCg7rj7aeZE3BSGsk+hWz+nsAGgT5dC0Giud8LlDg== X-QQ-GoodBg: 2 From: wangyouwan To: linux-bluetooth@vger.kernel.org Cc: wangyouwan Subject: [PATCH] device: Fix pairing has failed due to the error of Already Paired (0x13) Date: Tue, 10 May 2022 09:27:35 +0800 Message-Id: <20220510012735.1698-1-wangyouwan@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign9 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 After connect the Bluetooth mouse, open two Bluetoothctl at the same time, when remove the mouse, quickly go to power off, try to paired the mouse again when I was power on, found that the error 0x13 was always reported. try to connect directly,can connect successfully. but use the info command to query the information of the mouse and find that the pairing status of the mouse is No. so I try to delete the paired information in the kernel through the "* cancel_pairing()" interface. Signed-off-by: wangyouwan --- src/device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index 6da5c380b..f3ce55eff 100644 --- a/src/device.c +++ b/src/device.c @@ -3106,8 +3106,11 @@ static DBusMessage *cancel_pairing(DBusConnection *conn, DBusMessage *msg, DBG(""); - if (!req) + if (!req) { + btd_adapter_remove_bonding(device->adapter, &device->bdaddr, + device->bdaddr_type); return btd_error_does_not_exist(msg); + } device_cancel_bonding(device, MGMT_STATUS_CANCELLED); -- 2.20.1