2022-05-10 03:53:59

by Youwan Wang

[permalink] [raw]
Subject: [PATCH] device: Fix pairing has failed due to the error of Already Paired (0x13)

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 <[email protected]>
---
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





2022-05-11 22:39:05

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH] device: Fix pairing has failed due to the error of Already Paired (0x13)

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Tue, 10 May 2022 09:27:35 +0800 you wrote:
> 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.
>
> [...]

Here is the summary with links:
- device: Fix pairing has failed due to the error of Already Paired (0x13)
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=4423d63a9634

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html