]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
EN50494: add gui interface for configuration
authorInuSasha <inu@inusasha.de>
Mon, 6 Jan 2014 18:05:26 +0000 (19:05 +0100)
committerInuSasha <inu@inusasha.de>
Mon, 6 Jan 2014 18:05:26 +0000 (19:05 +0100)
- EN50494 configuration
- revert drop off compiler optimation

Makefile
src/input/mpegts/linuxdvb/linuxdvb_en50494.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index a2e5c65cc48573320add0481118d40bac85c89ef..f05a939b5923fca7350084dd3e5f790e84406b19 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index cef567772bbf970f5efe9e0b0bcb57adc11691cf..cc1f5b9bd17d913e018bad4cb42f207fb56e0a0e 100644 (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);
 
index 4b531bcb992acd1bc368944d339f12bc1e9cb094..d7aa8c5adf0fd1b054ba699387554a986fd2cefb 100644 (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
+    },
     {}
   }
 };