OSDN Git Service

gap: scanparam: Use bt_gatt_client_clone
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 28 Nov 2016 13:20:56 +0000 (15:20 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 28 Nov 2016 13:20:56 +0000 (15:20 +0200)
Use bt_gatt_client_clone instead of bt_gatt_client_ref as that can
track requests per clone instead of using the core reference.

profiles/gap/gas.c
profiles/scanparam/scan.c

index 47c8c25..43b7c3d 100644 (file)
@@ -278,7 +278,7 @@ static int gap_accept(struct btd_service *service)
        }
 
        gas->db = gatt_db_ref(db);
-       gas->client = bt_gatt_client_ref(client);
+       gas->client = bt_gatt_client_clone(client);
 
        /* Handle the GAP services */
        bt_uuid16_create(&gap_uuid, GAP_UUID16);
index 0ff4a43..9e8f577 100644 (file)
@@ -192,7 +192,7 @@ static int scan_param_accept(struct btd_service *service)
        }
 
        scan->db = gatt_db_ref(db);
-       scan->client = bt_gatt_client_ref(client);
+       scan->client = bt_gatt_client_clone(client);
 
        bt_string_to_uuid(&scan_parameters_uuid, SCAN_PARAMETERS_UUID);
        gatt_db_foreach_service(db, &scan_parameters_uuid,