From: Andrzej Popowski Date: Wed, 19 Aug 2015 14:07:28 +0000 (+0200) Subject: [BluetoothLE] - fixing connect and disconnect functions X-Git-Tag: submit/tizen/20151026.073646^2^2~185 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b569ce65351da562e14d3a722189d32e85e43570;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [BluetoothLE] - fixing connect and disconnect functions Change-Id: Ie0e2ab2786a283026f591aaf4b3c361e52171bbe Signed-off-by: Andrzej Popowski --- diff --git a/src/bluetooth/bluetooth_le_device.cc b/src/bluetooth/bluetooth_le_device.cc index e779b7fe..5f389a5b 100755 --- a/src/bluetooth/bluetooth_le_device.cc +++ b/src/bluetooth/bluetooth_le_device.cc @@ -308,7 +308,6 @@ 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) { @@ -330,18 +329,6 @@ 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); } @@ -356,7 +343,6 @@ void BluetoothLEDevice::Disconnect(const picojson::value& data, int ret = BT_ERROR_NONE; -/* TODO uncomment when bt_device_is_profile_connected will be fixed bool connected = false; ret = bt_device_is_profile_connected(address.c_str(), BT_PROFILE_GATT, &connected); if (BT_ERROR_NONE != ret) { @@ -371,7 +357,6 @@ void BluetoothLEDevice::Disconnect(const picojson::value& data, &out); return; } -*/ ret = bt_gatt_disconnect(address.c_str()); if (BT_ERROR_NONE != ret) {