Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp314012pxb; Wed, 20 Jan 2021 07:39:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJxW41W2ivd0zEBwt/sXnLlY4sbr+zyncaKFzt47CYZkz6PuL22ykXUmLJX0z5PZla7EvreR X-Received: by 2002:a05:6402:212:: with SMTP id t18mr7795772edv.37.1611157170655; Wed, 20 Jan 2021 07:39:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611157170; cv=none; d=google.com; s=arc-20160816; b=NXKSjkdEPi+sCSgsmvya2NxG8yp43mW98/cQqlYjSuH3DnCx01+CHs/IDEp2k4ay+A hqp9lQD9ecif+WGsKKyBOD/PayP2qEFSy05BrHRSPjgpfhXdL0kRDmf4upEi98+HyGTP 4KZVB438l/KMtCu1eBhKLA05pId7AtWcEj2jxoOqNFnQxAbLbzMuFQxmnukgDd0MejW5 3t0zIc1qeZ7L3OzvXUPWn39YvorvMXTm7+0nyactwD6Io8xFpluBA9IeEGB3c59uWM// R4nspCylB87PzZ++qjuP4MoBnbt3En5hyy2RR+UF3o9AJX+R9iLloY7gAXoj7n/SwBU4 cQ0A== 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=0US1jbH1bm0q7yCWHG8YsA4zf/ICaYmHEoNLy36sYSQ=; b=TDmvrxWrHE3o5IyUEG76NL66MA5HfQtmhO82xFeh+BS7K/zeXUji+F5n4rwf7KJPfd TkdX/qbZzPIRPzRekaoxfh+/4FhXOWVnKApstFI5zzXFdPJ4HtGG4HxoKJfDEA565MDo fyHC/0j0nEteBE3BPV5fepUcUxgd58b+IUL+xKU9J7RmsuDIzJ8QmOM+K9ORrtRLtDn7 WxrVnZ4HM8cdn8rfSRoDMjfY/DcIFW1aMLtajlUuUctnLho8wLbfufA3uAklS1AbfJQv Ly3WTQ8ItwdCBWRLJcAjlsBQSxhMfr1F/N4GELQeB6zt/jV6eT7Q++P9D8qay+wFcujS GB4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=I8qJab6y; 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 s24si703371ejd.135.2021.01.20.07.38.57; Wed, 20 Jan 2021 07:39:30 -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=I8qJab6y; 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 S1728981AbhATPgr (ORCPT + 99 others); Wed, 20 Jan 2021 10:36:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730855AbhATPgd (ORCPT ); Wed, 20 Jan 2021 10:36:33 -0500 Received: from mail-ot1-x330.google.com (mail-ot1-x330.google.com [IPv6:2607:f8b0:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A60CC061575 for ; Wed, 20 Jan 2021 07:35:53 -0800 (PST) Received: by mail-ot1-x330.google.com with SMTP id i30so10819179ota.6 for ; Wed, 20 Jan 2021 07:35:53 -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=0US1jbH1bm0q7yCWHG8YsA4zf/ICaYmHEoNLy36sYSQ=; b=I8qJab6y0G5CCxtdyj1fQ0yigM3A+ScdRs2rPBLC2zqcLrPnueTmEuFKEvHAwCwu+d PfkdRt2U8F2oB3P4btmNBCo/QuAWBBhF4NLz8CqAmQHHCYBHAvAH9MK69vkynHCEaTDu dmP46JEqftU0Jj1pl1HbWhFnBHbR2Pzb2jRiPBUtL2BBZOEwbrCq+ivY4uSDAJ7rnASd rnAy3RUN3JQ6HF3+4Jt+A0nEmDrSmAPlUfrJ99VvwUrwsAQm6VN/oA/M/I7tkeWMJfEL xDJE2vszo4zg92ajdTsbIJKOBlJjy7jeMJ26FKRXCFXz5oJu+vw1fD4gEju2a2X03Tx7 m8uQ== 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=0US1jbH1bm0q7yCWHG8YsA4zf/ICaYmHEoNLy36sYSQ=; b=Yxdq3yUln10+1YwzmXKOvvzpXLz9caa0Gi0cthwN950oThXYJDhd4sxMxT5M1PvTGe 2XfA3NCLBdhB+xHmgkjkbGZDIJMaJH+BlInOsh+bsGELUDpDpgu64xecDNM0Mal9MhmE J4DbjzP/hyjiZFEz6iQxC2bbUN+z8TIyFlrj+u/8BwktsNPB44R/CnQL/v0SAfjwpTtl j77w16r865mfMhtQKzvc2O6/PXyy6dZqeO/pR6wvHZxtWFDoQo61FLBLeKmahEHhobzg PXMUAownFinxMaB4X912kIGQZtBA4HT809Rs0XY6VeRd3qiKSBOW2XFcgvu2AtEb1vKN d90w== X-Gm-Message-State: AOAM530pK67sbfuZO38aKnC39gbMaWYDHGWs07vRgP7Kq4jNyl2dorMb 8pTf4XMyqfRamqNexBoTtQswhejmutzSKqqWvsGAgkncE++stQ== X-Received: by 2002:a05:6830:157:: with SMTP id j23mr7666653otp.240.1611156952940; Wed, 20 Jan 2021 07:35:52 -0800 (PST) MIME-Version: 1.0 References: <20210108211513.5180-1-luiz.dentz@gmail.com> <20210108211513.5180-4-luiz.dentz@gmail.com> In-Reply-To: From: Luiz Augusto von Dentz Date: Wed, 20 Jan 2021 07:35:42 -0800 Message-ID: Subject: Re: [PATCH BlueZ 4/4] gatt: Fix assuming service changed has been subscribed To: Sathish Narasimman Cc: Bluez mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sathish, On Wed, Jan 20, 2021 at 1:30 AM Sathish Narasimman wrote: > > 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? Yes, https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=39054d59c0ecdb102f8aa352cb7aa6fcbd7f2b6b > Regards > Sathish N -- Luiz Augusto von Dentz