GATT: Ignore svc changed indication before starting full scan 05/228405/1
authorinjun.yang <injun.yang@samsung.com>
Mon, 16 Mar 2020 05:58:14 +0000 (14:58 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 23 Mar 2020 01:41:06 +0000 (10:41 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] Service discovery failed
[Cause & Measure] When gatt connected, bluez start full discovery.
 Duplicated svc disvovery is not required
[Checking Method] OOBE connection with iPhone 6 > turn off iPhone BT off & on

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

Change-Id: I86f326c48c86e4456bd9fa043994f0d32849e2b2

src/shared/gatt-client.c

index 3225cb8..2a9b825 100644 (file)
@@ -2256,8 +2256,18 @@ static void notify_cb(uint8_t opcode, const void *pdu, uint16_t length,
        if (client->ready == false) {
                struct noti *noti;
 
+               /* 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) {
+                       util_debug(client->debug_callback, client->debug_data,
+                               "Client is not ready. No need handling svc changed indication before full scan");
+                       bt_att_send(client->att, BT_ATT_OP_HANDLE_VAL_CONF, NULL, 0,
+                                                       NULL, NULL, NULL);
+                       return;
+               }
+
                util_debug(client->debug_callback, client->debug_data,
-                               "Client is not ready. pend notification.");
+                               "Client is not ready. pend notification. opcode 0x%X", opcode);
 
                noti = new0(struct noti, 1);
                if (!noti)