diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | Makefile.in | 11 | ||||
-rw-r--r-- | parser.c | 8 | ||||
-rw-r--r-- | parser.h | 8 | ||||
-rw-r--r-- | processor.c | 30 |
5 files changed, 49 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am index 331b33f..8743c2b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,6 +21,7 @@ evaluator.c evaluator.h \ client.c client.h \ system.c system.h \ isdn.c isdn.h \ +wifi.c wifi.h \ mail.c mail.h \ seti.c seti.h \ battery.c battery.h \ diff --git a/Makefile.in b/Makefile.in index 5d6eae5..cd33079 100644 --- a/Makefile.in +++ b/Makefile.in @@ -101,7 +101,7 @@ AM_CFLAGS = $(X_CFLAGS) -D_GNU_SOURCE -Wall lcd4linux_LDFLAGS = $(X_LIBS) lcd4linux_LDADD = liblcd4linux.la @DRVLIBS@ -lcd4linux_SOURCES = lcd4linux.c pid.c pid.h parser.c parser.h processor.c processor.h evaluator.c evaluator.h client.c client.h system.c system.h isdn.c isdn.h mail.c mail.h seti.c seti.h battery.c battery.h dvb.c dvb.h filter.c filter.h widget.c widget.h exec.c exec.h mail2.c socket.c socket.h imon.c imon.h +lcd4linux_SOURCES = lcd4linux.c pid.c pid.h parser.c parser.h processor.c processor.h evaluator.c evaluator.h client.c client.h system.c system.h isdn.c isdn.h wifi.c wifi.h mail.c mail.h seti.c seti.h battery.c battery.h dvb.c dvb.h filter.c filter.h widget.c widget.h exec.c exec.h mail2.c socket.c socket.h imon.c imon.h liblcd4linux_la_DEPENDENCIES = @DRIVERS@ @@ -138,9 +138,10 @@ PROGRAMS = $(bin_PROGRAMS) lcd4linux_OBJECTS = lcd4linux.$(OBJEXT) pid.$(OBJEXT) parser.$(OBJEXT) \ processor.$(OBJEXT) evaluator.$(OBJEXT) client.$(OBJEXT) \ -system.$(OBJEXT) isdn.$(OBJEXT) mail.$(OBJEXT) seti.$(OBJEXT) \ -battery.$(OBJEXT) dvb.$(OBJEXT) filter.$(OBJEXT) widget.$(OBJEXT) \ -exec.$(OBJEXT) mail2.$(OBJEXT) socket.$(OBJEXT) imon.$(OBJEXT) +system.$(OBJEXT) isdn.$(OBJEXT) wifi.$(OBJEXT) mail.$(OBJEXT) \ +seti.$(OBJEXT) battery.$(OBJEXT) dvb.$(OBJEXT) filter.$(OBJEXT) \ +widget.$(OBJEXT) exec.$(OBJEXT) mail2.$(OBJEXT) socket.$(OBJEXT) \ +imon.$(OBJEXT) lcd4linux_DEPENDENCIES = liblcd4linux.la CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -167,7 +168,7 @@ DEP_FILES = .deps/BeckmannEgle.P .deps/Crystalfontz.P .deps/Cwlinux.P \ .deps/isdn.P .deps/lcd4linux.P .deps/lock.P .deps/mail.P .deps/mail2.P \ .deps/parport.P .deps/parser.P .deps/pid.P .deps/pixmap.P \ .deps/processor.P .deps/seti.P .deps/socket.P .deps/system.P \ -.deps/udelay.P .deps/widget.P +.deps/udelay.P .deps/widget.P .deps/wifi.P SOURCES = $(liblcd4linux_la_SOURCES) $(lcd4linux_SOURCES) $(EXTRA_lcd4linux_SOURCES) OBJECTS = $(liblcd4linux_la_OBJECTS) $(lcd4linux_OBJECTS) @@ -1,4 +1,4 @@ -/* $Id: parser.c,v 1.22 2003/10/12 06:08:28 nicowallmeier Exp $ +/* $Id: parser.c,v 1.23 2003/11/11 04:40:20 reinelt Exp $ * * row definition parser * @@ -22,6 +22,9 @@ * * * $Log: parser.c,v $ + * Revision 1.23 2003/11/11 04:40:20 reinelt + * WIFI patch from Xavier Vello + * * Revision 1.22 2003/10/12 06:08:28 nicowallmeier * imond/telmond support * @@ -180,6 +183,9 @@ static SYMTAB Symtab[] = {{ "%", T_PERCENT, C_GENERIC, 0 }, { "io", T_ISDN_OUT, C_ISDN, 1 }, { "it", T_ISDN_TOTAL, C_ISDN, 1 }, { "im", T_ISDN_MAX, C_ISDN, 1 }, + { "ws", T_WIFI_SIGNAL, C_WIFI, 1 }, + { "wl", T_WIFI_LINK, C_WIFI, 1 }, + { "wn", T_WIFI_NOISE, C_WIFI, 1 }, { "ti", T_PPP_RX, C_PPP, 1 }, { "to", T_PPP_TX, C_PPP, 1 }, { "tt", T_PPP_TOTAL, C_PPP, 1 }, @@ -1,4 +1,4 @@ -/* $Id: parser.h,v 1.15 2003/10/12 06:08:28 nicowallmeier Exp $ +/* $Id: parser.h,v 1.16 2003/11/11 04:40:20 reinelt Exp $ * * row definition parser * @@ -22,6 +22,9 @@ * * * $Log: parser.h,v $ + * Revision 1.16 2003/11/11 04:40:20 reinelt + * WIFI patch from Xavier Vello + * * Revision 1.15 2003/10/12 06:08:28 nicowallmeier * imond/telmond support * @@ -98,6 +101,7 @@ typedef enum { T_ETH_RX, T_ETH_TX, T_ETH_TOTAL, T_ETH_MAX, T_PPP_RX, T_PPP_TX, T_PPP_TOTAL, T_PPP_MAX, T_ISDN_USED, T_ISDN_IN, T_ISDN_OUT, T_ISDN_TOTAL, T_ISDN_MAX, + T_WIFI_SIGNAL, T_WIFI_LINK, T_WIFI_NOISE, T_SETI_PRC, T_SETI_CPU, T_BATT_PERC, T_BATT_STAT, T_BATT_DUR, T_DVB_STRENGTH, T_DVB_SNR, @@ -111,7 +115,7 @@ typedef enum { } TOKEN; typedef enum { - C_GENERIC, C_MEM, C_LOAD, C_CPU, C_DISK, C_ETH, C_PPP, C_ISDN, C_SETI, C_BATT, C_DVB, + C_GENERIC, C_MEM, C_LOAD, C_CPU, C_DISK, C_ETH, C_PPP, C_ISDN, C_WIFI, C_SETI, C_BATT, C_DVB, C_MAIL, C_SENSOR, C_EXEC, C_IMON, C_TELMON } CLASS; diff --git a/processor.c b/processor.c index 9ac9786..bd6faf7 100644 --- a/processor.c +++ b/processor.c @@ -1,4 +1,4 @@ -/* $Id: processor.c,v 1.49 2003/10/12 06:08:28 nicowallmeier Exp $ +/* $Id: processor.c,v 1.50 2003/11/11 04:40:20 reinelt Exp $ * * main data processing * @@ -22,6 +22,9 @@ * * * $Log: processor.c,v $ + * Revision 1.50 2003/11/11 04:40:20 reinelt + * WIFI patch from Xavier Vello + * * Revision 1.49 2003/10/12 06:08:28 nicowallmeier * imond/telmond support * @@ -230,6 +233,7 @@ #include "cfg.h" #include "system.h" #include "isdn.h" +#include "wifi.h" #include "parser.h" #include "display.h" #include "bar.h" @@ -257,6 +261,7 @@ static struct { double user, nice, system, idle; } busy; static struct { int read, write, total, max, peak; } disk; static struct { int rx, tx, total, max, peak, bytes; } net; static struct { int usage, in, out, total, max, peak; } isdn; +static struct { int signal, link, noise; } wifi; static struct { int rx, tx, total, max, peak; } ppp; static struct { int perc, stat; double dur; } batt; static struct { double perc, cput; } seti; @@ -336,6 +341,13 @@ static double query (int token) return isdn.max; case T_ISDN_USED: return isdn.usage; + + case T_WIFI_SIGNAL: + return wifi.signal; + case T_WIFI_LINK: + return wifi.link; + case T_WIFI_NOISE: + return wifi.noise; case T_PPP_RX: return ppp.rx; @@ -430,6 +442,11 @@ static double query_bar (int token) return value/isdn.peak; case T_ISDN_TOTAL: return value/isdn.peak/2.0; + + case T_WIFI_SIGNAL: + case T_WIFI_LINK: + case T_WIFI_NOISE: + return value/100; case T_PPP_RX: case T_PPP_TX: @@ -562,6 +579,13 @@ static void print_token (int token, char **p, char *start) else *p+=sprintf (*p, " "); break; + + case T_WIFI_SIGNAL: + case T_WIFI_LINK: + case T_WIFI_NOISE: + *p+=sprintf (*p, "%3.0f", query(token)); + break; + case T_SETI_PRC: val=100.0*query(token); @@ -722,6 +746,10 @@ static void collect_data (void) isdn.max=isdn.in>isdn.out?isdn.in:isdn.out; if (isdn.max>isdn.peak) isdn.peak=isdn.max; } + + if (token_usage[C_WIFI]) { + Wifi (&wifi.signal, &wifi.link, &wifi.noise); + } if (token_usage[C_PPP]) { PPP (0, &ppp.rx, &ppp.tx); |