From: Marcel Holtmann Date: Sun, 14 Dec 2008 01:12:40 +0000 (+0100) Subject: Add generic signal strength property X-Git-Tag: 0.3~4 X-Git-Url: http://git.maemo.org/git/?p=connman;a=commitdiff_plain;h=c634b10c2613e71f2824171b9a42c1728f801c71 Add generic signal strength property --- diff --git a/doc/network-api.txt b/doc/network-api.txt index 8480fcd..b38e122 100644 --- a/doc/network-api.txt +++ b/doc/network-api.txt @@ -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 diff --git a/plugins/wifi.c b/plugins/wifi.c index 77d8370..70e19e9 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -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); } diff --git a/test/list-networks b/test/list-networks index 8f7e01b..b446210 100755 --- a/test/list-networks +++ b/test/list-networks @@ -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]) diff --git a/test/monitor-connman b/test/monitor-connman index 0c4a2ef..97d3a6b 100755 --- a/test/monitor-connman +++ b/test/monitor-connman @@ -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)