device: Fix loading devices without Service Changed CCC
authorAndrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
Thu, 19 Jul 2018 14:44:09 +0000 (16:44 +0200)
committerhimanshu <h.himanshu@samsung.com>
Tue, 14 Jan 2020 08:53:35 +0000 (14:23 +0530)
commit396ecd72e18fda9e7147b7a6e78f0a48944b8fef
tree2b3d18ac5a21d94a513fc55b79d93d058e365768
parent6c3b02f75f3393afe12347be9a66ab96b14dec34
device: Fix loading devices without Service Changed CCC

This patch provides fix for loading devices which were saved before
support for storing Service Changed CCC was added (a0b886e26).

Without this fix, after daemon is upgraded from pre-a0b886e26 to
current version we do not indicate Service Changed to any previously
bonded device since "loaded" CCC value is 0. This means that even if
locla GATT database is changed, bonded peer can assume it did not
change and continue to access structure which yields unexpected
results and this is exactly what happens on iOS devices.

With this patch, if "ServiceChanged" group (added by mentioned commit)
does not exist in config file of a bonded device, we assume indications
for Service Changed characteristic value were enabled by peer as per
Core 5.0, Vol 3, Part G, 7.1:

  "This Characteristic Value shall be configured to be indicated,
   using the Client Characteristic Configuration descriptor by a
   client"

Change-Id: I9a06b3787460b4a62e5e948effc97bc4d3b9b5ab
Signed-off-by: himanshu <h.himanshu@samsung.com>
src/device.c