linuxdvb: added rotor object, though no implementation yet

This commit is contained in:
Adam Sutton 2013-06-23 13:33:33 +01:00
parent 107451ea07
commit c2bc0a6a75
5 changed files with 120 additions and 1 deletions

View file

@ -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

View file

@ -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

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
#include "tvheadend.h"
#include "linuxdvb_private.h"
#include "diseqc.h"
#include "settings.h"
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/epoll.h>
#include <unistd.h>
#include <fcntl.h>
#include <assert.h>
#include <linux/dvb/dmx.h>
/* **************************************************************************
* 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
*****************************************************************************/

View file

@ -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;
}

View file

@ -88,6 +88,7 @@ const idclass_t linuxdvb_switch_class =
.off = offsetof(linuxdvb_switch_t, ls_toneburst),
.list = linuxdvb_switch_class_toneburst_list
},
{}
}
};