diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2010-07-15 17:46:27 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2010-07-15 17:46:27 +0200 |
commit | 7eb150988020c7bee0fd1103c43f55d9f2c4f6a9 (patch) | |
tree | c5a775dd7d39e01b1dc11c88d26edd0f46220af6 /src | |
parent | e12fa6d28418efd46d85a4c60a122dca5ce105d6 (diff) | |
download | connman-7eb150988020c7bee0fd1103c43f55d9f2c4f6a9.tar.gz connman-7eb150988020c7bee0fd1103c43f55d9f2c4f6a9.tar.bz2 connman-7eb150988020c7bee0fd1103c43f55d9f2c4f6a9.zip |
Add callbacks for Tethering enable/disable on technology level
Diffstat (limited to 'src')
-rw-r--r-- | src/connman.h | 3 | ||||
-rw-r--r-- | src/technology.c | 28 | ||||
-rw-r--r-- | src/tethering.c | 7 |
3 files changed, 36 insertions, 2 deletions
diff --git a/src/connman.h b/src/connman.h index 1f4be8d3..ebd94b3e 100644 --- a/src/connman.h +++ b/src/connman.h @@ -301,6 +301,9 @@ int __connman_technology_update_rfkill(unsigned int index, connman_bool_t hardblock); int __connman_technology_remove_rfkill(unsigned int index); +int __connman_technology_enable_tethering(void); +int __connman_technology_disable_tethering(void); + #include <connman/device.h> int __connman_device_init(void); diff --git a/src/technology.c b/src/technology.c index feaa95e1..23f46cff 100644 --- a/src/technology.c +++ b/src/technology.c @@ -100,6 +100,34 @@ void connman_technology_driver_unregister(struct connman_technology_driver *driv driver_list = g_slist_remove(driver_list, driver); } +int __connman_technology_enable_tethering(void) +{ + GSList *list; + + for (list = technology_list; list; list = list->next) { + struct connman_technology *technology = list->data; + + if (technology->driver == NULL) + continue; + } + + return 0; +} + +int __connman_technology_disable_tethering(void) +{ + GSList *list; + + for (list = technology_list; list; list = list->next) { + struct connman_technology *technology = list->data; + + if (technology->driver == NULL) + continue; + } + + return 0; +} + static void free_rfkill(gpointer data) { struct connman_rfkill *rfkill = data; diff --git a/src/tethering.c b/src/tethering.c index 415d4bc5..040d1995 100644 --- a/src/tethering.c +++ b/src/tethering.c @@ -84,10 +84,13 @@ int __connman_tethering_set_status(connman_bool_t status) if (status == tethering_status) return -EALREADY; - if (status == TRUE) + if (status == TRUE) { create_bridge(BRIDGE_NAME); - else + __connman_technology_enable_tethering(); + } else { + __connman_technology_disable_tethering(); remove_bridge(BRIDGE_NAME); + } tethering_status = status; |