Patches from Xavier:
- WiFi: make interface configurable
- "quiet" as an option from the config file
- ignore missing "MemShared" on Linux 2.6
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@278
3ae390bd-cb1e-0410-b409-
cd5a39f66f1f
-/* $Id: lcd4linux.c,v 1.51 2003/11/16 09:45:49 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.52 2003/12/01 07:08:50 reinelt Exp $
*
* LCD4Linux
*
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.52 2003/12/01 07:08:50 reinelt
+ *
+ * Patches from Xavier:
+ * - WiFi: make interface configurable
+ * - "quiet" as an option from the config file
+ * - ignore missing "MemShared" on Linux 2.6
+ *
* Revision 1.51 2003/11/16 09:45:49 reinelt
* Crystalfontz changes, small glitch in getopt() fixed
*
pid_exit(PIDFILE);
exit (0);
}
+
+ // check the conf to see if quiet startup is wanted
+ if (!quiet) {
+ quiet = atoi(cfg_get("Quiet", "0"));
+ }
if (!quiet && hello()) {
sleep (3);
-/* $Id: system.c,v 1.30 2003/10/05 17:58:50 reinelt Exp $
+/* $Id: system.c,v 1.31 2003/12/01 07:08:51 reinelt Exp $
*
* system status retreivement
*
*
*
* $Log: system.c,v $
+ * Revision 1.31 2003/12/01 07:08:51 reinelt
+ *
+ * Patches from Xavier:
+ * - WiFi: make interface configurable
+ * - "quiet" as an option from the config file
+ * - ignore missing "MemShared" on Linux 2.6
+ *
* Revision 1.30 2003/10/05 17:58:50 reinelt
* libtool junk; copyright messages cleaned up
*
return -1;
}
if ((v3=parse_meminfo ("MemShared:", buffer))<0) {
+ // The "MemShared" entriy disappeared in Kernel 2.6...
+#if 0
fd=-1;
return -1;
+#else
+ v3=0;
+#endif
}
if ((v4=parse_meminfo ("Buffers:", buffer))<0) {
fd=-1;
-/* $Id: wifi.c,v 1.2 2003/11/28 18:34:55 nicowallmeier Exp $
+/* $Id: wifi.c,v 1.3 2003/12/01 07:08:51 reinelt Exp $
*
* WIFI specific functions
*
*
*
* $Log: wifi.c,v $
+ * Revision 1.3 2003/12/01 07:08:51 reinelt
+ *
+ * Patches from Xavier:
+ * - WiFi: make interface configurable
+ * - "quiet" as an option from the config file
+ * - ignore missing "MemShared" on Linux 2.6
+ *
* Revision 1.2 2003/11/28 18:34:55 nicowallmeier
* Minor bugfixes
*
#include "debug.h"
#include "wifi.h"
#include "filter.h"
-
-typedef struct {
- int signal;
- int link;
- int noise;
-} CPS;
+#include "cfg.h"
int Wifi (int *signal, int *link, int *noise)
{
static int fd=-2;
char buffer[4096];
char *p;
+
+ char *interface=cfg_get("Wifi.Interface","wlan0");
+
*signal=0;
*link=0;
*noise=0;
+
if (fd==-1) return -1;
if (fd==-2) {
fd = open("/proc/net/wireless", O_RDONLY); // the real procfs file
- // fd = open("/wireless", O_RDONLY); // a fake file for testing
+ //fd = open("/wireless", O_RDONLY); // a fake file for testing
if (fd==-1) {
error ("open(/proc/net/wireless) failed: %s", strerror(errno));
return -1;
return -1;
}
- p=strstr(buffer, "wlan0");
+ p=strstr(buffer, interface);
if (p!=NULL) {
+ // TODO : size of interface ??
if (sscanf(p+13, "%d", &wl)!=1) {
error ("parse(/proc/net/wireless) failed: unknown format");
fd=-1;