diff --git a/Makefile b/Makefile index 6b8303ad..4525bfd8 100644 --- a/Makefile +++ b/Makefile @@ -178,6 +178,7 @@ SRCS-${CONFIG_LINUXDVB} += \ src/input/mpegts/linuxdvb/linuxdvb_satconf.c \ src/input/mpegts/linuxdvb/linuxdvb_lnb.c \ src/input/mpegts/linuxdvb/linuxdvb_switch.c \ + src/input/mpegts/linuxdvb/linuxdvb_rotor.c \ src/input/mpegts/linuxdvb/diseqc.c # IPTV diff --git a/src/input/mpegts/linuxdvb/linuxdvb_lnb.c b/src/input/mpegts/linuxdvb/linuxdvb_lnb.c index 64fec418..c037ab2c 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_lnb.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_lnb.c @@ -216,7 +216,7 @@ linuxdvb_lnb_create0 if (!strcmp(linuxdvb_lnb_list[i].lnb_name, name)) return (linuxdvb_lnb_t*)&linuxdvb_lnb_list[i]; } - return NULL; + return (linuxdvb_lnb_t*)linuxdvb_lnb_list; // Universal } #if 0 diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c new file mode 100644 index 00000000..d5999bb2 --- /dev/null +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -0,0 +1,96 @@ +/* + * Tvheadend - Linux DVB DiseqC Rotor + * + * Copyright (C) 2013 Adam Sutton + * + * 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 3 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, see . + */ + +#include "tvheadend.h" +#include "linuxdvb_private.h" +#include "diseqc.h" +#include "settings.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +/* ************************************************************************** + * Class definition + * *************************************************************************/ + +typedef struct linuxdvb_rotor +{ + linuxdvb_diseqc_t; + + /* Port settings */ + int ls_toneburst; + int ls_committed; + int ls_uncomitted; + +} linuxdvb_rotor_t; + +const idclass_t linuxdvb_rotor_class = +{ + .ic_class = "linuxdvb_switch", + .ic_caption = "DiseqC switch", + .ic_properties = (const property_t[]) { + } +}; + +/* ************************************************************************** + * Class methods + * *************************************************************************/ + +static int +linuxdvb_rotor_tune + ( linuxdvb_diseqc_t *ld, linuxdvb_mux_t *lm, int fd ) +{ + return 0; +} + +/* ************************************************************************** + * Create / Config + * *************************************************************************/ + +linuxdvb_diseqc_t * +linuxdvb_rotor_create0 + ( const char *name, htsmsg_t *conf ) +{ + linuxdvb_diseqc_t *ld + = linuxdvb_diseqc_create(linuxdvb_rotor, NULL, conf); + if (ld) { + ld->ld_tune = linuxdvb_rotor_tune; + } + + return ld; +} + +#if 0 +void +linuxvb_lnb_destroy ( linuxdvb_lnb_t *lnb ) +{ +} +#endif + +/****************************************************************************** + * Editor Configuration + * + * vim:sts=2:ts=2:sw=2:et + *****************************************************************************/ diff --git a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c index a5a78049..b52e34bf 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_satconf.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_satconf.c @@ -395,6 +395,8 @@ linuxdvb_satconf_t * linuxdvb_satconf_create0 ( const char *uuid, htsmsg_t *conf ) { + const char *s; + htsmsg_t *e; linuxdvb_satconf_t *ls = mpegts_input_create(linuxdvb_satconf, uuid, conf); /* Input callbacks */ @@ -414,6 +416,25 @@ linuxdvb_satconf_create0 ls->mi_grace_period = linuxdvb_satconf_grace_period; ls->lfe_open_pid = linuxdvb_satconf_open_pid; + /* Config */ + if (conf) { + + /* LNB */ + e = htsmsg_get_map(conf, "lnb"); + s = e ? htsmsg_get_str(e, "type") : NULL; + ls->ls_lnb = linuxdvb_lnb_create0(s, e); + + /* Switch */ + e = htsmsg_get_map(conf, "switch"); + s = e ? htsmsg_get_str(e, "type") : NULL; + ls->ls_switch = linuxdvb_switch_create0(s, e); + + /* Rotor */ + e = htsmsg_get_map(conf, "rotor"); + s = e ? htsmsg_get_str(e, "type") : NULL; + ls->ls_rotor = linuxdvb_rotor_create0(s, e); + } + return ls; } diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index da0ebc7b..53ca4269 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -88,6 +88,7 @@ const idclass_t linuxdvb_switch_class = .off = offsetof(linuxdvb_switch_t, ls_toneburst), .list = linuxdvb_switch_class_toneburst_list }, + {} } };