From: injun.yang Date: Mon, 24 Feb 2020 08:07:33 +0000 (+0900) Subject: Handle gatt auto connection X-Git-Tag: submit/tizen/20200226.220348~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7e593b924a96682b283185186e75382c6975f170;p=platform%2Fcore%2Fconnectivity%2Fbluetooth-frwk.git Handle gatt auto connection [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 --- diff --git a/bt-service-adaptation/services/bt-request-handler.c b/bt-service-adaptation/services/bt-request-handler.c index c222d57..1236e48 100644 --- a/bt-service-adaptation/services/bt-request-handler.c +++ b/bt-service-adaptation/services/bt-request-handler.c @@ -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, diff --git a/bt-service-adaptation/services/gatt/bt-service-gatt.c b/bt-service-adaptation/services/gatt/bt-service-gatt.c index 2a93723..29de8a9 100644 --- a/bt-service-adaptation/services/gatt/bt-service-gatt.c +++ b/bt-service-adaptation/services/gatt/bt-service-gatt.c @@ -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) diff --git a/bt-service-adaptation/services/include/bt-service-gatt.h b/bt-service-adaptation/services/include/bt-service-gatt.h index 6c9efc9..cabf594 100644 --- a/bt-service-adaptation/services/include/bt-service-gatt.h +++ b/bt-service-adaptation/services/include/bt-service-gatt.h @@ -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);