72fe43fd1b0d7c0819b2f2f1a62112e8bcac83bf
[openwrt/svn-archive/archive.git] / utils / collectd / patches / 200-wireless-compat.patch
1 Index: collectd-4.4.0/src/wireless.c
2 ===================================================================
3 --- collectd-4.4.0.orig/src/wireless.c 2008-06-05 21:47:01.000000000 +0200
4 +++ collectd-4.4.0/src/wireless.c 2008-06-05 21:48:33.000000000 +0200
5 @@ -128,7 +128,9 @@
6 power = 1.0; /* invalid */
7 else if ((power >= 0.0) && (power <= 100.0))
8 power = wireless_percent_to_power (power);
9 - else if (power > 100.0)
10 + else if ((power > 100.0) && (power <= 256.0))
11 + power = power - 256.0;
12 + else if (power > 0.0)
13 power = 1.0; /* invalid */
14
15 /* noise [dBm] < 0.0 */
16 @@ -137,7 +139,9 @@
17 noise = 1.0; /* invalid */
18 else if ((noise >= 0.0) && (noise <= 100.0))
19 noise = wireless_percent_to_power (noise);
20 - else if (noise > 100.0)
21 + else if ((noise > 100.0) && (noise <= 256.0))
22 + noise = noise - 256.0;
23 + else if (noise > 0.0)
24 noise = 1.0; /* invalid */
25
26 wireless_submit (device, "signal_quality", quality);