From: Peter BaĊĦista Date: Tue, 17 Jan 2023 20:08:15 +0000 (+0100) Subject: Unify command time range to 10-300 ms X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5948200c7e04ebeab28efb3285d3f13e11df20ca;p=thirdparty%2Ftvheadend.git Unify command time range to 10-300 ms Unify the allowed range of command time for rotors, switches and unicable devices. --- diff --git a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c index 7288833fc..faa9cbc53 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_rotor.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_rotor.c @@ -107,7 +107,7 @@ const idclass_t linuxdvb_rotor_class = { { .type = PT_U32, .id = "cmd_time", - .name = N_("Command time (ms) (10-100)"), + .name = N_("Command time (ms) (10-300)"), .desc = N_("Time (in milliseconds) for a command to complete."), .off = offsetof(linuxdvb_rotor_t, lr_cmd_time), .def.u32 = 25 @@ -461,7 +461,7 @@ linuxdvb_rotor_gotox_tune tvherror(LS_DISEQC, "failed to set GOTOX pos %d", lr->lr_position); return -1; } - tvh_safe_usleep(MINMAX(lr->lr_cmd_time, 10, 100) * 1000); + tvh_safe_usleep(MINMAX(lr->lr_cmd_time, 10, 300) * 1000); } tvhdebug(LS_DISEQC, "rotor GOTOX pos %d sent", lr->lr_position); @@ -506,7 +506,7 @@ linuxdvb_rotor_usals_tune tvherror(LS_DISEQC, "failed to send USALS command"); return -1; } - tvh_safe_usleep(MINMAX(lr->lr_cmd_time, 10, 100) * 1000); + tvh_safe_usleep(MINMAX(lr->lr_cmd_time, 10, 300) * 1000); } return linuxdvb_rotor_grace((linuxdvb_diseqc_t*)lr,lm); diff --git a/src/input/mpegts/linuxdvb/linuxdvb_switch.c b/src/input/mpegts/linuxdvb/linuxdvb_switch.c index 49ae0e4c4..f12ab7013 100644 --- a/src/input/mpegts/linuxdvb/linuxdvb_switch.c +++ b/src/input/mpegts/linuxdvb/linuxdvb_switch.c @@ -45,7 +45,7 @@ typedef struct linuxdvb_switch int ls_uncommitted; int ls_uncommitted_first; uint32_t ls_powerup_time; /* in ms */ - uint32_t ls_sleep_time; /* in ms */ + uint32_t ls_cmd_time; /* in ms */ } linuxdvb_switch_t; @@ -126,6 +126,14 @@ const idclass_t linuxdvb_switch_class = .off = offsetof(linuxdvb_switch_t, ls_powerup_time), .def.u32 = 100, }, + { + .type = PT_U32, + .id = "cmd_time", + .name = N_("Command time (ms) (10-300)"), + .desc = N_("Time (in milliseconds) for a command to complete."), + .off = offsetof(linuxdvb_switch_t, ls_cmd_time), + .def.u32 = 25 + }, { .type = PT_INT, .id = "committed", @@ -153,13 +161,6 @@ const idclass_t linuxdvb_switch_class = .name = N_("Uncommitted first"), .off = offsetof(linuxdvb_switch_t, ls_uncommitted_first), }, - { - .type = PT_U32, - .id = "sleeptime", - .name = N_("Command delay time (ms) (10-200)"), - .off = offsetof(linuxdvb_switch_t, ls_sleep_time), - .def.u32 = 25 - }, {} } }; @@ -188,7 +189,7 @@ linuxdvb_switch_tune return -1; com = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band; - slp = MINMAX(ls->ls_sleep_time, 25, 200) * 1000; + slp = MINMAX(ls->ls_cmd_time, 10, 300) * 1000; /* Repeats */ for (i = 0; i <= lsp->ls_diseqc_repeats; i++) { @@ -286,8 +287,8 @@ linuxdvb_switch_create0 } if (ld->ls_powerup_time == 0) ld->ls_powerup_time = 100; - if (ld->ls_sleep_time == 0) - ld->ls_sleep_time = 25; + if (ld->ls_cmd_time == 0) + ld->ls_cmd_time = 25; } }