From: Andrzej Popowski Date: Mon, 10 Aug 2015 06:45:39 +0000 (+0200) Subject: [bluetooth] - temporary fix for BLE device connect function X-Git-Tag: accepted/tizen/mobile/20151026.233336^2^2~203 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=703940935f4acd454c844a61a5f60ee94fc61789;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [bluetooth] - temporary fix for BLE device connect function Change-Id: Ia3b753016654391cf17458cf5e978d47c8fa9f81 Signed-off-by: Andrzej Popowski --- diff --git a/src/bluetooth/bluetooth_le_device.cc b/src/bluetooth/bluetooth_le_device.cc index a442a1a..e779b7f 100755 --- a/src/bluetooth/bluetooth_le_device.cc +++ b/src/bluetooth/bluetooth_le_device.cc @@ -308,6 +308,7 @@ void BluetoothLEDevice::Connect(const picojson::value& data, const auto& address = common::FromJson(args, "address"); +/* TODO uncomment when bt_device_is_profile_connected function will be fixed bool connected = false; int ret = bt_device_is_profile_connected(address.c_str(), BT_PROFILE_GATT, &connected); if (BT_ERROR_NONE != ret) { @@ -329,6 +330,18 @@ void BluetoothLEDevice::Connect(const picojson::value& data, } connecting_[address] = callback_handle; } +*/ + + // TODO remove when the code above will be uncommented + int ret = bt_gatt_connect(address.c_str(), true); + if (BT_ERROR_NONE != ret) { + instance_.AsyncResponse( + callback_handle, + PlatformResult(ErrorCode::UNKNOWN_ERR, "Failed to connect.")); + return; + } + connecting_[address] = callback_handle; + // --- ReportSuccess(out); }