From: wangyouwan <wangyouwan@uniontech.com>
To: linux-bluetooth@vger.kernel.org
Cc: wangyouwan <wangyouwan@uniontech.com>
Subject: [PATCH] device: Fix pairing has failed due to the error of Already Paired (0x13)
Date: Tue, 10 May 2022 09:27:35 +0800 [thread overview]
Message-ID: <20220510012735.1698-1-wangyouwan@uniontech.com> (raw)
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 <wangyouwan@uniontech.com>
---
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
next reply other threads:[~2022-05-10 1:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-10 1:27 wangyouwan [this message]
2022-05-10 3:01 ` device: Fix pairing has failed due to the error of Already Paired (0x13) bluez.test.bot
2022-05-11 21:40 ` [PATCH] " patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220510012735.1698-1-wangyouwan@uniontech.com \
--to=wangyouwan@uniontech.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.