Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp123023lqj; Thu, 11 Apr 2024 11:35:21 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUDgJc92sUdz7OzTWDv47p0VuulchktmpkFj6UyRg6rIrrMFFEki5aw/Sfm0qe/+Sehd3IAPkGmguGEyV+LqqTZCXAX8Szpx6Lgj+E7mg== X-Google-Smtp-Source: AGHT+IFwUwpdFZP6nltFUEp+2pLc2+C261mLZ7ZXnCZHMHUobzqCJvtGWGVD/epUpF8eu78BVOpj X-Received: by 2002:a05:620a:4ad8:b0:78d:61f1:158d with SMTP id sq24-20020a05620a4ad800b0078d61f1158dmr464183qkn.45.1712860520757; Thu, 11 Apr 2024 11:35:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712860520; cv=pass; d=google.com; s=arc-20160816; b=dj0cOpPvBC+KrwUJWRE+MjO8p4I5Ra0RIJ/2YvIBNavFIcgEbWk4RCNy7kjeFjw5+Z 2tUsZU/a9jrbzQi9rzIRwAjRG9c/f5sgXlrVpYnyAs8G1HWmrE5yUVkXQ9AbIkO53XKU DWCtgCjBg8+M2iK/zR9Tv2blQr47QMDNKyP46gq+c7OZQzSL2iGDZAP7feXlrIlZ/Vwh yT6iWaJDxFGbEqh8Eiehsu1MgyRyoqs9FvOKE/D/Olw6vlmT2w+zPTPZ8cxdlmQkMOC0 dzbSRqJAsq7eiaCItl8i5EAZRjU9+iqaXRnY9aKCc7xxQOntbDKyupmiEoJnpipRARJS /mZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=wOI/F8iDtBdBhXssjS1UcW44VcPujPo0VyuOuDxcVF8=; fh=4lGQI6056MBa4/oovMyIYaKLn+Wz/24RGvUivMmQP8E=; b=I/GqX0Q4+QCkLbk27eqewIU/nVpwAJLsKXM3NSoZZDziVaHVul4Nre5uKNExkESQVo O0XPEiQ36IX0/dt2fEefub6d7icjgj9To9AdmEhtaeDygcuPKyPADkUukaNWOnPf5azp hBV5x6hpMIqSVvu0igDW1S0qGm1EzbEzJ9Vqo0xANbD3SLFcqKfz3x1qfXJe6EcHvJ+r PTqhrqr/2Fs6oXbjUk2BL0xK1Sypc9bbGFoEYMCBR9DRexkMaPOVP6JIZtBV/jJyXDSN MWSgQF/iBH1Rpa7ca6ESxgF7k/PJSRe/hGw9XKw9fj7PIdqP5DqyhTrgApBmvEnZDi+R fLkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TuSC0A4h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id n24-20020a05620a223800b0078d65a42d9bsi1998013qkh.213.2024.04.11.11.35.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:35:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-3493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=TuSC0A4h; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-3493-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-3493-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 7A3081C23466 for ; Thu, 11 Apr 2024 18:35:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0E7D137939; Thu, 11 Apr 2024 18:07:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TuSC0A4h" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E25E3137926 for ; Thu, 11 Apr 2024 18:07:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712858853; cv=none; b=crEhlxTG1kcntwtjFLVtC73Ou+KxwmAMVu703Fivzj7imwK6tM9/p9rcgS2NINELa/FLJndNF5lM/3YsaTSJA3x245+waSDRDDSuTK32oyoQqpV1bH8IPPYnCAsaQMyAY1xxYpQVnFtWdsZFj/LVY3R4BtCGKIkoTP8z1HkA54c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712858853; c=relaxed/simple; bh=kJ4h6rOJ9cgq2Pg3uwNNmPoC9V7YFE295QXlFUvb8yc=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IolufmuzfDQm4miU3EiKCuUi5CR287xiLVeVEsJ5poMhdiv9xrph4hDzt7eHyVWr5SbgxwRe1wqyP9HBKSiiudq22hbCvSoySQ9KL92+OZxxJryVcYGBo7N+QgEQIrpwU82Wzf8HFpmplP02EpxDQ/vTW2YmTuj/bxpm01q2d1U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TuSC0A4h; arc=none smtp.client-ip=209.85.210.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6ea26393116so127033a34.0 for ; Thu, 11 Apr 2024 11:07:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712858850; x=1713463650; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=wOI/F8iDtBdBhXssjS1UcW44VcPujPo0VyuOuDxcVF8=; b=TuSC0A4h9wtx1FedbMTv6YROJyHS1v1lNv+p7B9fZvWWi/V5xo3+fRMF4MomHgZVLk dwCE+MqUScyStbjAZU7KwSC1uw1k6a0uvz+WJdqcLmIDluRR9Akjbv7D3SaXzAB3+kV6 qCOkC2XNgUJGUJ1HIZmuK5/UQfKrmiKgr7kVRPhdwatbHcoYrsdM4r3XWNUnBbWU0khX C/INhrDjc3JWZSDJhe3Y1cd3c5KqfW1lOByqwXgLF01hd87wr9pbed0UPR7ztogaCBpO GS26l6wSp4BA8NtFihk24GG/zVYt6Ix5XBq1bEREmM8uKD78n2cmGASV7QiDL73GVwKG wxVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712858850; x=1713463650; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wOI/F8iDtBdBhXssjS1UcW44VcPujPo0VyuOuDxcVF8=; b=E0bsVfroUlXwtnuO4xX91a6TH4C4XGGgDZ7sWPRLE9pMd2wSr7Nd07BfDrAJSUDvU8 ZbjUNu2mN40ySzllatwIOPtDz+sE1egc9HXmn3dGEChLk804tEWiHau42fsQvssMggRJ NwnkU53PldJlTWkZi2WJKm6U3M1UqZUbFOp51a/0Kk1JztHl0xDxz6509vZTJW46+RGA nfJPJV7hbM125DP9Q9K0lqkz+krRJ/JEuSdny+jhsfvliCVMTUY5QtCSLoH4HssJKWX7 9m/IoV0lfYiVKCbiUZmI3Xu5qIIhecuuVeD/zazbWr7FHTZwBqWnAHYq/z5WVwkAPejE LK8Q== X-Gm-Message-State: AOJu0YyoUY2ioLjbzdcKRYSzeoxcFkFs969TgPJHlWaUbYuEys5lLfm0 QFJAjhiq8DM53qz/GrmBG2Y/x/X39hY4lpFCFmyexof9KgerA/v2RwU+/w== X-Received: by 2002:a05:6808:2b0e:b0:3c3:d80c:ee5f with SMTP id fe14-20020a0568082b0e00b003c3d80cee5fmr301432oib.51.1712858850043; Thu, 11 Apr 2024 11:07:30 -0700 (PDT) Received: from lvondent-mobl4.. (107-146-107-067.biz.spectrum.com. [107.146.107.67]) by smtp.gmail.com with ESMTPSA id z4-20020ab02244000000b007e7b2f8e0b5sm225711uan.13.2024.04.11.11.07.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 11:07:27 -0700 (PDT) From: Luiz Augusto von Dentz To: linux-bluetooth@vger.kernel.org Subject: [PATCH BlueZ v3 3/3] shared/bap: Fix not resuming reading source/sink locations Date: Thu, 11 Apr 2024 14:07:21 -0400 Message-ID: <20240411180721.157181-3-luiz.dentz@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411180721.157181-1-luiz.dentz@gmail.com> References: <20240411180721.157181-1-luiz.dentz@gmail.com> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz If there is and unexpected disconnect and the source/sink locations where left uninitialized this attempts to resume reading them once a new session is attached. --- src/shared/bap.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/shared/bap.c b/src/shared/bap.c index cc1fa1ffbe32..79d9345d9161 100644 --- a/src/shared/bap.c +++ b/src/shared/bap.c @@ -4703,6 +4703,18 @@ clone: } } + /* Resume reading sink locations if supported */ + if (pacs->sink && pacs->sink_loc && !pacs->sink_loc_value) { + if (gatt_db_attribute_get_char_data(pacs->sink_loc, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_sink_pac_loc, + bap, NULL); + } + } + /* Resume reading sources if supported */ if (pacs->source && queue_isempty(bap->rdb->sources)) { if (gatt_db_attribute_get_char_data(pacs->source, @@ -4715,6 +4727,19 @@ clone: } } + /* Resume reading source locations if supported */ + if (pacs->source && pacs->source_loc && + !pacs->source_loc_value) { + if (gatt_db_attribute_get_char_data(pacs->source_loc, + NULL, &value_handle, + NULL, NULL, NULL)) { + bt_gatt_client_read_value(bap->client, + value_handle, + read_source_pac_loc, + bap, NULL); + } + } + queue_foreach(bap->remote_eps, bap_endpoint_foreach, bap); bap_cp_attach(bap); -- 2.44.0