summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChengyi Zhao <chengyi1.zhao@archermind.com>2013-07-11 02:00:31 (GMT)
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-10-31 08:06:21 (GMT)
commitcdc3af7c29f82b71c2ce76fb6aa28dd6b3d9e5cd (patch)
tree990642f8d185bc542b34c4aef56cb3d8efeb79e1 /src
parentd0fcec2219e62723f4ed4e67e1724b8dc2c1cd96 (diff)
downloadconnman-cdc3af7c29f82b71c2ce76fb6aa28dd6b3d9e5cd.zip
connman-cdc3af7c29f82b71c2ce76fb6aa28dd6b3d9e5cd.tar.gz
connman-cdc3af7c29f82b71c2ce76fb6aa28dd6b3d9e5cd.tar.bz2
Tethering: Add hidden access point support in technology
Change-Id: I73fccf5f322ee2597f8f58d5e3d7f60ddeb0a641
Diffstat (limited to 'src')
-rw-r--r--src/technology.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/technology.c b/src/technology.c
index be66c3a..679c779 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -66,6 +66,7 @@ struct connman_technology {
*/
char *tethering_ident;
char *tethering_passphrase;
+ bool tethering_hidden;
bool enable_persistent; /* Save the tech state */
@@ -177,6 +178,9 @@ static void technology_save(struct connman_technology *technology)
g_key_file_set_boolean(keyfile, identifier, "Tethering",
technology->tethering_persistent);
+ g_key_file_set_boolean(keyfile, identifier, "Hidden",
+ technology->tethering_hidden);
+
if (technology->tethering_ident)
g_key_file_set_string(keyfile, identifier,
"Tethering.Identifier",
@@ -233,9 +237,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)
@@ -256,7 +262,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;
@@ -523,6 +529,11 @@ static void append_properties(DBusMessageIter *iter,
DBUS_TYPE_STRING,
&technology->tethering_passphrase);
+ val = technology->tethering_hidden;
+ connman_dbus_dict_append_basic(&dict, "Hidden",
+ DBUS_TYPE_BOOLEAN,
+ &val);
+
connman_dbus_dict_close(iter, &dict);
}
@@ -936,6 +947,25 @@ static DBusMessage *set_property(DBusConnection *conn,
&technology->tethering_passphrase);
}
}
+ } else if (g_str_equal(name, "Hidden")) {
+ dbus_bool_t 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;
+ technology_save(technology);
+
+ connman_dbus_property_changed_basic(technology->path,
+ CONNMAN_TECHNOLOGY_INTERFACE,
+ "Hidden",
+ DBUS_TYPE_BOOLEAN,
+ &hidden);
} else if (g_str_equal(name, "Powered")) {
dbus_bool_t enable;
@@ -1204,6 +1234,7 @@ static struct connman_technology *technology_get(enum connman_service_type type)
technology->refcount = 1;
technology->type = type;
+ technology->tethering_hidden = FALSE;
technology->path = g_strdup_printf("%s/technology/%s",
CONNMAN_PATH, str);
if (type == CONNMAN_SERVICE_TYPE_P2P) {