linuxdvb_frontend_t *lfe = (linuxdvb_frontend_t*)ls->ls_frontend;
dvb_mux_t *lm = (dvb_mux_t*)mmi->mmi_mux;
+ /* Not fully configured */
+ if (!lse) return SM_CODE_TUNING_FAILED;
+
/* Test run */
// Note: basically this ensures the tuning params are acceptable
// for the FE, so that if they're not we don't have to wait
if (ls->lse_switch && !strcmp(str ?: "", ls->lse_switch->ld_type))
return 0;
if (ls->lse_switch) linuxdvb_switch_destroy(ls->lse_switch);
- ls->lse_switch = linuxdvb_switch_create0(str, NULL, ls, 0, 0);
+ ls->lse_switch = linuxdvb_switch_create0(str, NULL, ls, -1, -1);
return 1;
}
/* EN50494 */
if (lse->lse_en50494 && (e = htsmsg_get_map(conf, "en50494_conf")))
idnode_load(&lse->lse_en50494->ld_id, e);
-}
+ }
/* Create default LNB */
if (!lse->lse_lnb)
#include "tvheadend.h"
#include "linuxdvb_private.h"
#include "settings.h"
+#include "hts_strtab.h"
#include <sys/ioctl.h>
#include <sys/types.h>
static htsmsg_t *
linuxdvb_switch_class_committed_list ( void *o )
{
- htsmsg_t *m = htsmsg_create_list();
- htsmsg_add_str(m, NULL, "NONE");
- htsmsg_add_str(m, NULL, "AA");
- htsmsg_add_str(m, NULL, "AB");
- htsmsg_add_str(m, NULL, "BA");
- htsmsg_add_str(m, NULL, "BB");
- return m;
+ static const struct strtab tab[] = {
+ { "NONE", -1 },
+ { "AA", 0 },
+ { "AB", 1 },
+ { "BA", 2 },
+ { "BB", 3 },
+ };
+ return strtab2htsmsg(tab);
+}
+
+static htsmsg_t *
+linuxdvb_switch_class_uncommitted_list ( void *o )
+{
+ static const struct strtab tab[] = {
+ { "NONE", -1 },
+ { "0", 0 },
+ { "1", 1 },
+ { "2", 2 },
+ { "3", 3 },
+ { "4", 4 },
+ { "5", 5 },
+ { "6", 6 },
+ { "7", 7 },
+ { "8", 8 },
+ { "9", 9 },
+ { "10", 10 },
+ { "11", 11 },
+ { "12", 12 },
+ { "13", 13 },
+ { "14", 14 },
+ { "15", 15 },
+ };
+ return strtab2htsmsg(tab);
}
static htsmsg_t *
linuxdvb_switch_class_toneburst_list ( void *o )
{
- htsmsg_t *m = htsmsg_create_list();
- htsmsg_add_str(m, NULL, "NONE");
- htsmsg_add_str(m, NULL, "A");
- htsmsg_add_str(m, NULL, "B");
- return m;
+ static const struct strtab tab[] = {
+ { "NONE", -1 },
+ { "A", 0 },
+ { "B", 1 },
+ };
+ return strtab2htsmsg(tab);
}
static const char *
.id = "uncommitted",
.name = "Uncommitted",
.off = offsetof(linuxdvb_switch_t, ls_uncomitted),
+ .list = linuxdvb_switch_class_uncommitted_list
},
{
.type = PT_INT,
return -1;
/* Single committed (before repeats) */
- if (ls->ls_committed > 0) {
+ if (ls->ls_committed >= 0) {
if (sc->lse_parent->ls_diseqc_repeats > 0) {
r2 = 1;
if (linuxdvb_diseqc_send(fd, 0xE0, 0x10, 0x38, 1, com))
for (i = 0; i <= sc->lse_parent->ls_diseqc_repeats; i++) {
/* Uncommitted */
- if (ls->ls_uncomitted > 0) {
+ if (ls->ls_uncomitted >= 0) {
if (linuxdvb_diseqc_send(fd, 0xE0 | r1, 0x10, 0x39, 1,
0xF0 | ls->ls_uncomitted))
return -1;
}
/* Committed */
- if (ls->ls_committed > 0) {
+ if (ls->ls_committed >= 0) {
if (linuxdvb_diseqc_send(fd, 0xE0 | r2, 0x10, 0x38, 1, com))
return -1;
usleep(25000);
}
/* Tone burst */
- if (ls->ls_toneburst > 0) {
+ if (ls->ls_toneburst >= 0) {
tvhtrace("diseqc", "toneburst %s", ls->ls_toneburst ? "B" : "A");
if (ioctl(fd, FE_DISEQC_SEND_BURST,
ls->ls_toneburst ? SEC_MINI_B : SEC_MINI_A)) {