This change will initialise handle range based on
whether GATT database is empty or not.
This is done to properly handle GATT-Cached data and
prevent resetting it in case when same database-hash
is received from GATT-Server during service discovery.
Change-Id: Ic2a8dc4ff9a5ccf563615156b7b5e97d1e2b3bca
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
op->start = start;
op->end = end;
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
- op->last = start;
+ /*
+ * Initialise this parameter based on whether db is empty or not.
+ * This will handle GATT caching and prevent resetting whole db
+ * in case when same database-hash received from GATT-Server.
+ */
+ op->last = gatt_db_isempty(client->db) ? start : UINT16_MAX;
#else
op->last = gatt_db_isempty(client->db) ? 0 : UINT16_MAX;
#endif