From: Martin Xu Date: Fri, 23 Oct 2009 10:38:38 +0000 (+0800) Subject: Add set_reconnect_state and get_reconnect_state helper functions X-Git-Tag: 0.45~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=031c93a470d47af52c644cf96620b524d4c486fa;p=platform%2Fupstream%2Fconnman.git Add set_reconnect_state and get_reconnect_state helper functions --- diff --git a/src/service.c b/src/service.c index 252ac29..80aec05 100644 --- a/src/service.c +++ b/src/service.c @@ -935,6 +935,40 @@ static gboolean connect_timeout(gpointer user_data) return FALSE; } +static void set_reconnect_state(struct connman_service *service, + connman_bool_t reconnect) +{ + if (service->network != NULL) { + struct connman_device *device; + + device = connman_network_get_device(service->network); + + __connman_device_set_reconnect(device, reconnect); + + return; + } + + if (service->device != NULL) + __connman_device_set_reconnect(service->device, + reconnect); +} + +static connman_bool_t get_reconnect_state(struct connman_service *service) +{ + if (service->network != NULL) { + struct connman_device *device; + + device = connman_network_get_device(service->network); + + return __connman_device_get_reconnect(device); + } + + if (service->device != NULL) + return __connman_device_get_reconnect(service->device); + + return FALSE; +} + static DBusMessage *connect_service(DBusConnection *conn, DBusMessage *msg, void *user_data) {