Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4980833iob; Mon, 9 May 2022 06:14:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQ3ff5DrB1UaQLlq4ulVGko8drazUfFYHwHoSGOJBVjFsIkP5elPhwzcqqDixe3tnVrMQn X-Received: by 2002:a17:902:c404:b0:15e:9607:667b with SMTP id k4-20020a170902c40400b0015e9607667bmr16013728plk.135.1652102071545; Mon, 09 May 2022 06:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652102071; cv=none; d=google.com; s=arc-20160816; b=NHVy6mAFxesWo2y3rhmeKhQxoLFcSmQ4m2iAZoRa3jjUYNVm/GFMoam0XYggQjsdEi cRn8FNMENMK/YmkquS027B4lDzeXFmFBnpZC1y7LLp6TET/JwRsts3o7e/NRaCW5o2iU x3nZQd6HIxiUdypHEUCauYSiK/LzTc1M+MyXBOnFYTGHsX5LIgn/sktlcO6dTB79XMHo 9Ho23t630pu5sc4z1iry3QmX67ZL8b1oF45/F5h6o7Hs2hJwuzqNaaWwINAZb05cQwla 2sUUL6oGfCBQHo5jyo0U4tlC1ma+Ure6a67a+sSR8fTwo95AhLSZoy0hQlTuGoOp5rNG kUdw== 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=pEAYNQ2hkfnyP9doq2GqCsT4noqWkFYfo4QgDJqAn+s=; b=XpsIRqmx5m7LzKpC/iJfCn4mZm262s9VMteDk4HUwH4KBsl2qRtr/JDQNHVr+1WVnC r1w10i+aTB7NRFsimCqqu6cod+7NxeBgWo7bDeyfN7XWtN5vPwu0g024u/HivrPBJ5dS PvbIakkgBqUXAwrsc4vuQQwc+QNhE8nPp2FzuQaz7EXRHooGddlUqoHqWp5SCYOOVOK0 cSqOv3i4sw9PNGGB76G5LRD5A4gvdLIySYUJmYyaaBUe1GAeG/3TrlFk1x0AWLGbk99b xaW67FSVr2R5aUHt7Px1DUofK6bRDiXysibG3v79JqZE+50SmVnmqTMWoJbOfYnc5Fur YPOA== 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:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id qe4-20020a17090b4f8400b001c6a8e39741si21527502pjb.138.2022.05.09.06.14.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 06:14:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 000BA1BA8F6; Mon, 9 May 2022 06:13:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235301AbiEINRa (ORCPT + 99 others); Mon, 9 May 2022 09:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234316AbiEINR3 (ORCPT ); Mon, 9 May 2022 09:17:29 -0400 Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB0081B1F60 for ; Mon, 9 May 2022 06:13:34 -0700 (PDT) X-QQ-mid: bizesmtp78t1652102006tia3f2ix Received: from localhost.localdomain ( [113.57.152.160]) by bizesmtp.qq.com (ESMTP) with id ; Mon, 09 May 2022 21:12:52 +0800 (CST) X-QQ-SSF: 00400000002000B0D000B00A0000000 X-QQ-FEAT: RKCwGdK8Yficw090mszTO6r6yITclOhvVTCgkfv5o6awD7CH0w4w7wTGBbb+v yEEbdom/jfdkkiOow505z0xD2ACkcERpku6bWRVHKfwgsKkqJG4YRtexmaWzVwqCaF1Rlrs Spi2pqrg5WSJk1FZ07L0PH8sEUGxuX89l7RllEhej6YzlXwJBKjZixpkGX4w47K9pqXIaiD rYdawYduxUA6Z+75WJP8svqnbSceTEnZaz52pUdUo6yaBpXKcl5SgbQ8wnfbFHkR04l45tf JHE2nEDcCE0J0RFWErbX+xZBBCgzxOYiUBO7KKzSI5GVHkxKlPp+DXxG/1NIL3YB/LnyLB9 zSnazwJ X-QQ-GoodBg: 2 From: wangyouwan To: linux-bluetooth@vger.kernel.org Cc: wangyouwan Subject: [PATCH] =?UTF-8?q?device:=20Fix=20the=20problem=20that=20pairing?= =?UTF-8?q?=20has=20failed=20due=20to=20the=20error=20of=E3=80=80Already?= =?UTF-8?q?=20Paired=20(0x13)?= Date: Mon, 9 May 2022 21:12:39 +0800 Message-Id: <20220509131239.12189-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:qybgforeign9 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, 5 insertions(+) diff --git a/src/device.c b/src/device.c index 6da5c380b..cd150ec3e 100644 --- a/src/device.c +++ b/src/device.c @@ -3107,7 +3107,12 @@ static DBusMessage *cancel_pairing(DBusConnection *conn, DBusMessage *msg, DBG(""); 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