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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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






[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux