summaryrefslogtreecommitdiff
path: root/diseqc.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-12-08 09:55:26 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-12-08 09:55:26 +0100
commitb9422baff21024b2ca16e7cbb3dc049cf16ad371 (patch)
tree1d805fed0f9745a3892912cfe6378ff7fd7c5596 /diseqc.c
parent2d2369fca0c1d715009c9c29b03ffd47c0afa659 (diff)
downloadvdr-b9422baff21024b2ca16e7cbb3dc049cf16ad371.tar.gz
vdr-b9422baff21024b2ca16e7cbb3dc049cf16ad371.tar.bz2
The actual tuning is now done in a separate thread
Diffstat (limited to 'diseqc.c')
-rw-r--r--diseqc.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/diseqc.c b/diseqc.c
index 92b92cbb..0766db8a 100644
--- a/diseqc.c
+++ b/diseqc.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: diseqc.c 1.1 2002/10/05 13:54:32 kls Exp $
+ * $Id: diseqc.c 1.2 2002/12/07 13:44:56 kls Exp $
*/
#include "diseqc.h"
@@ -16,7 +16,6 @@
cDiseqc::cDiseqc(void)
{
commands = NULL;
- currentAction = NULL;;
parsing = false;
numCodes = 0;
}
@@ -39,11 +38,11 @@ bool cDiseqc::Parse(const char *s)
polarization = toupper(polarization);
if (polarization == 'V' || polarization == 'H') {
parsing = true;
- bool Start = true;
- while (Execute(Start) != daNone)
- Start = false;
+ char *CurrentAction = NULL;
+ while (Execute(&CurrentAction) != daNone)
+ ;
parsing = false;
- result = !commands || currentAction && !*currentAction;
+ result = !commands || !*CurrentAction;
}
else
esyslog("ERROR: unknown polarization '%c'", polarization);
@@ -101,12 +100,12 @@ char *cDiseqc::Codes(char *s)
return NULL;
}
-cDiseqc::eDiseqcActions cDiseqc::Execute(bool Start)
+cDiseqc::eDiseqcActions cDiseqc::Execute(char **CurrentAction)
{
- if (Start)
- currentAction = commands;
- while (currentAction && *currentAction) {
- switch (*currentAction++) {
+ if (!*CurrentAction)
+ *CurrentAction = commands;
+ while (*CurrentAction && **CurrentAction) {
+ switch (*(*CurrentAction)++) {
case ' ': break;
case 't': return daToneOff;
case 'T': return daToneOn;
@@ -114,8 +113,8 @@ cDiseqc::eDiseqcActions cDiseqc::Execute(bool Start)
case 'V': return daVoltage18;
case 'A': return daMiniA;
case 'B': return daMiniB;
- case 'W': currentAction = Wait(currentAction); break;
- case '[': currentAction = Codes(currentAction); return currentAction ? daCodes : daNone;
+ case 'W': *CurrentAction = Wait(*CurrentAction); break;
+ case '[': *CurrentAction = Codes(*CurrentAction); return *CurrentAction ? daCodes : daNone;
default: return daNone;
}
}