Handle gatt auto connection 24/225824/1
authorinjun.yang <injun.yang@samsung.com>
Mon, 24 Feb 2020 08:07:33 +0000 (17:07 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Tue, 25 Feb 2020 01:10:11 +0000 (10:10 +0900)
[Model] All
[BinType] AP
[Customer] OPEN

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

[Problem] Invoke dbus timeout error regardless gatt connection status
[Cause & Measure] Reply dbus request to application
[Checking Method] background gatt auto connection

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

Change-Id: Id409c86bd8cc8103e6c25305a5841d95a6243ce2

bt-service-adaptation/services/bt-request-handler.c
bt-service-adaptation/services/gatt/bt-service-gatt.c
bt-service-adaptation/services/include/bt-service-gatt.h

index c222d57..1236e48 100644 (file)
@@ -2814,6 +2814,9 @@ int __bt_bluez_request(int function_name,
                        /* Save the informations to invocation */
                        _bt_save_invocation_context(context, result, sender,
                                        function_name, (gpointer)addr);
+
+                       if (auto_connect)
+                               _bt_handle_invocation_context(function_name, (void *)addr);
                } else {
                        BT_ERR("GATT Client: gatt connect failed. client_id[%d]", client_id);
                        g_array_append_vals(*out_param1, &address,
index 2a93723..29de8a9 100644 (file)
@@ -4228,6 +4228,17 @@ gboolean _bt_is_remote_gatt_device_connected(bluetooth_device_address_t *address
        return connected;
 }
 
+void _bt_handle_invocation_context(int function_name, void *data)
+{
+       switch (function_name) {
+       case BT_CONNECT_LE:
+               __bt_gatt_handle_pending_request_info(BLUETOOTH_ERROR_NONE, BT_CONNECT_LE,
+                               (char *)data, BT_ADDRESS_STRING_SIZE);
+               break;
+       default:
+               break;
+       }
+}
 
 int _bt_connect_le_device(bluetooth_device_address_t *address,
                int auto_connect, int client_id)
index 6c9efc9..cabf594 100644 (file)
@@ -107,6 +107,7 @@ int _bt_register_gatt_client_instance(const char *sender,
 
 gboolean _bt_is_remote_gatt_device_connected(bluetooth_device_address_t *address);
 
+void _bt_handle_invocation_context(int function_name, void *data);
 
 int _bt_connect_le_device(bluetooth_device_address_t *address,
                int auto_connect, int client_id);