EN50494: add gui interface for configuration

- EN50494 configuration
- revert drop off compiler optimation
This commit is contained in:
InuSasha 2014-01-06 19:05:26 +01:00
parent 1673b4a2cd
commit 8792c5cb42
3 changed files with 137 additions and 2 deletions

View file

@ -29,7 +29,7 @@ PROG := $(BUILDDIR)/tvheadend
CFLAGS += -Wall -Werror -Wwrite-strings -Wno-deprecated-declarations
CFLAGS += -Wmissing-prototypes -fms-extensions
CFLAGS += -g -funsigned-char
CFLAGS += -g -funsigned-char -O2
CFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += -I${BUILDDIR} -I${ROOTDIR}/src -I${ROOTDIR}
LDFLAGS += -lrt -ldl -lpthread -lm

View file

@ -188,7 +188,7 @@ linuxdvb_en50494_tune
data1 |= band << 2; /* 1bit band lower(0)/upper(1) */
data1 |= t >> 8; /* 2bit transponder value bit 1-2 */
data2 = t & 0xFF; /* 8bit transponder value bit 3-10 */
tvhlog(LOG_INFO, LINUXDVB_EN50494_NAME,
tvhlog(LOG_DEBUG, LINUXDVB_EN50494_NAME,
"lnb=%i, id=%i, freq=%i, pin=%i, v/h=%i, l/u=%i, f=%i, data=0x%02X%02X",
le->le_position, le->le_id, le->le_frequency, le->le_pin, pol, band, freq, data1, data2);

View file

@ -163,6 +163,115 @@ linuxdvb_satconf_class_orbitalpos_set
return 1;
}
static const void *
linuxdvb_satconf_class_en50494_id_get ( void *p )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse = TAILQ_FIRST(&ls->ls_elements);
linuxdvb_en50494_t *le;
static uint16_t default_value = 0;
if (!lse && !lse->ls_en50494)
return &default_value;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
return &le->le_id;
}
static int
linuxdvb_satconf_class_en50494_id_set
( void *p, const void *v )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse;
linuxdvb_en50494_t *le;
uint16_t new_value = *(uint16_t*)v;
if (new_value < 0 || new_value > 7)
return 1;
TAILQ_FOREACH(lse, &ls->ls_elements, ls_link) {
if (!lse && !lse->ls_en50494)
continue;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
le->le_id = new_value;
}
return 0;
}
static const void *
linuxdvb_satconf_class_en50494_freq_get ( void *p )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse = TAILQ_FIRST(&ls->ls_elements);
linuxdvb_en50494_t *le;
static uint16_t default_value = 0;
if (!lse && !lse->ls_en50494)
return &default_value;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
return &le->le_frequency;
}
static int
linuxdvb_satconf_class_en50494_freq_set
( void *p, const void *v )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse;
linuxdvb_en50494_t *le;
uint16_t new_value = *(uint16_t*)v;
TAILQ_FOREACH(lse, &ls->ls_elements, ls_link) {
if (!lse && !lse->ls_en50494)
continue;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
le->le_frequency = new_value;
}
return 0;
}
static const void *
linuxdvb_satconf_class_en50494_pin_get ( void *p )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse = TAILQ_FIRST(&ls->ls_elements);
linuxdvb_en50494_t *le;
static uint16_t default_value = 256;
if (!lse && !lse->ls_en50494)
return &default_value;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
return &le->le_pin;
}
static int
linuxdvb_satconf_class_en50494_pin_set
( void *p, const void *v )
{
linuxdvb_satconf_t *ls = p;
linuxdvb_satconf_ele_t *lse;
linuxdvb_en50494_t *le;
uint16_t new_value = *(uint16_t*)v;
if (new_value < 0 || new_value > 256)
return 1;
TAILQ_FOREACH(lse, &ls->ls_elements, ls_link) {
if (!lse && !lse->ls_en50494)
continue;
le = (linuxdvb_en50494_t*)lse->ls_en50494;
le->le_pin = new_value;
}
return 0;
}
static idnode_set_t *
linuxdvb_satconf_class_get_childs ( idnode_t *o )
{
@ -325,6 +434,32 @@ const idclass_t linuxdvb_satconf_en50494_class =
.list = linuxdvb_satconf_ele_class_network_enum,
.opts = PO_NOSAVE,
},
{
.type = PT_U16,
.id = "id",
.name = "ID (0-7)",
.get = linuxdvb_satconf_class_en50494_id_get,
.set = linuxdvb_satconf_class_en50494_id_set,
.opts = PO_NOSAVE,
// TODO: add id list
},
{
.type = PT_U16,
.id = "freqency",
.name = "Freqency (MHz)",
.get = linuxdvb_satconf_class_en50494_freq_get,
.set = linuxdvb_satconf_class_en50494_freq_set,
.opts = PO_NOSAVE,
},
{
.type = PT_U16,
.id = "pin",
.name = "PIN (0-255, 256 for no pin)",
.get = linuxdvb_satconf_class_en50494_pin_get,
.set = linuxdvb_satconf_class_en50494_pin_set,
.opts = PO_NOSAVE,
// TODO: add pin list
},
{}
}
};