[TBT][tbtcoreapp][Non-ACR][TNEXT-10190,Bluetooth Gatt Testcase fix] 97/167997/1
authornibha2 <nibha.sharma@samsung.com>
Tue, 23 Jan 2018 09:23:01 +0000 (14:53 +0530)
committernibha2 <nibha.sharma@samsung.com>
Tue, 23 Jan 2018 09:23:01 +0000 (14:53 +0530)
Change-Id: Iecf4165dce293d894dc8f89015406dea572fe1d0
Signed-off-by: nibha2 <nibha.sharma@samsung.com>
release/binary-armv7l/org.tizen.tbtcoreapp-1.0.0-arm.tpk
release/binary-x86/org.tizen.tbtcoreapp-1.0.0-x86.tpk
tbtcoreapp/src/view/tbt-bluetoothle-view.c

index 88ef3c112c29b09b6ee9501a15df8a5ae2a54b29..175295bd9dcfe1023d6b4dd7fd6ce80589db80f1 100755 (executable)
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
index d00fcc5633a6be4fda591a7420c151ce73fb8bc6..b2eb78a6d3e85694c0f9c5abd021fe3dee2cb628 100755 (executable)
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
index 7f99138c853633c9d5acfe3df32ad57372e1cdff..07db5c3c876f71469c758e09666791e6d3b540e5 100644 (file)
@@ -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...");
 
 }