linuxdvb_diseqc_t;
#endif
+ uint32_t lr_powerup_time;
+ uint32_t lr_cmd_time;
+
double lr_sat_lon;
uint32_t lr_position;
.ic_class = "linuxdvb_rotor",
.ic_caption = N_("DiseqC Rotor"),
.ic_get_title = linuxdvb_rotor_class_get_title,
+ .ic_properties = (const property_t[]) {
+ {
+ .type = PT_U32,
+ .id = "powerup_time",
+ .name = N_("Powerup Time (ms) (10-200)"),
+ .off = offsetof(linuxdvb_rotor_t, lr_powerup_time),
+ .def.u32 = 100,
+ },
+ {
+ .type = PT_U32,
+ .id = "cmd_time",
+ .name = N_("Command Time (ms) (10-100)"),
+ .off = offsetof(linuxdvb_rotor_t, lr_cmd_time),
+ .def.u32 = 25
+ },
+ {}
+ }
};
const idclass_t linuxdvb_rotor_gotox_class =
tvherror("diseqc", "failed to set GOTOX pos %d", lr->lr_position);
return -1;
}
- usleep(25000);
+ usleep(MINMAX(lr->lr_cmd_time, 10, 100));
}
tvhdebug("diseqc", "rotor GOTOX pos %d sent", lr->lr_position);
tvherror("diseqc", "failed to send USALS command");
return -1;
}
- usleep(25000);
+ usleep(MINMAX(lr->lr_cmd_time, 10, 100));
}
return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm);
return 0;
/* Force to 18v (quicker movement) */
- if (linuxdvb_satconf_start(lsp, 1, 1))
+ if (linuxdvb_satconf_start(lsp, MINMAX(lr->lr_powerup_time, 10, 200) * 1000, 1))
return -1;
/* GotoX */
{
int i;
linuxdvb_diseqc_t *ld = NULL;
+ linuxdvb_rotor_t *lr;
for (i = 0; i < ARRAY_SIZE(linuxdvb_rotor_all); i++) {
if (!strcmp(name ?: "", linuxdvb_rotor_all[i].name)) {
ld->ld_grace = linuxdvb_rotor_grace;
ld->ld_post = linuxdvb_rotor_post;
}
+ lr = (linuxdvb_rotor_t *)ld;
+ if (lr->lr_powerup_time == 0)
+ lr->lr_powerup_time = 100;
+ if (lr->lr_cmd_time == 0)
+ lr->lr_cmd_time = 25;
}
}
int ls_committed;
int ls_uncommitted;
int ls_uncommitted_first;
- int ls_sleep_time; /* in ms */
+ uint32_t ls_powerup_time; /* in ms */
+ uint32_t ls_sleep_time; /* in ms */
} linuxdvb_switch_t;
.ic_get_title = linuxdvb_switch_class_get_title,
.ic_properties = (const property_t[]) {
{
- .type = PT_INT,
- .id = "committed",
- .name = N_("Committed"),
- .off = offsetof(linuxdvb_switch_t, ls_committed),
- .list = linuxdvb_switch_class_committed_list
+ .type = PT_INT,
+ .id = "committed",
+ .name = N_("Committed"),
+ .off = offsetof(linuxdvb_switch_t, ls_committed),
+ .list = linuxdvb_switch_class_committed_list
},
{
- .type = PT_INT,
- .id = "uncommitted",
- .name = N_("Uncommitted"),
- .off = offsetof(linuxdvb_switch_t, ls_uncommitted),
- .list = linuxdvb_switch_class_uncommitted_list
+ .type = PT_INT,
+ .id = "uncommitted",
+ .name = N_("Uncommitted"),
+ .off = offsetof(linuxdvb_switch_t, ls_uncommitted),
+ .list = linuxdvb_switch_class_uncommitted_list
},
{
- .type = PT_INT,
- .id = "toneburst",
- .name = N_("Tone Burst"),
- .off = offsetof(linuxdvb_switch_t, ls_toneburst),
- .list = linuxdvb_switch_class_toneburst_list
+ .type = PT_INT,
+ .id = "toneburst",
+ .name = N_("Tone Burst"),
+ .off = offsetof(linuxdvb_switch_t, ls_toneburst),
+ .list = linuxdvb_switch_class_toneburst_list
},
{
- .type = PT_BOOL,
- .id = "preferun",
- .name = N_("Uncommited First"),
- .off = offsetof(linuxdvb_switch_t, ls_uncommitted_first),
+ .type = PT_BOOL,
+ .id = "preferun",
+ .name = N_("Uncommited First"),
+ .off = offsetof(linuxdvb_switch_t, ls_uncommitted_first),
},
{
- .type = PT_INT,
- .id = "sleeptime",
- .name = N_("Cmd Delay Time (ms) (10-500)"),
- .off = offsetof(linuxdvb_switch_t, ls_sleep_time)
+ .type = PT_U32,
+ .id = "poweruptime",
+ .name = N_("Powerup Time (ms) (10-200)"),
+ .off = offsetof(linuxdvb_switch_t, ls_powerup_time),
+ .def.u32 = 100,
+ },
+ {
+ .type = PT_U32,
+ .id = "sleeptime",
+ .name = N_("Cmd Delay Time (ms) (10-200)"),
+ .off = offsetof(linuxdvb_switch_t, ls_sleep_time),
+ .def.u32 = 25
},
{}
}
lsp->ls_last_switch = NULL;
- if (linuxdvb_satconf_start(lsp, 1, pol))
+ if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 10, 200), pol))
return -1;
com = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band;
- slp = ls->ls_sleep_time > 10 ?
- MAX(500, MIN(25, ls->ls_sleep_time)) * 1000 :
- 25000;
+ slp = MINMAX(ls->ls_sleep_time, 25, 200) * 1000;
/* Repeats */
for (i = 0; i <= lsp->ls_diseqc_repeats; i++) {
if (ls->ls_toneburst >= 0 &&
(lsp->ls_diseqc_full || lsp->ls_last_toneburst != ls->ls_toneburst + 1)) {
- if (linuxdvb_satconf_start(lsp, 1, vol))
+ if (linuxdvb_satconf_start(lsp, MINMAX(ls->ls_powerup_time, 10, 200), vol))
return -1;
lsp->ls_last_toneburst = 0;
if (u >= 0)
ld->ls_uncommitted = u;
}
+ if (ld->ls_powerup_time == 0)
+ ld->ls_powerup_time = 100;
+ if (ld->ls_sleep_time == 0)
+ ld->ls_sleep_time = 25;
}
}