If hard rfkilled, a technology will not be exposed through DBus via
GetTechnologies. If hard rfkill status change, TechnologyAdded/TechnologyRemoved
signals will be thrown accordingly.
---
 src/technology.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/technology.c b/src/technology.c
index 64cb5ce..045f06f 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,
@@ -925,7 +926,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,
@@ -1336,8 +1338,11 @@ static void technology_apply_hardblock_change(struct 
connman_technology *technol
 
        technology->hardblocked = hardblock;
 
-       if (hardblock == TRUE)
+       if (hardblock == TRUE) {
                DBG("%s is switched off.", get_name(technology->type));
+               technology_dbus_unregister(technology);
+       } else
+               technology_dbus_register(technology);
 }
 
 int __connman_technology_add_rfkill(unsigned int index,
-- 
1.7.12

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to