2022-05-09 13:14:31

by Youwan Wang

[permalink] [raw]
Subject: [PATCH] device: Fix the problem that 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, 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





2022-05-09 14:45:43

by bluez.test.bot

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

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=639748

---Test result---

Test Summary:
CheckPatch FAIL 1.50 seconds
GitLint FAIL 1.00 seconds
Prep - Setup ELL PASS 41.32 seconds
Build - Prep PASS 0.69 seconds
Build - Configure PASS 8.04 seconds
Build - Make PASS 1197.43 seconds
Make Check PASS 11.55 seconds
Make Check w/Valgrind PASS 436.71 seconds
Make Distcheck PASS 226.71 seconds
Build w/ext ELL - Configure PASS 8.17 seconds
Build w/ext ELL - Make PASS 1168.73 seconds
Incremental Build with patchesPASS 0.00 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script with rule in .checkpatch.conf
Output:
device: Fix the problem that pairing has failed due to the error of Already Paired (0x13)
ERROR:OPEN_BRACE: that open brace { should be on the previous line
#77: FILE: src/device.c:3109:
if (!req)
+ {

/github/workspace/src/12843539.patch total: 1 errors, 0 warnings, 12 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

/github/workspace/src/12843539.patch has style problems, please review.

NOTE: Ignored message types: COMMIT_MESSAGE COMPLEX_MACRO CONST_STRUCT FILE_PATH_CHANGES MISSING_SIGN_OFF PREFER_PACKED SPDX_LICENSE_TAG SPLIT_STRING SSCANF_TO_KSTRTO

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: GitLint - FAIL
Desc: Run gitlint with rule in .gitlint
Output:
device: Fix the problem that pairing has failed due to the error of Already Paired (0x13)
1: T1 Title exceeds max length (89>80): "device: Fix the problem that pairing has failed due to the error of Already Paired (0x13)"




---
Regards,
Linux Bluetooth