aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorghost <andreas.monzner@multimedia-labs.de>2008-10-30 21:21:46 +0100
committerAndreas Oberritter <obi@saftware.de>2008-11-06 01:51:46 +0100
commitfe9c79a96232f5e5dd12158bf948188110412664 (patch)
tree4dd6027271561dfcf28c885d89d534f175289568 /lib
parent8d4316d824f584eb3900fef898de59c9aca8d771 (diff)
downloadenigma2-fe9c79a96232f5e5dd12158bf948188110412664.tar.gz
enigma2-fe9c79a96232f5e5dd12158bf948188110412664.zip
Add DiSEqC reset after voltage enable and tune failed... hopefully this fixes problems with some DiSEqC switches
Diffstat (limited to 'lib')
-rw-r--r--lib/dvb/frontend.cpp7
-rw-r--r--lib/dvb/sec.cpp21
2 files changed, 27 insertions, 1 deletions
diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp
index 1bcacc03..635de8f5 100644
--- a/lib/dvb/frontend.cpp
+++ b/lib/dvb/frontend.cpp
@@ -1492,7 +1492,12 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer
eDebugNoSimulateNoNewLine("[SEC] sendDiseqc: ");
for (int i=0; i < m_sec_sequence.current()->diseqc.len; ++i)
eDebugNoSimulateNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]);
- eDebugNoSimulate("");
+ if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x00", 3))
+ eDebugNoSimulate("(DiSEqC reset)");
+ else if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x03", 3))
+ eDebugNoSimulate("(DiSEqC peripherial power on)");
+ else
+ eDebugNoSimulate("");
++m_sec_sequence.current();
break;
case eSecCommand::SEND_TONEBURST:
diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp
index ca9e4ec8..35a8d04a 100644
--- a/lib/dvb/sec.cpp
+++ b/lib/dvb/sec.cpp
@@ -372,6 +372,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
bool doSetVoltageToneFrontend = true;
bool sendDiSEqC = false;
bool forceChanged = false;
+ bool needDiSEqCReset = false;
long band=0,
voltage = iDVBFrontend::voltageOff,
tone = iDVBFrontend::toneOff,
@@ -418,6 +419,9 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
sec_fe->getData(eDVBFrontend::ROTOR_CMD, lastRotorCmd);
sec_fe->getData(eDVBFrontend::ROTOR_POS, curRotorPos);
+ if (lastcsw == lastucsw && lastToneburst == lastucsw && lastucsw == -1)
+ needDiSEqCReset = true;
+
if ( sat.frequency > lnb_param.m_lof_threshold )
band |= 1;
@@ -623,6 +627,23 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) );
sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_SWITCHPARMS) );
+ if (needDiSEqCReset)
+ {
+ eDVBDiseqcCommand diseqc;
+ memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
+ diseqc.len = 3;
+ diseqc.data[0] = 0xE0;
+ diseqc.data[1] = 0;
+ diseqc.data[2] = 0;
+ // diseqc reset
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) );
+ diseqc.data[2] = 3;
+ // diseqc peripherial powersupply on
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 150) );
+ }
+
for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat)
{
if ( send_mask & 4 )