};
+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);
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;
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...");
}