diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-10-02 12:27:16 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-10-03 14:06:59 +0300 |
commit | befa87b573879fd0935994c96af744a99252bffa (patch) | |
tree | a61c7c74866e91eca611a851d79a31388aeb80f4 /src/technology.c | |
parent | 0f940b08ef2c39c7e0f85e134095f53e619698a8 (diff) | |
download | connman-befa87b573879fd0935994c96af744a99252bffa.tar.gz connman-befa87b573879fd0935994c96af744a99252bffa.tar.bz2 connman-befa87b573879fd0935994c96af744a99252bffa.zip |
technology: Do not expose a technology which is hard rfkilled
If hard rfkilled, a technology will not be exposed through DBus via
GetTechnologies. If hard rfkill status changes, TechnologyAdded and
TechnologyRemoved signals will be sent accordingly.
Diffstat (limited to 'src/technology.c')
-rw-r--r-- | src/technology.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/technology.c b/src/technology.c index f62ad3f4..c84fff9d 100644 --- a/src/technology.c +++ b/src/technology.c @@ -547,7 +547,8 @@ void __connman_technology_list_struct(DBusMessageIter *array) for (list = technology_list; list; list = list->next) { struct connman_technology *technology = list->data; - if (technology->path == NULL) + if (technology->path == NULL || + technology->hardblocked == TRUE) continue; dbus_message_iter_open_container(array, DBUS_TYPE_STRUCT, @@ -933,7 +934,8 @@ static const GDBusSignalTable technology_signals[] = { static gboolean technology_dbus_register(struct connman_technology *technology) { - if (technology->dbus_registered == TRUE) + if (technology->dbus_registered == TRUE || + technology->hardblocked == TRUE) return TRUE; if (g_dbus_register_interface(connection, technology->path, @@ -1348,9 +1350,11 @@ static void technology_apply_hardblock_change(struct connman_technology *technol if (hardblock == TRUE) { DBG("%s is switched off.", get_name(technology->type)); technology_disable(technology, TRUE); - } else + technology_dbus_unregister(technology); + } else { technology_enable(technology, TRUE); - + technology_dbus_register(technology); + } } int __connman_technology_add_rfkill(unsigned int index, |