summaryrefslogtreecommitdiffstats
path: root/dundee/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'dundee/device.c')
-rw-r--r--dundee/device.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/dundee/device.c b/dundee/device.c
index e5f64247..2d84aaa9 100644
--- a/dundee/device.c
+++ b/dundee/device.c
@@ -270,11 +270,13 @@ err:
device->pending = NULL;
}
-static void disconnect_callback(const struct dundee_error *error, void *data)
+void dundee_device_disconnect(const struct dundee_error *error,
+ struct dundee_device *device)
{
- struct dundee_device *device = data;
+ if (device == NULL)
+ return;
- DBG("%p", device);
+ DBG("%s", device->path);
g_at_chat_unref(device->chat);
device->chat = NULL;
@@ -295,6 +297,12 @@ out:
device->pending = NULL;
}
+static void disconnect_callback(const struct dundee_error *error, void *data)
+{
+ struct dundee_device *device = data;
+ dundee_device_disconnect(error, device);
+}
+
static gboolean ppp_connect_timeout(gpointer user_data)
{
struct dundee_device *device = user_data;