2023-12-22 03:11:30

by 15013537245

[permalink] [raw]
Subject: [PATCH] [BlueZ] adapter: Fix airpod device pair fail

From: clancy shang <[email protected]>

Airpod is performing inquiry scans in BR/EDR and advertising in a unconnectabl
mode whit the same public address at the same time. with this featrue, when
found airpod device, set the bredr support, fix it pair fail bug.

Signed-off-by: clancy shang <[email protected]>
---
src/adapter.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)

diff --git a/src/adapter.c b/src/adapter.c
index 022390f0d..79ca75315 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -7066,6 +7066,24 @@ static void adapter_msd_notify(struct btd_adapter *adapter,
}
}

+#define APPLE_INC_VENDOR_ID 0x004c
+static bool eir_msd_is_apple_inc(GSList *msd_list)
+{
+ GSList *msd_l, *msd_next;
+
+ for (msd_l = msd_list; msd_l != NULL; msd_l = msd_next)
+ {
+ const struct eir_msd *msd = msd_l->data;
+
+ msd_next = g_slist_next(msd_l);
+
+ if(msd->company == APPLE_INC_VENDOR_ID)
+ return true;
+ }
+
+ return false;
+}
+
static bool is_filter_match(GSList *discovery_filter, struct eir_data *eir_data,
int8_t rssi)
{
@@ -7281,6 +7299,12 @@ void btd_adapter_device_found(struct btd_adapter *adapter,
device_update_last_seen(dev, BDADDR_BREDR, !not_connectable);
}

+ if(eir_msd_is_apple_inc(eir_data.msd_list) &&
+ (not_connectable == true) && (bdaddr_type == BDADDR_LE_PUBLIC)){
+ device_set_bredr_support(dev);
+ device_update_last_seen(dev, BDADDR_BREDR, true);
+ }
+
if (eir_data.name != NULL && eir_data.name_complete)
device_store_cached_name(dev, eir_data.name);

--
2.25.1



2023-12-22 04:06:55

by bluez.test.bot

[permalink] [raw]
Subject: RE: [BlueZ] adapter: Fix airpod device pair fail

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=812362

---Test result---

Test Summary:
CheckPatch FAIL 0.70 seconds
GitLint PASS 0.32 seconds
BuildEll PASS 23.81 seconds
BluezMake PASS 692.73 seconds
MakeCheck PASS 11.60 seconds
MakeDistcheck PASS 159.04 seconds
CheckValgrind PASS 221.20 seconds
CheckSmatch PASS 325.12 seconds
bluezmakeextell PASS 105.74 seconds
IncrementalBuild PASS 652.81 seconds
ScanBuild PASS 917.36 seconds

Details
##############################
Test: CheckPatch - FAIL
Desc: Run checkpatch.pl script
Output:
[BlueZ] adapter: Fix airpod device pair fail
WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#50:
Airpod is performing inquiry scans in BR/EDR and advertising in a unconnectabl

ERROR:SPACING: need consistent spacing around '*' (ctx:WxV)
#68: FILE: src/adapter.c:7070:
+static bool eir_msd_is_apple_inc(GSList *msd_list)
^

ERROR:TRAILING_WHITESPACE: trailing whitespace
#72: FILE: src/adapter.c:7074:
+^Ifor (msd_l = msd_list; msd_l != NULL; msd_l = msd_next) $

ERROR:OPEN_BRACE: that open brace { should be on the previous line
#72: FILE: src/adapter.c:7074:
+ for (msd_l = msd_list; msd_l != NULL; msd_l = msd_next)
+ {

ERROR:SPACING: space required before the open parenthesis '('
#78: FILE: src/adapter.c:7080:
+ if(msd->company == APPLE_INC_VENDOR_ID)

ERROR:TRAILING_WHITESPACE: trailing whitespace
#92: FILE: src/adapter.c:7302:
+^Iif(eir_msd_is_apple_inc(eir_data.msd_list) && $

ERROR:SPACING: space required before the open parenthesis '('
#92: FILE: src/adapter.c:7302:
+ if(eir_msd_is_apple_inc(eir_data.msd_list) &&

ERROR:SPACING: space required before the open brace '{'
#93: FILE: src/adapter.c:7303:
+ (not_connectable == true) && (bdaddr_type == BDADDR_LE_PUBLIC)){

/github/workspace/src/src/13502864.patch total: 7 errors, 1 warnings, 36 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.

NOTE: Whitespace errors detected.
You may wish to use scripts/cleanpatch or scripts/cleanfile

/github/workspace/src/src/13502864.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.




---
Regards,
Linux Bluetooth