Add signal strength and noise properties
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2008 00:22:10 +0000 (01:22 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 3 Dec 2008 00:22:10 +0000 (01:22 +0100)
plugins/wifi.c

index 494f53b..0e1526e 100644 (file)
@@ -192,6 +192,7 @@ static void scan_result(struct connman_element *parent,
        element = find_element(data, network->identifier);
        if (element == NULL) {
                const char *security;
+               guint8 strength;
 
                element = connman_element_create(temp);
 
@@ -218,6 +219,17 @@ static void scan_result(struct connman_element *parent,
                connman_element_add_static_property(element, "WiFi.Security",
                                                DBUS_TYPE_STRING, &security);
 
+               strength = network->quality;
+
+               connman_element_add_static_property(element, "WiFi.Strength",
+                                               DBUS_TYPE_BYTE, &strength);
+
+               connman_element_add_static_property(element, "WiFi.Noise",
+                                       DBUS_TYPE_INT32, &network->noise);
+
+               DBG("%s (%s) strength %d", network->identifier,
+                                                       security, strength);
+
                connman_element_register(element, parent);
        }