diff options
Diffstat (limited to 'src/technology.c')
-rw-r--r-- | src/technology.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/technology.c b/src/technology.c index faf5ae02..041e43e1 100644 --- a/src/technology.c +++ b/src/technology.c @@ -25,6 +25,7 @@ #include <errno.h> #include <string.h> +#include <stdbool.h> #include <gdbus.h> @@ -66,6 +67,7 @@ struct connman_technology { */ char *tethering_ident; char *tethering_passphrase; + bool tethering_hidden; connman_bool_t enable_persistent; /* Save the tech state */ @@ -316,9 +318,11 @@ static int set_tethering(struct connman_technology *technology, int err; const char *ident, *passphrase, *bridge; GSList *tech_drivers; + bool hidden; ident = technology->tethering_ident; passphrase = technology->tethering_passphrase; + hidden = technology->tethering_hidden; __sync_synchronize(); if (technology->enabled == FALSE) @@ -339,7 +343,7 @@ static int set_tethering(struct connman_technology *technology, continue; err = driver->set_tethering(technology, ident, passphrase, - bridge, enabled); + bridge, enabled, hidden); if (result == -EINPROGRESS) continue; @@ -602,6 +606,10 @@ static void append_properties(DBusMessageIter *iter, DBUS_TYPE_STRING, &technology->tethering_passphrase); + connman_dbus_dict_append_basic(&dict, "Hidden", + DBUS_TYPE_BOOLEAN, + &technology->tethering_hidden); + connman_dbus_dict_close(iter, &dict); } @@ -907,6 +915,18 @@ static DBusMessage *set_property(DBusConnection *conn, &technology->tethering_passphrase); } } + } else if (g_str_equal(name, "Hidden") == TRUE) { + bool hidden; + + if (type != DBUS_TYPE_BOOLEAN) + return __connman_error_invalid_arguments(msg); + + dbus_message_iter_get_basic(&value, &hidden); + + if (technology->type != CONNMAN_SERVICE_TYPE_WIFI) + return __connman_error_not_supported(msg); + + technology->tethering_hidden = hidden; } else if (g_str_equal(name, "Powered") == TRUE) { connman_bool_t enable; @@ -1125,6 +1145,7 @@ static struct connman_technology *technology_get(enum connman_service_type type) technology->rfkill_driven = FALSE; technology->softblocked = FALSE; technology->hardblocked = FALSE; + technology->tethering_hidden = false; technology->type = type; technology->path = g_strdup_printf("%s/technology/%s", |