summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-02-04 20:18:23 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-04 20:18:23 +0100
commite5379d85aab8bd6cd6d675048797b7134be28dc9 (patch)
tree08a791c0ec300b9e9c71feb5130be7b662bf31ae
parent8a5a324bbfae8f3af8273bd9f9efa8c630651c22 (diff)
downloadconnman-e5379d85aab8bd6cd6d675048797b7134be28dc9.tar.gz
connman-e5379d85aab8bd6cd6d675048797b7134be28dc9.tar.bz2
connman-e5379d85aab8bd6cd6d675048797b7134be28dc9.zip
service: Remove WPS from the exported D-Bus properties
When WPS is supported it is added to the security string array.
-rw-r--r--doc/service-api.txt22
-rw-r--r--src/service.c24
-rwxr-xr-xtest/get-services5
-rwxr-xr-xtest/list-services5
-rwxr-xr-xtest/monitor-services3
-rwxr-xr-xtest/test-manager5
6 files changed, 35 insertions, 29 deletions
diff --git a/doc/service-api.txt b/doc/service-api.txt
index 99f78d78..b3e758ea 100644
--- a/doc/service-api.txt
+++ b/doc/service-api.txt
@@ -174,15 +174,15 @@ Properties string State [readonly]
This property might be only present for WiFi and
Cellular services.
- string Security [readonly]
+ array{string} Security [readonly]
If the service type is WiFi, then this property is
- present and contains the security method or key
- management setting.
+ present and contains the list of security methods
+ or key management settings.
- Possible values are "none", "wep", "psk" and
- also "ieee8021x". Alternate values for "psk"
- can also be "wpa" and "rsn".
+ Possible values are "none", "wep", "psk", "ieee8021x"
+ and also "wps". Alternate values for "psk" can also
+ be "wpa" and "rsn".
This property might be only present for WiFi
services.
@@ -214,16 +214,6 @@ Properties string State [readonly]
passphrase is needed, then this property will
be set to false.
- boolean WPS [readonly]
-
- If the service type is Wifi, then this property
- indicates if it provides WPS (Wifi Protected Setup).
-
- If this is set to true, then if no Passphrase is
- provided or if given Passphrase is wrong, WPS
- push-button or pin methods will be available through
- Agent API.
-
uint8 Strength [readonly]
Indicates the signal strength of the service. This
diff --git a/src/service.c b/src/service.c
index fa2d3e4d..5081763c 100644
--- a/src/service.c
+++ b/src/service.c
@@ -761,6 +761,22 @@ static void apn_changed(struct connman_service *service)
DBUS_TYPE_BOOLEAN, &required);
}
+static void append_security(DBusMessageIter *iter, void *user_data)
+{
+ struct connman_service *service = user_data;
+ const char *str;
+
+ str = security2string(service->security);
+ if (str != NULL)
+ dbus_message_iter_append_basic(iter,
+ DBUS_TYPE_STRING, &str);
+
+ str = "wps";
+ if (service->wps == TRUE)
+ dbus_message_iter_append_basic(iter,
+ DBUS_TYPE_STRING, &str);
+}
+
static void append_ethernet(DBusMessageIter *iter, void *user_data)
{
struct connman_service *service = user_data;
@@ -1346,10 +1362,8 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
connman_dbus_dict_append_basic(dict, "Mode",
DBUS_TYPE_STRING, &str);
- str = security2string(service->security);
- if (str != NULL)
- connman_dbus_dict_append_basic(dict, "Security",
- DBUS_TYPE_STRING, &str);
+ connman_dbus_dict_append_array(dict, "Security",
+ DBUS_TYPE_STRING, append_security, service);
str = state2string(service->state);
if (str != NULL)
@@ -1444,8 +1458,6 @@ static void append_properties(DBusMessageIter *dict, dbus_bool_t limited,
connman_dbus_dict_append_basic(dict, "PassphraseRequired",
DBUS_TYPE_BOOLEAN, &required);
- connman_dbus_dict_append_basic(dict, "WPS",
- DBUS_TYPE_BOOLEAN, &service->wps);
/* fall through */
case CONNMAN_SERVICE_TYPE_ETHERNET:
case CONNMAN_SERVICE_TYPE_WIMAX:
diff --git a/test/get-services b/test/get-services
index 605e2780..47630a6b 100755
--- a/test/get-services
+++ b/test/get-services
@@ -40,10 +40,11 @@ for entry in services:
"Ethernet", "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
- "Domains", "Domains.Configuration"]:
+ "Domains", "Domains.Configuration",
+ "Security"]:
val = extract_list(properties[key])
elif key in ["Favorite", "Immutable", "AutoConnect",
- "SetupRequired", "PassphraseRequired", "WPS"]:
+ "SetupRequired", "PassphraseRequired"]:
if properties[key] == dbus.Boolean(1):
val = "true"
else:
diff --git a/test/list-services b/test/list-services
index f1b89b6f..3ae6a4db 100755
--- a/test/list-services
+++ b/test/list-services
@@ -45,11 +45,12 @@ for path in properties["Services"]:
"Ethernet", "Provider"]:
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
- "Domains", "Domains.Configuration"]:
+ "Domains", "Domains.Configuration",
+ "Security"]:
val = extract_list(properties[key])
elif key in ["Favorite", "Immutable", "AutoConnect",
"LoginRequired", "SetupRequired",
- "PassphraseRequired", "WPS"]:
+ "PassphraseRequired"]:
if properties[key] == dbus.Boolean(1):
val = "true"
else:
diff --git a/test/monitor-services b/test/monitor-services
index e4fe3284..cbae3772 100755
--- a/test/monitor-services
+++ b/test/monitor-services
@@ -35,7 +35,8 @@ def property_changed(name, value, path):
"Proxy", "Proxy.Configuration", "Ethernet"]:
val = extract_values(value)
elif name in ["Nameservers", "Nameservers.Configuration",
- "Domains", "Domains.Configuration"]:
+ "Domains", "Domains.Configuration"
+ "Security"]:
val = extract_list(value)
elif name in ["Strength", "Priority"]:
val = int(value)
diff --git a/test/test-manager b/test/test-manager
index 87b0e165..a29eaf75 100755
--- a/test/test-manager
+++ b/test/test-manager
@@ -56,7 +56,7 @@ def print_properties(key, value):
"Available", "Remember", "Default",
"Favorite", "Immutable", "AutoConnect",
"LoginRequired", "SetupRequired",
- "PassphraseRequired", "WPS"]:
+ "PassphraseRequired"]:
if properties[key] == dbus.Boolean(1):
val = "true"
else:
@@ -69,7 +69,8 @@ def print_properties(key, value):
val = extract_values(properties[key])
elif key in ["Nameservers", "Nameservers.Configuration",
- "Domains", "Domains.Configuration"]:
+ "Domains", "Domains.Configuration",
+ "Security"]:
val = extract_list(properties[key])
elif key in ["Strength", "Priority"]: