/* $Id$ * $URL$ * * generic driver helper for serial and usbserial displays * * Copyright (C) 1999, 2000 Michael Reinelt * Copyright (C) 2004 The LCD4Linux Team * * 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. * */ /* * * exported fuctions: * * int drv_generic_serial_open (char *section, char *driver, unsigned int flags) * opens the serial port * * int drv_generic_serial_poll (char *string, int len) * reads from the serial or USB port * without retry * * int drv_generic_serial_read (char *string, int len); * reads from the serial or USB port * with retry * * void drv_generic_serial_write (char *string, int len); * writes to the serial or USB port * * int drv_generic_serial_close (void); * closes the serial port * */ #include "config.h" #include #include #include #include #include #include #include #include #include #include #include #include "debug.h" #include "qprintf.h" #include "cfg.h" #include "drv_generic_serial.h" extern int got_signal; static char *Section; static char *Driver; static char *Port; static speed_t Speed; static int Device = -1; #define LOCK "/var/lock/LCK..%s" /****************************************/ /*** generic serial/USB communication ***/ /****************************************/ static pid_t drv_generic_serial_lock_port(const char *Port) { char lockfile[256]; char tempfile[256]; char buffer[16]; char *port, *p; int fd, len, pid; if (strncmp(Port, "/dev/", 5) == 0) { port = strdup(Port + 5); } else { port = strdup(Port); } while ((p = strchr(port, '/')) != NULL) { *p = '_'; } qprintf(lockfile, sizeof(lockfile), LOCK, port); qprintf(tempfile, sizeof(tempfile), LOCK, "TMP.XXXXXX"); free(port); if ((fd = mkstemp(tempfile)) == -1) { error("mkstemp(%s) failed: %s", tempfile, strerror(errno)); return -1; } if (fchmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) == -1) { error("fchmod(%s) failed: %s", tempfile, strerror(errno)); close(fd); unlink(tempfile); return -1; } snprintf(buffer, sizeof(buffer), "%10d\n", (int) getpid()); len = strlen(buffer); if (write(fd, buffer, len) != len) { error("write(%s) failed: %s", tempfile, strerror(errno)); close(fd); unlink(tempfile); return -1; } close(fd); while (link(tempfile, lockfile) == -1) { if (errno != EEXIST) { error("link(%s, %s) failed: %s", tempfile, lockfile, strerror(errno)); unlink(tempfile); return -1; } if ((fd = open(lockfile, O_RDONLY)) == -1) { if (errno == ENOENT) continue; /* lockfile disappared */ error("open(%s) failed: %s", lockfile, strerro
# Romania / Bucharest
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy
T 546000000 8MHz 2/3 NONE QAM16 8k 1/16 NONE
T 738000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE # SRTV
T 778000000 8MHz 2/3 NONE QAM64 8k 1/16 NONE # SNR DVB-T