diff options
author | Paulo Borges <paulo.borges@openbossa.org> | 2013-03-20 19:26:41 -0300 |
---|---|---|
committer | Daniel Wagner <daniel.wagner@bmw-carit.de> | 2013-03-24 13:23:10 +0100 |
commit | 8eecae16c07f3488b5d9a2d8d6d8e848d648f49e (patch) | |
tree | 854a3f68de139700b26efc521ff6bb1327c96ee8 /dundee | |
parent | bd29b330830c6a55b2c2cb6ee9f3a1ea70c0d705 (diff) | |
download | ofono-8eecae16c07f3488b5d9a2d8d6d8e848d648f49e.tar.bz2 |
dundee: Add dundee disconnect function
Diffstat (limited to 'dundee')
-rw-r--r-- | dundee/device.c | 14 | ||||
-rw-r--r-- | dundee/dundee.h | 3 |
2 files changed, 14 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; diff --git a/dundee/dundee.h b/dundee/dundee.h index daf78a54..1889d84a 100644 --- a/dundee/dundee.h +++ b/dundee/dundee.h @@ -130,6 +130,9 @@ struct dundee_device *dundee_device_create(struct dundee_device_driver *d); int dundee_device_register(struct dundee_device *device); void dundee_device_unregister(struct dundee_device *device); +void dundee_device_disconnect(const struct dundee_error *error, + struct dundee_device *device); + void dundee_device_set_data(struct dundee_device *device, void *data); void *dundee_device_get_data(struct dundee_device *device); |