Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp139998pxb; Wed, 20 Jan 2021 03:22:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxh+YOB4yK3j8CrfE7GstJVuRKYHEi+9zCcd63ZP/Nri9PFUNoiRgZn++i3nIMZe2xjgnIQ X-Received: by 2002:a50:ef06:: with SMTP id m6mr6035888eds.216.1611141752094; Wed, 20 Jan 2021 03:22:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611141752; cv=none; d=google.com; s=arc-20160816; b=gSZskGZ+5dfnRpF1knYmP6zbLQXAbx1jiINbnEKbmVkF1ODGxknqwrkpwhJy1/Fi6V /Qam6x6o/uIV0bozIN/m+CJB5dglYr0q3GU/zjWOUZ6fWu1OxnEQukkNObGr5y4h0Z71 jkaOHK2l63avhiQzaTilIEwAqyF4CnarcNFJ4VNxO2orYH9ZddeeUkgWi8D13SiLQdMQ Wa6UlOjSLBVKZl7ibsUKssJdGUOmiPpp2eKWRns12EfKrXtCwQRSSt4eu50DiOA9ay0Y yh+b+bBMOMrW0de0PVzQ0Dft8OuGK7c9HtoaI6tVHICsEoiZwMHEaAsBdOl5bhiQdTb1 u7sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KXnCQaFoN6zYNhlDyZj1ad3fJtl0cQMsuDiNvJ/vr7o=; b=kF5OWdhlyXIgVUYunShXvcmRlOPXnSNlBNSv41kqLlxRXXxgoy3vsgrX6k9SruVLCe IHnd0BuyI+ruY/FxTlsUZVTx6QkOGJY8kIVZjiUiMZ3xH851O4vrT6Hal4ubnpWpiR85 GedEKt/XPTk0B9mrr/dSFVJjIuasD1+jqTVyKXv9tdhiUJoQz5I2pCF3bnaUw5FrQ2EI Fa/VeId1ywo1IzgIHg+AD+GtM69ZdgXvtRuh/Yd8g/kTTp4XKubExlEChWBYAbcR3Y4s nAnQBAVLtCzpdPHARD8ryxXb6+z3JgHZ0hsDIyuczKjUhqM3KkPc46t4N/JGk/b/Suji bUOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CfaWD5R5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn22si722193edb.175.2021.01.20.03.21.13; Wed, 20 Jan 2021 03:22:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CfaWD5R5; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729108AbhATKxB (ORCPT + 99 others); Wed, 20 Jan 2021 05:53:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731352AbhATJan (ORCPT ); Wed, 20 Jan 2021 04:30:43 -0500 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 625BFC061575 for ; Wed, 20 Jan 2021 01:30:02 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id q1so45556016ion.8 for ; Wed, 20 Jan 2021 01:30:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KXnCQaFoN6zYNhlDyZj1ad3fJtl0cQMsuDiNvJ/vr7o=; b=CfaWD5R5FjMdE5mn+dfDRn0c0nkeNHtywsXF+o+Egmn8wq1BJNpu1WEx+mJh4P0FB0 v+7APh3CzKz4nsD3cjUeoguWuVpYqI4V6GXnnQohpnu1X+X32AaAyuIy4P64sXwJ4ipI 4i0XVzlHV7hiXBvQhqxolZ5McnkJeKEKcxTkt3PAIdpiNagLUcb8gzvXkUPhdUGWfn8x JI95OKxwNSgjKn4Zcjfji0Kh7IcKGk9y8YGCMwQSugHaUpthDo0demevS1cBqwLR5o1z yG4wAK9FRwuVjx80jZrrTTE00VmZQTkI/EPg1iz8otbEyvTtTi4qNyfMzuIZta71iese N+fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=KXnCQaFoN6zYNhlDyZj1ad3fJtl0cQMsuDiNvJ/vr7o=; b=SiqH+SsDHtxZJxlDFX5+FbvqGVmS5ESzWz2Gk3sTVF7vxQk/w6Kowf0rKGou+IC5Cp +6hH0zTPE5L8Ii+F7MvxBkIbEx+XDYB5Qmhl711HXNurcwL222WsIh77cHf8O1UaoSKg bfzoipX/TBvhmNiHN319OrhxMxhh/vm/2m0+1bf7DkqCCO86LxhKrBNDnBy0OlJ7VjJx UWSSyWAVlq9jtPNBo3D9NVsOuXGobChVsyqKVen5GPvgHvY7gAI1cv78bvAtljLirrkw jJj7xstW5XJ/r5LyWejXzPEDW+SQdBoUiNdh9VLYFs1L9Ady+7xQTq62VEpeGLTXZwAu 46aA== X-Gm-Message-State: AOAM533sPzGhddz388XLwgpO5E8HWuumIJ15RxgQ1NRv4unE5SJrWkCy 5857cwsC60Mqp92kk84me/DpuD3cuNNdPe1GQW0= X-Received: by 2002:a5d:9041:: with SMTP id v1mr6140724ioq.155.1611135001698; Wed, 20 Jan 2021 01:30:01 -0800 (PST) MIME-Version: 1.0 References: <20210108211513.5180-1-luiz.dentz@gmail.com> <20210108211513.5180-4-luiz.dentz@gmail.com> In-Reply-To: <20210108211513.5180-4-luiz.dentz@gmail.com> From: Sathish Narasimman Date: Wed, 20 Jan 2021 14:59:50 +0530 Message-ID: Subject: Re: [PATCH BlueZ 4/4] gatt: Fix assuming service changed has been subscribed To: Luiz Augusto von Dentz Cc: Bluez mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz On Sat, Jan 9, 2021 at 2:48 AM Luiz Augusto von Dentz wrote: > > From: Luiz Augusto von Dentz > > Unfortunately assuming service changed has been subscribed may cause > indication to time out in some peripherals (Logitech M720 Triathlon, Mx > Anywhere 2, Lenovo Mice N700, RAPOO BleMouse and Microsoft Designer > Mouse) even though the expect actually mandates that the client responds > with confirmation these peripherals just ignores it completely which > leads them to be disconnected whenever bluetoothd is restarted or the > system reboots. > --- > src/device.c | 11 ++--------- > src/gatt-database.c | 2 +- > 2 files changed, 3 insertions(+), 10 deletions(-) > > diff --git a/src/device.c b/src/device.c > index fe885aa64..af13badfc 100644 > --- a/src/device.c > +++ b/src/device.c > @@ -5831,18 +5831,11 @@ void device_load_svc_chng_ccc(struct btd_device *device, uint16_t *ccc_le, > key_file = g_key_file_new(); > g_key_file_load_from_file(key_file, filename, 0, NULL); > > - /* > - * If there is no "ServiceChanged" section we may be loading data from > - * old version which did not persist Service Changed CCC values. Let's > - * check if we are bonded and assume indications were enabled by peer > - * in such case - it should have done this anyway. > - */ > if (!g_key_file_has_group(key_file, "ServiceChanged")) { > if (ccc_le) > - *ccc_le = device->le_state.bonded ? 0x0002 : 0x0000; > + *ccc_le = 0x0000; > if (ccc_bredr) > - *ccc_bredr = device->bredr_state.bonded ? > - 0x0002 : 0x0000; > + *ccc_bredr = 0x0000; > g_key_file_free(key_file); > return; > } > diff --git a/src/gatt-database.c b/src/gatt-database.c > index b7d2bea1d..d99604826 100644 > --- a/src/gatt-database.c > +++ b/src/gatt-database.c > @@ -333,7 +333,7 @@ static void att_disconnected(int err, void *user_data) > handle = gatt_db_attribute_get_handle(state->db->svc_chngd_ccc); > > ccc = find_ccc_state(state, handle); > - if (ccc) > + if (ccc && ccc->value) > device_store_svc_chng_ccc(device, state->bdaddr_type, > ccc->value); > > -- > 2.26.2 > Was this patch is merged? Regards Sathish N