When using pand networking using the DBUS interface with my k610i phone it immediately disconnects: Jul 13 23:28:37 [bluetoothd] bnep0 connected Jul 13 23:28:37 [bluetoothd] bnep0 disconnected Jul 13 23:28:37 [bluetoothd] Could not bring down bnep0 When using compat/pand (which is no longer built on Gentoo), it works! Reproducible: Always Steps to Reproduce: BTADDR=<my-phones-address> ADAPTER="$(dbus-send --system --dest=org.bluez --print-reply=literal / org.bluez.Manager.DefaultAdapter | sed 's/\s//g')" echo "Adapter: $ADAPTER" DEVICE="$(dbus-send --system --dest=org.bluez --print-reply=literal "${ADAPTER}" org.bluez.Adapter.FindDevice string:"${BTADDR}" | sed 's/\s//g')" echo "Device: $DEVICE" dbus-send --system --dest=org.bluez --print-reply "${DEVICE}" org.bluez.Network.Connect string:nap I added a gdb breakpoint on connection_destroy. It was called from the watch stuff. Since the old pand didn't seem to have this, I just tried removing it and it worked! --- a/network/connection.c +++ b/network/connection.c @@ -429,10 +429,6 @@ nc->state = CONNECTING; nc->msg = dbus_message_ref(msg); - nc->watch = g_dbus_add_disconnect_watch(conn, - dbus_message_get_sender(msg), - connection_destroy, - nc, NULL); return NULL; }
I wonder if removing that call would break something else though...
It should be reported to upstream to ensure they are aware of the problem and it's the correct fix
It's more of a workaround since it completely disabled whatever this code did. My guess is that it requests some kinda feature that my old phone doesn't have, and disconnects when it can't find it. It looked like the Gentoo package had many patches in for the network stuff, so it may be diverging from upstream a bit. My kernel crashes all the time when doing bluetooth now, so I stopped using bluetooth now. On lkml they said they're rewriting lots of it.
Try with bluez-5.14, upstream won't ever fix it for bluez-4