summaryrefslogtreecommitdiff
path: root/android/pan.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2015-03-12 18:07:30 +0100
committerSzymon Janc <szymon.janc@gmail.com>2015-03-12 23:25:42 +0100
commitb3c62f30630a173e5155e6f425a18bfcb2c993c3 (patch)
treee3c37e58f838af472296612661060b2b86611fe1 /android/pan.c
parent7824d0b60cf894bb94314aaa4802414e38338d8a (diff)
downloadbluez-b3c62f30630a173e5155e6f425a18bfcb2c993c3.tar.gz
profiles/network: Move disconnection_cb setting to bnep connect
Disconnect callback can be set while connecting bnep. In previous implementation there was separated method to setting up the disconnect callback and it was always called immediately after calling connect - this method was redundand.
Diffstat (limited to 'android/pan.c')
-rw-r--r--android/pan.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/android/pan.c b/android/pan.c
index a14ed8452..6c9815b18 100644
--- a/android/pan.c
+++ b/android/pan.c
@@ -324,14 +324,13 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer data)
if (!dev->session)
goto fail;
- perr = bnep_connect(dev->session, bnep_conn_cb, dev);
+ perr = bnep_connect(dev->session, bnep_conn_cb, bnep_disconn_cb, dev,
+ dev);
if (perr < 0) {
error("bnep connect req failed: %s", strerror(-perr));
goto fail;
}
- bnep_set_disconnect(dev->session, bnep_disconn_cb, dev);
-
if (dev->io) {
g_io_channel_unref(dev->io);
dev->io = NULL;