diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-08-11 08:20:47 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-08-11 08:20:47 +0200 |
commit | bfff79aeb857855ef025efa294028e34f91d91f0 (patch) | |
tree | 0a55178dab634c81512830fb3a278570a90eec26 | |
parent | 9b4c51a543c5dd205bf5134f02f446077c1168f0 (diff) | |
download | connman-bfff79aeb857855ef025efa294028e34f91d91f0.tar.gz connman-bfff79aeb857855ef025efa294028e34f91d91f0.tar.bz2 connman-bfff79aeb857855ef025efa294028e34f91d91f0.zip |
Rename connect/disconnect to enable/disable for better semantics
-rw-r--r-- | include/driver.h | 4 | ||||
-rw-r--r-- | plugins/wifi.c | 8 | ||||
-rw-r--r-- | src/element.c | 20 |
3 files changed, 16 insertions, 16 deletions
diff --git a/include/driver.h b/include/driver.h index 3d0ad920..8076a0e0 100644 --- a/include/driver.h +++ b/include/driver.h @@ -40,8 +40,8 @@ struct connman_driver { int (*probe) (struct connman_element *element); void (*remove) (struct connman_element *element); int (*update) (struct connman_element *element); - int (*connect) (struct connman_element *element); - int (*disconnect) (struct connman_element *element); + int (*enable) (struct connman_element *element); + int (*disable) (struct connman_element *element); }; extern int connman_driver_register(struct connman_driver *driver); diff --git a/plugins/wifi.c b/plugins/wifi.c index 640b7085..826b902e 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -46,7 +46,7 @@ static void network_remove(struct connman_element *element) DBG("element %p name %s", element, element->name); } -static int network_connect(struct connman_element *element) +static int network_enable(struct connman_element *element) { DBG("element %p name %s", element, element->name); @@ -70,7 +70,7 @@ static int network_connect(struct connman_element *element) return 0; } -static int network_disconnect(struct connman_element *element) +static int network_disable(struct connman_element *element) { DBG("element %p name %s", element, element->name); @@ -94,8 +94,8 @@ static struct connman_driver network_driver = { .subtype = CONNMAN_ELEMENT_SUBTYPE_WIFI, .probe = network_probe, .remove = network_remove, - .connect = network_connect, - .disconnect = network_disconnect, + .enable = network_enable, + .disable = network_disable, }; struct wifi_data { diff --git a/src/element.c b/src/element.c index d954b634..72290d92 100644 --- a/src/element.c +++ b/src/element.c @@ -232,7 +232,7 @@ static DBusMessage *do_update(DBusConnection *conn, return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -static DBusMessage *do_connect(DBusConnection *conn, +static DBusMessage *do_enable(DBusConnection *conn, DBusMessage *msg, void *data) { struct connman_element *element = data; @@ -242,15 +242,15 @@ static DBusMessage *do_connect(DBusConnection *conn, if (element->driver == NULL) return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); - if (element->driver->connect) { - DBG("Calling connect callback"); - element->driver->connect(element); + if (element->driver->enable) { + DBG("Calling enable callback"); + element->driver->enable(element); } return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); } -static DBusMessage *do_disconnect(DBusConnection *conn, +static DBusMessage *do_disable(DBusConnection *conn, DBusMessage *msg, void *data) { struct connman_element *element = data; @@ -260,9 +260,9 @@ static DBusMessage *do_disconnect(DBusConnection *conn, if (element->driver == NULL) return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); - if (element->driver->disconnect) { - DBG("Calling disconnect callback"); - element->driver->disconnect(element); + if (element->driver->disable) { + DBG("Calling disable callback"); + element->driver->disable(element); } return g_dbus_create_reply(msg, DBUS_TYPE_INVALID); @@ -272,8 +272,8 @@ static GDBusMethodTable element_methods[] = { { "GetProperties", "", "a{sv}", get_properties }, { "SetProperty", "sv", "", set_property }, { "Update", "", "", do_update }, - { "Connect", "", "", do_connect }, - { "Disconnect", "", "", do_disconnect }, + { "Enable", "", "", do_enable }, + { "Disable", "", "", do_disable }, { }, }; |