/* $Id: lcd4linux.c,v 1.53 2003/12/19 05:35:14 reinelt Exp $ * * LCD4Linux * * Copyright 1999-2003 Michael Reinelt * * This file is part of LCD4Linux. * * LCD4Linux is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * LCD4Linux is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * * $Log: lcd4linux.c,v $ * Revision 1.53 2003/12/19 05:35:14 reinelt * renamed 'client' to 'plugin' * * 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 * * Revision 1.50 2003/10/22 04:19:16 reinelt * Makefile.in for imon.c/.h, some MatrixOrbital clients * * Revision 1.49 2003/10/11 06:01:53 reinelt * * renamed expression.{c,h} to client.{c,h} * added config file client * new functions 'AddNumericVariable()' and 'AddStringVariable()' * new parameter '-i' for interactive mode * * Revision 1.48 2003/10/05 17:58:50 reinelt * libtool junk; copyright messages cleaned up * * Revision 1.47 2003/09/10 08:37:09 reinelt * icons: reorganized tick_* again... * * Revision 1.46 2003/09/09 06:54:43 reinelt * new function 'cfg_number()' * * Revision 1.45 2003/09/09 05:30:34 reinelt * even more icons stuff * * Revision 1.44 2003/08/24 05:17:58 reinelt * liblcd4linux patch from Patrick Schemitz * * Revision 1.43 2003/08/17 16:37:39 reinelt * more icon framework * * Revision 1.42 2003/08/14 03:47:40 reinelt * remove PID file if driver initialisation fails * * Revision 1.41 2003/08/08 08:05:23 reinelt * added PID file handling * * Revision 1.40 2003/08/08 06:58:06 reinelt * improved forking * * Revision 1.39 2003/07/24 04:48:09 reinelt * 'soft clear' needed for virtual rows * * Revision 1.38 2003/06/13 05:11:11 reinelt * error message cosmetics * * Revision 1.37 2003/04/07 06:03:01 reinelt * further parallel port abstraction * * Revision 1.36 2003/02/22 07:53:10 reinelt * cfg_get(key,defval) * * Revision 1.35 2003/02/13 10:40:17 reinelt * * changed "copyright" to "2003" * added slightly different protocol for MatrixOrbital "LK202" displays * * Revision 1.34 2002/04/29 11:00:28 reinelt * * added Tos
# Sweden - Hallaryd
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 490000000 8MHz 2/3 NONE QAM64 8k 1/8 NONE
<=x) { lcd_put (2, (x-strlen(line2[i]))/2+1, line2[i]); flag=1; break; } } if (flag) lcd_flush(); return flag; } #ifdef USE_OLD_UDELAY void calibrate (void) { int i; unsigned long max=0; printf ("%s\n", release); printf ("calibrating delay loop:"); fflush(stdout); for (i=0; i<10; i++) { udelay_calibrate(); if (loops_per_usec>max) max=loops_per_usec; } printf (" Delay=%ld\n", max); } #endif void handler (int signal) { debug ("got signal %d", signal); got_signal=signal; } int main (int argc, char *argv[]) { char *cfg="/etc/lcd4linux.conf"; char *driver; int c; int quiet=0; int interactive=0; // save arguments for restart my_argv=malloc(sizeof(char*)*(argc+1)); for (c=0; c "); for(fgets(line, 1024, stdin); !feof(stdin); fgets(line, 1024, stdin)) { if (line[strlen(line)-1]=='\n') line[strlen(line)-1]='\0'; if (strlen(line)>0) { Eval(line, &result); if (result.type==R_NUMBER) { printf ("%g\n", R2N(&result)); } else if (result.type==R_STRING) { printf ("'%s'\n", R2S(&result)); } } printf("eval> "); } printf ("\n"); lcd_clear(1); lcd_quit(); 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); lcd_clear(1); } debug ("starting main loop"); // now install our own signal handler signal(SIGHUP, handler); signal(SIGINT, handler); signal(SIGQUIT, handler); signal(SIGTERM, handler); while (got_signal==0) { process (); usleep(tack*1000); } debug ("leaving main loop"); lcd_clear(1); if (!quiet) hello(); lcd_quit(); pid_exit(PIDFILE); if (got_signal==SIGHUP) { long fd; debug ("restarting..."); // close all files on exec for (fd=sysconf(_SC_OPEN_MAX); fd>2; fd--) { int flag; if ((flag=fcntl(fd,F_GETFD,0))!=-1) fcntl(fd,F_SETFD,flag|FD_CLOEXEC); } execv (my_argv[0], my_argv); error ("execv() failed: %s", strerror(errno)); exit(1); } exit (0); }