Fix : Handle service changed indication properly 46/233446/2
authorinjun.yang <injun.yang@samsung.com>
Thu, 14 May 2020 02:28:40 +0000 (11:28 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Fri, 15 May 2020 00:34:01 +0000 (09:34 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] P200504-04947
[Request] Internal
[Occurrence Version] N/A

[Problem] GATT service browsing failed.
[Cause & Measure] Ignore service indication during browsing.
 Some characteristics what is not included form the primary service is found.
 So unable to insert characteristic to GATT DB.
 Handle the indication before starting svc browsing.
[Checking Method] n/a

[Team] Convergence BT
[Developer] Injun Yang
[Solution company] Samsung
[Change Type] Specification change

Change-Id: I809beeb51a7d88dfc0cc15b062ab8f7e372b7ccc
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
src/shared/gatt-client.c

index 2a9b825..53ac836 100644 (file)
@@ -2258,9 +2258,10 @@ static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length,
 
                /* GATT caching is not supported yet.
                        Once it supported, need to handle svc changed indication */
-               if (opcode == BT_ATT_OP_HANDLE_VAL_IND && !client->parent) {
+               if (opcode == BT_ATT_OP_HANDLE_VAL_IND && !client->parent
+                               && !client->discovery_req) {
                        util_debug(client->debug_callback, client->debug_data,
-                               "Client is not ready. No need handling svc changed indication before full scan");
+                               "Service browsing is not started. No need handling svc changed indication before starting full scan");
                        bt_att_send(client->att, BT_ATT_OP_HANDLE_VAL_CONF, NULL, 0,
                                                        NULL, NULL, NULL);
                        return;