Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3131655pxb; Tue, 13 Apr 2021 20:18:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAqEWdjrYWl79qFx1dppf2mfJCHXuItHZGTcsNw/orIBzV+KYrK8lpTfcQVBM/IvHTVVzt X-Received: by 2002:a17:90a:2e0d:: with SMTP id q13mr1101973pjd.225.1618370287846; Tue, 13 Apr 2021 20:18:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618370287; cv=none; d=google.com; s=arc-20160816; b=LGIa4f5Oxnm84Gf5SDz8xVpYadQkeCM2ZEQ5cc+1tGl/4k3YHdgq/orx6y55VMfgPR kb63+6jz3fo1sJj30/gLDk8bAhrThSLFeSxhuZEekD9wsTRq01MajwBY9f9ao++greaD FUAw8P86Q4SrYO7EQl9iNBkkXZ7cnW96dDRmuUJ1ZgqLM9pGpP2j8Acvs5kq0QPvhXSu oZOI7eEELU5F/EvRZeVnwF/FD1hN9eEURZxcu+4T8x7t2FBdnlGWRm0NAnNmP38fdy29 zwBjgxAcjsVAehlqAfCa7upP1tod/vA9pfNZjbqruv19lDfHjET7BcigS2+v08ylNpLz 8lYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5uHiRLeZzAv5M3e25T0ivzloHaMjuhDcrnjFs/WF3RE=; b=z8/LalZPr+aBi3VreBc5QO+AR4IUiK+925nyqOuTfkjR6nrOfqKcB4vLyoAazgaeYK P8UyF4E2JEJSYMC1jMbA88MonNS1IbHQ/04QcxrmkUA4FNCCWNOAY4GJhwm91bYrxxvc vYgYxTHi3JndADOAm8F1s6FPJCgpepo/uWSvtC28jsM248L0I37cKVFIkVBzLD54W8s9 JFVsFJv5yPU6Iz9321e425rYRy4Yo0T8MwVGsHDGDZhDrFMOzYnOaSEVQCCG/PzwO42E jFQ9yWrk30xiqF9iKcom6E15sLB275mwFgQKkePzJ+VSjC/nUcRSWkdRnFxRW+qQ10Fd vtOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ysrf5DuA; 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 j16si21717878pfi.107.2021.04.13.20.17.37; Tue, 13 Apr 2021 20:18:07 -0700 (PDT) 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=Ysrf5DuA; 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 S243246AbhDMRT0 (ORCPT + 99 others); Tue, 13 Apr 2021 13:19:26 -0400 Received: from mail-il1-f177.google.com ([209.85.166.177]:43689 "EHLO mail-il1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347114AbhDMRTL (ORCPT ); Tue, 13 Apr 2021 13:19:11 -0400 Received: by mail-il1-f177.google.com with SMTP id d2so14700626ilm.10 for ; Tue, 13 Apr 2021 10:18:51 -0700 (PDT) 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:content-transfer-encoding; bh=5uHiRLeZzAv5M3e25T0ivzloHaMjuhDcrnjFs/WF3RE=; b=Ysrf5DuAYJbgAI7PDnPGqbbds9TqMTSzYgTIheqAC5hc7nx9DR4Rlph8sTQe2EU6Qm gS7HomaFzuoP0Okc/PJ9/9yxXlS2DCVJAJd7N03ZuPptQHz3/l03Uswrfh5OgqYX3C0g +XUEzqIUVeJJEV3IWLHzSWFvhK3WmLJcVZRHtrupPnhy1HQ1nDAdMxrjIakJKXJd6Rd6 qINNDquYc8rzBtDorsp1N3X0DnIX772Nolz9lctmr67intWFqkioj8KWawrVH0iOhzVD gEanZtyb52d4FiRextgYWrgk93I4xGTi8K8SUoW4kz5ybXQ/Y/ZLcAYF7xi/AO/V8O80 FdDA== 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:content-transfer-encoding; bh=5uHiRLeZzAv5M3e25T0ivzloHaMjuhDcrnjFs/WF3RE=; b=EPWZqU2h/BbS9f1ftAqYOufi1w0lP5vS2d+pSBh3vu62T2nKh6D+yswIBrziDY87Mx c8AlqV3G82egE1MRClcwoSoB4nEweEN/RpVhjTVw2Ep+h829RymrbHAH62XghrdXq690 ugqkH7JYnd56rSdsnUM87Zgau+/0iJhU06kmS0VhZq+fVT3JU1ayKHNt83yNeTT1uHc9 c8zogmspG0288UCuUNPnPW7TBJqMGddwbr4u6VcaE/PBNXApW4YpkycUxo49X+x3JX27 c3keZLNbVUViFWL7RxJjPro7NdcXBFIrQGwZ9p9F2dz67A31fjwyJsgR1Vsa+OOmE2UH 0N+w== X-Gm-Message-State: AOAM533PgHYWRqkRaiW/a+h713ipE/JgqaPNYmEmDBwTMi99t8RzFr1/ VCQ6uu1ewgo3Tmm2/OTjX6dZ2d5CDNg6K9vrhw== X-Received: by 2002:a05:6e02:2197:: with SMTP id j23mr818036ila.269.1618334271738; Tue, 13 Apr 2021 10:17:51 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Kenny Bian Date: Tue, 13 Apr 2021 10:17:40 -0700 Message-ID: Subject: Re: Disabled bluetooth cache. But the app still getting wrong data? To: Jamie Mccrae Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Jamie, Thank you for your email. Do you know how to add "Service Changed Indication"? We would like to support that. But we don't know how to do it. In fact, I posted the question before: https://www.spinics.net/lists/linux-bluetooth/msg89959.html. It seems "If you are registering the services with Bluetoothd then it should generate the service change". Our GATT server is based on https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-s= erver. By saying "registering the services", does it mean our code should call "RegisterApplication()"? We did call RegisterApplication(). But we never saw the "[ServiceChanged]" section(https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/setting= s-storage.txt#n321). Please let us know if you know how to add "Service Changed Indication". Thanks! Kenny Kenny On Mon, Apr 12, 2021 at 11:39 PM Jamie Mccrae wrote: > > Hi Kenny, > Why not just add the service changed indication as you refer to below? It= was purposely designed for this specific purpose, you're trying to work ar= ound an issue created because you don't want to use the feature that preven= ts this issue. Any workaround is just that, a workaround, and might not wor= k as intended. > Thanks, > Jamie > > -----Original Message----- > From: Kenny Bian > Sent: 13 April 2021 06:59 > To: linux-bluetooth@vger.kernel.org > Subject: Disabled bluetooth cache. But the app still getting wrong data? > > EXTERNAL EMAIL: Be careful with attachments and links. > > Previously we had an issue: if there is a change of characteristics in th= e new build of our firmware, then the app will get the wrong data. > By saying changed characteristics, it can be an added or removed characte= ristic, or adding notification to an existing characteristic. > In order to keep the pairing information, the "/var/lib/bluetooth" > folder is copied over to the new build's partition. We realized that ther= e is no "service changed indication". The app can't handle the changed serv= ices. So we disabled the bluetooth cache by set this in > "/etc/bluetooth/main.conf": > [GATT] > Cache =3D no > > But recently, we saw the problem again even if the bluetooth cache is > disabled: in the build number 101, a characteristic is removed. But when = we upgrade the build from 100 to 101, the app gets the wrong data. We looke= d at the log. When the app tries to read temperature by using the temperatu= re UUID, somehow the bluetooth service we created received the request to r= ead the "device name"(device name UUID). So the "device name" is returned t= o the app as the temperature. This looks like the same behavior as the blue= tooth cache is not disabled. I looked at the "/var/lib/bluetooth/[BT_MAC]/c= ache" folder. There is no "[Attributes]" section in the files in the folder= . That means the disabled cache seems working. > > The only way to fix this issue is to force exit the mobile app on the pho= ne and "Forget This Device" in iOS or "Unpair" in Android. > > I looked at the btmon(see attached). For the working btmon log, there is = "Attribute group list: XX entries" under "ACL Data TX". But there is no "At= tribute group list: XX entries" under "ACL Data TX" in the attached problem= atic btmon log. > > Questions: > 1. How is it possible that this still happens even if the bluetooth cache= is disabled? > 2. Is this the problem on the Linux side which runs the GATT server or on= the mobile side? > 3. Is there anything else we should look into? > > We're going to release our product soon. This is a critical issue for us.= Please help if you have any suggestions. > > Thanks! > THIS MESSAGE, ANY ATTACHMENT(S), AND THE INFORMATION CONTAINED HEREIN MAY= BE PROPRIETARY TO LAIRD CONNECTIVITY, INC. AND/OR ANOTHER PARTY, AND MAY F= URTHER BE INTENDED TO BE KEPT CONFIDENTIAL. IF YOU ARE NOT THE INTENDED REC= IPIENT, PLEASE DELETE THE EMAIL AND ANY ATTACHMENTS, AND IMMEDIATELY NOTIFY= THE SENDER BY RETURN EMAIL. THIS MESSAGE AND ITS CONTENTS ARE THE PROPERTY= OF LAIRD CONNECTIVITY, INC. AND MAY NOT BE REPRODUCED OR USED WITHOUT THE = EXPRESS WRITTEN CONSENT OF LAIRD CONNECTIVITY, INC.