Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp760152rdb; Fri, 22 Dec 2023 04:27:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IERpIK653pYTQrIWvTHX4+uRxtiFE4GGCz7XOHwQpRq423TGjEpLvaX2X/2g891ReLtTc4C X-Received: by 2002:a17:906:3481:b0:a26:9722:941c with SMTP id g1-20020a170906348100b00a269722941cmr708268ejb.120.1703248024022; Fri, 22 Dec 2023 04:27:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703248024; cv=none; d=google.com; s=arc-20160816; b=hBhA0PLtjgylsid0fXTJNQhvciSPTTRPLis+3Jk9BIHS0YjXRDPsRI/OJuMkgHlWSi jehNfmLIiNtY4+taIe8hpXKIaPNlUe8TgMJHqdUTvN0G7VcgyUd1LnFBIAYXTIJfioYE xNTSWgmPcbdQfV9N1fqaJOXyC9WcEcFBYUlTTKL9gRPMHWyWPsohb7S6bDBzQ9Za+gWy gwwUctS2K1mKYKHI3NgJA7URS6yiPNNxak8RR3glmrQB94e2qsolj/ed45V/0sGkgrQ1 qfw7J3d/h1NMjMEzSlyW6iOUv5CjCsA6ZPm2MKnKalu7ui6CBY9LivPTsjd8KvJ0Ht7j V3qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=U6UE7W8lNr1pKczG4wkaVhk1T4QWAMPmASS4Q7nGxR8=; fh=16sGZL1pn4fRN4zGX5hPbJLmgvxojMXQupZcsByQD/Q=; b=uwLsMyIojFgrM1gIJmNIo2lL1SVhPu1VCna2ppB556AFtd9zCy1SWiDQZTWa/3D1Ma 373StNxfBUY3p09gWZ8bmsoWbmv5i1AdKQgZkaVkpYipyWdI1SpXRktBQpgo/ghkzyh1 e01/RUvET4x1yTNcq05EGJsfI2pBYXXD5bi5ypJgEu1O4kFM3laErnlTM6mezz7OxB/4 3n5nmLa7UYCwcqh+cFiNmMTupvH9ZPOO8Gqa/zm6rlsGP0pGs7u+JTLRyXHdXkY7rt8S HZEEoIfrJuSM6bkj0+v5kmqg7K6Bn7ixzHRSK0njtgsPpSXzcNG+YKTpO53GRr9gDwKr 8IMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth+bounces-715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-715-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ov18-20020a170906fc1200b00a234c908275si1793289ejb.725.2023.12.22.04.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 04:27:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth+bounces-715-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-715-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B5B211F22E63 for ; Fri, 22 Dec 2023 12:27:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3A05E18049; Fri, 22 Dec 2023 12:26:58 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67F0918026 for ; Fri, 22 Dec 2023 12:26:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [141.14.220.40] (g40.guest.molgen.mpg.de [141.14.220.40]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 34D3761E5FE01; Fri, 22 Dec 2023 13:25:58 +0100 (CET) Message-ID: <57815c6d-829b-4075-9d14-f9cfc9036017@molgen.mpg.de> Date: Fri, 22 Dec 2023 13:25:56 +0100 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [BlueZ] adapter: Fix airpod device pair fail Content-Language: en-US To: 15013537245@163.com Cc: linux-bluetooth@vger.kernel.org, zhongjun.yu@quectel.com, Clancy Shang References: <20231222054515.1266741-1-15013537245@163.com> From: Paul Menzel In-Reply-To: <20231222054515.1266741-1-15013537245@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Dear Clancy, Thank you for your patch. Some nits below. Am 22.12.23 um 06:45 schrieb 15013537245@163.com: > From: Clancy Shang > > Airpod is performing inquiry scans in BR/EDR and advertising in a > unconnectabl mode whit the same public address at the same time. a*n* unconnectabl*e* mode w*ith* > with this featrue, when found airpod device, set the bredr support, feat*ur*e > fix it pair fail bug. Do the Airpods follow the Bluetooth specification, or do they violate it, and need a workaround? > > Signed-off-by: Clancy Shang > --- > src/adapter.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/src/adapter.c b/src/adapter.c > index 022390f0d..488355e9c 100644 > --- a/src/adapter.c > +++ b/src/adapter.c > @@ -7066,6 +7066,25 @@ 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) { > + The blank line seems unnecessary. > + 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 +7300,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)) { No idea, if there is a rule, but other instances put the && on the line above, and align the condition with the one in the first line. > + 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); > Kind regards, Paul