- actionmap component will not catch (wrong) exceptions anymore
[enigma2.git] / lib / dvb / sec.cpp
index 1555090cb0a321acf4c9e5c13e7f7c00bb4ba856..a668ebe7b782f7814accf5f192b5212400252d39 100644 (file)
@@ -25,7 +25,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 {
        int hi;
        eDebug("(very) ugly and hardcoded eDVBSatelliteEquipmentControl");
-       
+
        if (sat.frequency > 11700000)
                hi = 1;
        else
@@ -50,24 +50,32 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
        }
        parm.u.qpsk.SYMBOLRATE = sat.symbol_rate;
 
-       frontend.setVoltage((sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical) ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18);
-
        eDVBDiseqcCommand diseqc;
-       
+
+#if HAVE_DVB_API_VERSION < 3
+       diseqc.voltage = sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18;
+       diseqc.tone = hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff;
+#else
+       frontend.setVoltage(sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical ? iDVBFrontend::voltage13 : iDVBFrontend::voltage18);
+#endif
+
        diseqc.len = 4;
        diseqc.data[0] = 0xe0;
        diseqc.data[1] = 0x10;
        diseqc.data[2] = 0x38;
        diseqc.data[3] = 0xF0;
-       
+
        if (hi)
                diseqc.data[3] |= 1;
-               
+
        if (sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal)
                diseqc.data[3] |= 2;
 
        frontend.sendDiseqc(diseqc);
+
+#if HAVE_DVB_API_VERSION > 2
        frontend.setTone(hi ? iDVBFrontend::toneOn : iDVBFrontend::toneOff);
+#endif
 
        return 0;
 }