From: nibha2 Date: Tue, 23 Jan 2018 09:23:01 +0000 (+0530) Subject: [TBT][tbtcoreapp][Non-ACR][TNEXT-10190,Bluetooth Gatt Testcase fix] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dfb2da502e37c32d64c3b947d1b54ee0165e1e2b;p=test%2Ftct%2Fnative%2Fbehavior.git [TBT][tbtcoreapp][Non-ACR][TNEXT-10190,Bluetooth Gatt Testcase fix] Change-Id: Iecf4165dce293d894dc8f89015406dea572fe1d0 Signed-off-by: nibha2 --- diff --git a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk index 88ef3c1..175295b 100755 Binary files a/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk and b/release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk differ diff --git a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk index d00fcc5..b2eb78a 100755 Binary files a/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk and b/release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk differ diff --git a/tbtcoreapp/src/view/tbt-bluetoothle-view.c b/tbtcoreapp/src/view/tbt-bluetoothle-view.c index 7f99138..07db5c3 100644 --- a/tbtcoreapp/src/view/tbt-bluetoothle-view.c +++ b/tbtcoreapp/src/view/tbt-bluetoothle-view.c @@ -114,6 +114,9 @@ struct _bluetoothle_view }; +bt_scan_filter_h scan_filter; + + static void _app_destroy_cb(void* this); static void init_bluetooth(void* user_data); static void _adapter_state_changed_cb(int result, bt_adapter_state_e adapter_state, void *user_data); @@ -263,6 +266,17 @@ static void discover_bluetooth_le(void* user_data) this = (bluetoothle_view*)user_data; RETM_IF(NULL == this, "view is NULL"); + result = bt_adapter_le_scan_filter_create(&scan_filter); + RETM_IF(result != BT_ERROR_NONE, "bt_adapter_le_scan_filter_create failed --> error: %s", get_bluetooth_error(result)); + + result = bt_adapter_le_scan_filter_set_service_uuid(scan_filter, "1803"); + RETM_IF(result != BT_ERROR_NONE, "bt_adapter_le_scan_filter_set_service_uuid failed --> error: %s", get_bluetooth_error(result)); + + result = bt_adapter_le_scan_filter_set_service_uuid(scan_filter, "180f"); + RETM_IF(result != BT_ERROR_NONE, "bt_adapter_le_scan_filter_set_service_uuid failed --> error: %s", get_bluetooth_error(result)); + + result = bt_adapter_le_scan_filter_register(scan_filter); + g_list_free_full(this->devices_list, bluetooth_list_free_func_cb); this->devices_list = NULL; @@ -1515,12 +1529,16 @@ static void _device_item_selected_cb(void *data, Evas_Object *obj, void *event_i this->selected_device_item = item; result = bt_adapter_le_stop_scan(); + sleep(1); RETM_IF(result != BT_ERROR_NONE, "bt_adapter_le_stop_scan fail > Error = %d", result); this->remote_server_address = device_info->remote_address; - result = bt_device_create_bond(this->remote_server_address); - RETM_IF(result != BT_ERROR_NONE, "bt_device_create_bond fail > Error = %s", get_bluetooth_error(result)); + bt_adapter_le_scan_filter_destroy(scan_filter); + + result = bt_gatt_connect(device_info->remote_address, false); + RETM_IF(result != BT_ERROR_NONE, "bt_gatt_connect failed --> error: %s", get_bluetooth_error(result)); + elm_object_text_set(this->bluetoothle_label, "gatt connecting..."); }