Add generic signal strength property
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 14 Dec 2008 01:12:40 +0000 (02:12 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Sun, 14 Dec 2008 01:12:40 +0000 (02:12 +0100)
doc/network-api.txt
plugins/wifi.c
test/list-networks
test/monitor-connman

index 8480fcd..b38e122 100644 (file)
@@ -51,6 +51,10 @@ Properties   string Name [readonly]
                        For manually created networks this is set by
                        default.
 
+               uint8 Strength [readonly]
+
+                       Indicates the signal strength of the network.
+
                array{byte} WiFi.SSID [readonly]
 
                        If the network type is WiFi, then this property is
index 77d8370..70e19e9 100644 (file)
@@ -351,7 +351,7 @@ static void scan_result(struct connman_element *device,
                        element->wifi.security = g_strdup(security);
                }
 
-               connman_element_add_static_property(element, "WiFi.Strength",
+               connman_element_add_static_property(element, "Strength",
                                                DBUS_TYPE_BYTE, &strength);
 
                DBG("%s (%s) strength %d", network->identifier,
@@ -361,7 +361,7 @@ static void scan_result(struct connman_element *device,
        } else {
                data->pending = g_slist_remove(data->pending, element);
 
-               connman_element_set_static_property(element, "WiFi.Strength",
+               connman_element_set_static_property(element, "Strength",
                                                DBUS_TYPE_BYTE, &strength);
        }
 
index 8f7e01b..b446210 100755 (executable)
@@ -42,7 +42,7 @@ for path in properties["Devices"]:
                        if (key == "WiFi.SSID"):
                                ssid = convert_ssid(properties[key])
                                print "        %s = [ %s ]" % (key, ssid)
-                       elif (key == "WiFi.Strength"):
+                       elif (key == "Strength"):
                                print "        %s = %d" % (key, properties[key])
                        else:
                                print "        %s = %s" % (key, properties[key])
index 0c4a2ef..97d3a6b 100755 (executable)
@@ -7,7 +7,7 @@ import dbus.mainloop.glib
 
 def property_changed(name, value, path, interface):
        iface = interface[interface.rfind(".") + 1:]
-       if (name == "WiFi.Strength"):
+       if (name == "Strength"):
                val = int(value)
        else:
                val = str(value)