/* * lock_s - Ultra simple DVB-S lock test application * A minimal lock test application derived from szap.c * for testing purposes * * This program 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 of the License, or * (at your option) any later version. * * This program 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. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define FEDEVICE "/dev/dvb/adapter%d/frontend%d" static char *usage_str = "\n lock_s ver:0.0.1: Simple utility to test DVB-S signal lock.\n" " \n" " usage: lock_s [[PARAMS] [OPTIONS]]\n" " dvbstune [params] tune to user provided DVB-S parameters\n" " -a number : use given adapter (default 0)\n" " -f number : use given frontend (default 0)\n" " -p params : parameters to be used for tuning\n" " frequency (Mhz) Polarization (v/h) Symbol rate (MSPS)\n" " \n" " -s pos : DiSEqC switch position\n" " -H : human readable output\n" " -l lnb-type (DVB-S Only) (use -l help to print types) or \n" " -l low[,high[,switch]] in Mhz\n"; static char *univ_desc[] = { "Europe", "10800 to 11800 MHz and 11600 to 12700 Mhz", "Dual LO, loband 9750, hiband 10600 MHz", (char *)NULL }; static char *dbs_desc[] = { "Expressvu, North America", "12200 to 12700 MHz", "Single LO, 11250 MHz", (char *)NULL }; static char *standard_desc[] = { "10945 to 11450 Mhz", "Single LO, 10000 Mhz", (char *)NULL }; static char *enhan_desc[] = { "Astra", "10700 to 11700 MHz", "Single LO, 9750 MHz", (char *)NULL }; static char *cband_desc[] = { "Big Dish", "3700 to 4200 MHz", "Single LO, 5150 Mhz", (char *)NULL }; enum sec_bands { SEC_LO_BAND = 0, SEC_HI_BAND = 1, }; struct sec_params { unsigned int freq; enum fe_sec_voltage voltage; unsigned int srate; unsigned int freq_if; int pos; /* DiSEqC sw. pos */ fe_sec_tone_mode_t tone; fe_sec_mini_cmd_t burst; }; struct lnb_types_st { char *name; char **desc; unsigned long low_val; unsigned long high_val; /* zero indicates no hiband */ unsigned long switch_val; /* zero indicates no hiband */ } lnbs[] = { {"UNIVERSAL", univ_desc, 9750, 10600, 11700 }, {"DBS", dbs_desc, 11250, 0, 0 }, {"STANDARD", standard_desc, 10000, 0, 0 }, {"ENHANCED", enhan_desc, 9750, 0, 0 }, {"C-BAND", cband_desc, 5150, 0, 0 }, }; struct diseqc_cmd { struct dvb_diseqc_master_cmd cmd; uint32_t wait; }; int lnb_parse(char *str, struct lnb_types_st *lnbp) { int i; char *cp, *np; memset(lnbp, 0, sizeof (*lnbp)); cp = str; while (*cp && isspace(*cp)) cp++; if (isalpha(*cp)) { for (i = 0; i < (int)(sizeof(lnbs) / sizeof(lnbs[0])); i++) { if (!strcasecmp(lnbs[i].name, cp)) { *lnbp = lnbs[i]; return 1; } } return -1; } if (*cp == '\0' || !isdigit(*cp)) return -1; lnbp->low_val = strtoul(cp, &np, 0); if (lnbp->low_val == 0) return -1; cp = np; while(*cp && (isspace(*cp) || *cp == ',')) cp++; if (*cp == '\0') return 1; if (!isdigit(*cp)) return -1; lnbp->high_val = strtoul(cp, &np, 0); cp = np; while(*cp && (isspace(*cp) || *cp == ',')) cp++; if (*cp == '\0') return 1; if (!isdigit(*cp)) return -1; lnbp->switch_val = strtoul(cp, NULL, 0); return 1; } int params_decode(char *str, char **argv, struct sec_params *params) { unsigned int freq; char *pol; char *cp, *np; cp = str; while (*cp && isspace(*cp)) cp++; /* get frequency */ if (*cp == '\0' || !isdigit(*cp)) return -1; freq = strtoul(cp, &np, 0); params->freq = freq; if (freq == 0) return -1; /* polarization v=13v:0, h=18v:0 */ pol = argv[optind]; /* v/h */ (!strncmp(pol, "v", 1)) ? (params->voltage = 0) : (params->voltage = 1); params->srate = strtoul(argv[optind + 1], NULL, 0); return 1; } /** * lnb_setup(struct lnb_types_st *lnb, unsigned int freq, unsigned int *freq_if) * @lnb : lnb type as described int lnb_types_st * @freq
# Channel table for ItanhaƩm - SP - Brazil
# Source: http://www.portalbsd.com.br/terrestres_channels.php?channels=552

# Physical channel 17
[TV Tribuna]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 491142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0

# Physical channel 24
[TVB]
	DELIVERY_SYSTEM = ISDBT
	BANDWIDTH_HZ = 6000000
	FREQUENCY = 533142857
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	INVERSION = AUTO
	GUARD_INTERVAL = AUTO
	TRANSMISSION_MODE = AUTO
	ISDBT_LAYER_ENABLED = 7
	ISDBT_SOUND_BROADCASTING = 0
	ISDBT_SB_SUBCHANNEL_ID = 0
	ISDBT_SB_SEGMENT_IDX = 0
	ISDBT_SB_SEGMENT_COUNT = 0
	ISDBT_LAYERA_FEC = AUTO
	ISDBT_LAYERA_MODULATION = QAM/AUTO
	ISDBT_LAYERA_SEGMENT_COUNT = 0
	ISDBT_LAYERA_TIME_INTERLEAVING = 0
	ISDBT_LAYERB_FEC = AUTO
	ISDBT_LAYERB_MODULATION = QAM/AUTO
	ISDBT_LAYERB_SEGMENT_COUNT = 0
	ISDBT_LAYERB_TIME_INTERLEAVING = 0
	ISDBT_LAYERC_FEC = AUTO
	ISDBT_LAYERC_MODULATION = QAM/AUTO
	ISDBT_LAYERC_SEGMENT_COUNT = 0
	ISDBT_LAYERC_TIME_INTERLEAVING = 0
if (ret < 0) { fprintf(stderr, "check frontend failed\n"); goto err;; } err: return ret; }