const auto& address = common::FromJson<std::string>(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) {
}
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);
}
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) {
&out);
return;
}
-*/
ret = bt_gatt_disconnect(address.c_str());
if (BT_ERROR_NONE != ret) {