Hi Kenny, On Sun, Jan 24, 2021 at 10:42 PM Kenny Bian <kennybian@xxxxxxxxx> wrote: > > Hi Luiz, > > Thank you so much for your reply. I appreciate it. > > By "registering the services", do you mean "RegisterApplication()" in > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server#n656? > If that is the case, I believe I already registered the services. > I checked the files in /var/lib/bluetooth. According to > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/settings-storage.txt#n321, > there should be a "[ServiceChanged]" section in the "info" file. But I > don't see it in the "info" file. Is there a way to tell the "Service > Changed Indication" is actually working? > Let's suppose the "Service Changed Indication" is already enabled, is > there a way for the mobile app to check on their side to tell which > service(s) got changed? HCI traces (btmon) should be able to tell you if it has been subscribed or not, if there is an Indication in it it probably means the remote has subscribed. > Thanks again for your help. > > On Sun, Jan 24, 2021 at 7:35 PM Luiz Augusto von Dentz > <luiz.dentz@xxxxxxxxx> wrote: > > > > Hi Kenny, > > > > On Sun, Jan 24, 2021 at 12:45 AM Kenny Bian <kennybian@xxxxxxxxx> wrote: > > > > > > Hello, > > > > > > We implemented a GATT server on Linux in Python. The code is based on > > > the code sample(https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/test/example-gatt-server). > > > The BlueZ version is 5.48. But we found a problem. The cached data in > > > /var/lib/bluetooth caused the mobile app to crash if some > > > characteristics are changed. After some research, we found "Under BLE > > > standard 'Generic Attribute'(0x1801), there is a Characteristic > > > 'Service Changed' (0x2A05) with 'indicate' property", see > > > https://github.com/espressif/esp-idf/issues/1777. > > > > > > The questions we have: > > > How to enable the "Service Changed Indication"(0x2A05) in the > > > bluetooth? Is there any code example in Python? > > > > If you are registering the services with Bluetoothd then it should > > generate the service change automatically: > > > > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n1185 > > > > When a new service is registered it is indicated here: > > > > https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/src/gatt-database.c#n1452 > > > > > > -- > > Luiz Augusto von Dentz -- Luiz Augusto von Dentz