]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Unify command time range to 10-300 ms
authorPeter Bašista <pbasista@gmail.com>
Tue, 17 Jan 2023 20:08:15 +0000 (21:08 +0100)
committerFlole998 <Flole998@users.noreply.github.com>
Tue, 24 Jan 2023 02:43:52 +0000 (03:43 +0100)
Unify the allowed range of command time
for rotors, switches and unicable devices.

src/input/mpegts/linuxdvb/linuxdvb_rotor.c
src/input/mpegts/linuxdvb/linuxdvb_switch.c

index 7288833fc614c1b39bb07f795d100a5d9248c0e0..faa9cbc53bbff3d46659423955f3f240f509bea3 100644 (file)
@@ -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);
index 49ae0e4c4a46ba3da0f4e0b6625faf4bdb12f2b5..f12ab70134b1bd6c6746897a3a6ed203568e100b 100644 (file)
@@ -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;
     }
   }