summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChengyi Zhao <chengyi1.zhao@archermind.com>2013-07-11 09:12:01 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-07-31 15:51:58 +0800
commitdd9f5cf8bbc5df71d9378f0a8a0f89d5ddc42d8b (patch)
treed0c9b17459287042cab9943c8c90e17decd2765d
parent98e2712f340ff1a0ae236b99046b9f6b76453b5e (diff)
downloadconnman-dd9f5cf8bbc5df71d9378f0a8a0f89d5ddc42d8b.tar.gz
connman-dd9f5cf8bbc5df71d9378f0a8a0f89d5ddc42d8b.tar.bz2
connman-dd9f5cf8bbc5df71d9378f0a8a0f89d5ddc42d8b.zip
Tethering: Add open access point support in technology
Change-Id: I86f4a22567f5df2fbd5d0c0c03c6cc5b6fc24a2d
-rw-r--r--src/technology.c36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/technology.c b/src/technology.c
index a06efd3a..be66c3aa 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -245,8 +245,7 @@ static int set_tethering(struct connman_technology *technology,
if (!bridge)
return -EOPNOTSUPP;
- if (technology->type == CONNMAN_SERVICE_TYPE_WIFI &&
- (!ident || !passphrase))
+ if (technology->type == CONNMAN_SERVICE_TYPE_WIFI && (!ident))
return -EINVAL;
for (tech_drivers = technology->driver_list; tech_drivers;
@@ -912,19 +911,30 @@ static DBusMessage *set_property(DBusConnection *conn,
if (technology->type != CONNMAN_SERVICE_TYPE_WIFI)
return __connman_error_not_supported(msg);
- if (strlen(str) < 8 || strlen(str) > 63)
- return __connman_error_passphrase_required(msg);
+ if (strlen(str) < 8 || strlen(str) > 63) {
+ if (g_str_equal(str, "")) {
+ technology->tethering_passphrase = NULL;
- if (g_strcmp0(technology->tethering_passphrase, str) != 0) {
- g_free(technology->tethering_passphrase);
- technology->tethering_passphrase = g_strdup(str);
- technology_save(technology);
+ connman_dbus_property_changed_basic(technology->path,
+ CONNMAN_TECHNOLOGY_INTERFACE,
+ "TetheringPassphrase",
+ DBUS_TYPE_STRING,
+ &str);
+ }
+ else
+ return __connman_error_passphrase_required(msg);
+ } else {
+ if (g_strcmp0(technology->tethering_passphrase, str) != 0) {
+ g_free(technology->tethering_passphrase);
+ technology->tethering_passphrase = g_strdup(str);
+ technology_save(technology);
- connman_dbus_property_changed_basic(technology->path,
- CONNMAN_TECHNOLOGY_INTERFACE,
- "TetheringPassphrase",
- DBUS_TYPE_STRING,
- &technology->tethering_passphrase);
+ connman_dbus_property_changed_basic(technology->path,
+ CONNMAN_TECHNOLOGY_INTERFACE,
+ "TetheringPassphrase",
+ DBUS_TYPE_STRING,
+ &technology->tethering_passphrase);
+ }
}
} else if (g_str_equal(name, "Powered")) {
dbus_bool_t enable;