/* $Id: plugin_w1retap.c * * plugin to perform simple file operations for w1retap * * Copyright (C) 2007 Jonathan Hudson * Copyright (C) 2006 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. * */ /* * This module returns a specific value associated with a key from a * file containing one or more lines formatted as KEY=VALUE. * * It is intended for use with the w1retap weather station logging * software , but is applicable * to any similarly formatted file. */ /* * exported functions: * * int plugin_init_file (void) * adds various functions * */ #include "config.h" #include #include #include #include #include "debug.h" #include "plugin.h" #ifdef WITH_DMALLOC #include #endif /* function 'my_readkey' */ /* takes two arguments, file name and key */ /* returns value associated with key, trimmed to suitable dec places */ static void my_readkey(RESULT * result, RESULT * arg1, RESULT * arg2) { char value[80], val2[80]; FILE *fp; char *reqkey, *pval; size_t size; *value = 0; pval = value; reqkey = R2S(arg2); fp = fopen(R2S(arg1), "r"); if (!fp) { error("w1retap couldn't open file '%s'", R2S(arg1)); value[0] = '\0'; } else { size = strlen(reqkey); while (!feof(fp) && pval == value) { fgets(val2, sizeof(val2), fp); if (*(val2 + size) == '=') { if (strncmp(val2, reqkey, size) == 0) { char *p; p = index(val2, ' '); if (p == NULL) { p = index(val2, '\n'); } if (p) { *p = 0; pval = val2 + size + 1; { double d; char *ep; d = strtod(pval, &ep); if (ep != pval && (*ep == 0 || isspace(*ep))) { if (d > 500) sprintf(val2, "%.0f", d); else sprintf(val2, "%.1f", d); pval = val2; } } } } } } fclose(fp); } /* store result */ SetResult(&result, R_STRING, pval); } /* plugin initialization */ /* MUST NOT be declared 'static'! */ int plugin_init_w1retap(void) { /* register all our cool functions */ /* the second parameter is the number of arguments */ /* -1 stands for variable argument list */ AddFunction("w1retap::readkey", 2, my_readkey); return 0; } void plugin_exit_w1retap(void)
# DVB-T Trencin (Trencin, Slovak Republic)
# Created from http://www.dvbt.towercom.sk/odbornici.php
# T freq bw fec_hi fec_lo mod transmission-mode guard-interval hierarchy

# 2.st multiplex (commercial) - on channel 52
T 722000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE

# 3.st multiplex (public) - on channel 57
T 762000000 8MHz 2/3 NONE QAM64 8k 1/4 NONE