]>
git.gir.st - ttxd.git/blob - src/szap-s2/lnb.c
6 static char *univ_desc
[] = {
8 "10800 to 11800 MHz and 11600 to 12700 Mhz",
9 "Dual LO, loband 9750, hiband 10600 MHz",
12 static char *dbs_desc
[] = {
13 "Expressvu, North America",
15 "Single LO, 11250 MHz",
18 static char *standard_desc
[] = {
20 "Single LO, 10000 Mhz",
23 static char *enhan_desc
[] = {
26 "Single LO, 9750 MHz",
29 static char *cband_desc
[] = {
32 "Single LO, 5150 Mhz",
35 static struct lnb_types_st lnbs
[] = {
36 {"UNIVERSAL", univ_desc
, 9750, 10600, 11700 },
37 {"DBS", dbs_desc
, 11250, 0, 0 },
38 {"STANDARD", standard_desc
, 10000, 0, 0 },
39 {"ENHANCED", enhan_desc
, 9750, 0, 0 },
40 {"C-BAND", cband_desc
, 5150, 0, 0 }
43 /* Enumerate through standard types of LNB's until NULL returned.
44 * Increment curno each time
50 if (curno
>= (int) (sizeof(lnbs
) / sizeof(lnbs
[0])))
51 return (struct lnb_types_st
*)NULL
;
55 /* Decode an lnb type, for example given on a command line
56 * If alpha and standard type, e.g. "Universal" then match that
57 * otherwise low[,high[,switch]]
61 lnb_decode(char *str
, struct lnb_types_st
*lnbp
)
66 memset(lnbp
, 0, sizeof(*lnbp
));
68 while(*cp
&& isspace(*cp
))
71 for (i
= 0; i
< (int)(sizeof(lnbs
) / sizeof(lnbs
[0])); i
++) {
72 if (!strcasecmp(lnbs
[i
].name
, cp
)) {
79 if (*cp
== '\0' || !isdigit(*cp
))
81 lnbp
->low_val
= strtoul(cp
, &np
, 0);
82 if (lnbp
->low_val
== 0)
85 while(*cp
&& (isspace(*cp
) || *cp
== ','))
91 lnbp
->high_val
= strtoul(cp
, &np
, 0);
93 while(*cp
&& (isspace(*cp
) || *cp
== ','))
99 lnbp
->switch_val
= strtoul(cp
, NULL
, 0);