summaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorwangyouwan <wangyouwan@uniontech.com>2022-05-10 09:27:35 +0800
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-11 14:34:53 -0700
commit4423d63a9634e62cb41d1b1b53cf360edd927f98 (patch)
tree79627c3c320120f289137a9a23c2809bd5a6d075 /src/device.c
parent42e9b8db92d5d8725e9a1bfd93a5c6a257186776 (diff)
downloadbluez-4423d63a9634e62cb41d1b1b53cf360edd927f98.tar.gz
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.
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/device.c b/src/device.c
index 7114e1b3e..b0309a1e7 100644
--- a/src/device.c
+++ b/src/device.c
@@ -3107,8 +3107,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);