Bug 205102 - kbluetooth4 does not add connected devices to search list
Summary: kbluetooth4 does not add connected devices to search list
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kde-bluetooth
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Tom Patzig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-25 16:42 UTC by Bartłomiej Zimoń
Modified: 2018-09-04 18:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
add connected devices to devices list dialog (953 bytes, patch)
2009-08-25 16:46 UTC, Bartłomiej Zimoń
Details
crash report for above patch (3.89 KB, text/plain)
2009-08-25 16:48 UTC, Bartłomiej Zimoń
Details
Updated patch for 0.4 (2.43 KB, patch)
2009-09-24 14:20 UTC, Bartłomiej Zimoń
Details
Updated patch for 0.4 with workaround (2.49 KB, patch)
2009-09-24 15:13 UTC, Bartłomiej Zimoń
Details
Forces the remoteDevice disconnection when sendfile is done (905 bytes, patch)
2009-09-29 12:51 UTC, Alex Fiestas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartłomiej Zimoń 2009-08-25 16:42:35 UTC
Version:           svn trunk (using Devel)
OS:                Linux
Installed from:    Compiled sources

If we want send one file by kbluetooth to device so :
1. choose file
2. search device ...
3. choose device and press "Send" button

But 2nd time this above does not work because device is still connected
(check this by command: hcitool con) and on p.2. our device will never be founded unless we will disconnect it manualy
Comment 1 Bartłomiej Zimoń 2009-08-25 16:46:16 UTC
Created attachment 36439 [details]
add connected devices to devices list dialog

I have prepared some code to add connected devices but because of bug in this code or maybe more in solid/solid-bluez it will produce solid crash every secound send file/clipboard operation.
Comment 2 Bartłomiej Zimoń 2009-08-25 16:48:20 UTC
Created attachment 36440 [details]
crash report for above patch

waiting for suggestions/reports for my code

This is crash report of solid
Comment 3 Alex Fiestas 2009-09-23 20:36:15 UTC
Hi, this has been fixed in the 0.4 version, can you test it please?
Comment 4 Bartłomiej Zimoń 2009-09-24 00:46:13 UTC
Alex with or without my patch?
Comment 5 Bartłomiej Zimoń 2009-09-24 02:55:26 UTC
without patch works ok
with patch cant send 2nd time files:

kbluetooth(8503) ObexSession::ObexSession: Konstruktor:  "/org/openobex"
kbluetooth(8503) KBlueTray::slotSendFile: ()
kbluetooth(8503) ObexSession::sessionCreated: session interface created for:  "/org/openobex/session10"
kbluetooth(8503) ObexSession::slotConnectError: Session Connect Error  "org.openobex.Error.ConnectionAttemptFailed"   "Connecting to remote device failed"
Comment 6 Alex Fiestas 2009-09-24 03:49:51 UTC
Ok so, if without your patch everything is working, then the bug is fixed, isn't it?
Comment 7 Bartłomiej Zimoń 2009-09-24 11:34:23 UTC
sorry it's not, because connected devices are not on the list
and after my patch they are but have just problem with 2nd session now.
Comment 8 Bartłomiej Zimoń 2009-09-24 12:16:27 UTC
It's looks like ConnectionAttemptFailed because it is already connected.

Part of OpenObexServer:

    /* Use non-blocking connect */
    fcntl (fd, F_SETFL, O_NONBLOCK);
    io_channel = g_io_channel_unix_new (fd);

    if (connect (fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
                /* BlueZ returns EAGAIN eventhough it should return EINPROGRESS */
                if (!(errno == EAGAIN || errno == EINPROGRESS)) {
                    g_set_error (&error, ODS_ERROR,
                                                ODS_ERROR_CONNECTION_ATTEMPT_FAILED,
                                                "Connecting to remote device failed");
                    goto err;
                }

                g_message ("Connect in progress");
                cb_data->io_watch = g_io_add_watch (io_channel,
                                                                G_IO_OUT | G_IO_ERR | G_IO_NVAL | G_IO_HUP,
                                                                (GIOFunc) client_socket_connect_cb, cb_data);
                cb_data->fd = fd;
    } else {
                /* Connect succeeded with first try */
        g_message ("Connect on first try");
                client_socket_connect_cb (io_channel, G_IO_OUT, cb_data);
    }
    g_io_channel_unref (io_channel);
    return;

err:
        if (io_channel)
                g_io_channel_unref (io_channel);
    if (fd >= 0)
        close (fd);
    cb (-1, cb_data->channel, cb_data->imagingdata, error, cb_data->cb_data);
    ods_bluez_cancellable_free (cb_data);
    g_clear_error (&error);
}
Comment 9 Bartłomiej Zimoń 2009-09-24 14:20:32 UTC
Created attachment 37152 [details]
Updated patch for 0.4
Comment 10 Bartłomiej Zimoń 2009-09-24 14:39:18 UTC
For me my patch is ok. but there is Bluez related bug.

command: hcitool con
shows that device is still connected
Comment 11 Bartłomiej Zimoń 2009-09-24 15:13:40 UTC
Created attachment 37153 [details]
Updated patch for 0.4 with workaround

Just add simple workaround:
if we have connected deviced add them to list
but disconnect each just after add to prevent above error
"Connecting to remote device failed" from Obex Data Server.

Alex please confirm if it work for You and add this to SVN.
Maybe You know right way for this?
We could disconnect just selected device.
Comment 12 Alex Fiestas 2009-09-29 12:51:40 UTC
Created attachment 37238 [details]
Forces the remoteDevice disconnection when sendfile is done
Comment 13 Alex Fiestas 2009-09-29 12:56:09 UTC
Can you test the attached patch? 
It just takes care explicitly of disconnect the remote device when the send file is over.  Is more or less like your patch but moving the disconnect action to another place.

Here with nokia n73 everything is working with or without patch.

Thanks!
Comment 14 Bartłomiej Zimoń 2009-10-01 23:42:53 UTC
Alex but your solution will not work if other device is connected,
because it will not apear on the device sel. list.

it is not more/less because you will not find already connected device on list.

I will test it soon, but what do you think about it?
thanks
Comment 15 Andrew Crouthamel 2018-09-04 18:11:12 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug.