implement readFrontendData method to get a python dictionary containing data
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 3 Mar 2006 13:59:56 +0000 (13:59 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Fri, 3 Mar 2006 13:59:56 +0000 (13:59 +0000)
about current used transponder/frontend (frontend state, frontend type, lock
state, sync state, frequency, symbolrate, fec_innter...)
when it is called with True as param it returns the original transponder data
(written to tuner) otherwise it reads the current data out of the frontend
(corrected tuner data)

lib/dvb/dvb.cpp
lib/dvb/dvb.h
lib/dvb/frontend.cpp
lib/dvb/frontend.h
lib/dvb/idvb.h
lib/dvb/sec.cpp
lib/service/iservice.h
lib/service/servicedvb.cpp
lib/service/servicedvb.h

index f8f9527..ad5dfa6 100644 (file)
@@ -626,11 +626,11 @@ void eDVBChannel::frontendStateChanged(iDVBFrontend*fe)
        } else if (state == iDVBFrontend::stateLostLock)
        {
                        /* on managed channels, we try to retune in order to re-acquire lock. */
        } else if (state == iDVBFrontend::stateLostLock)
        {
                        /* on managed channels, we try to retune in order to re-acquire lock. */
-               if (m_feparm)
+               if (m_current_frontend_parameters)
                {
                        eDebug("OURSTATE: lost lock, trying to retune");
                        ourstate = state_tuning;
                {
                        eDebug("OURSTATE: lost lock, trying to retune");
                        ourstate = state_tuning;
-                       m_frontend->get().tune(*m_feparm);
+                       m_frontend->get().tune(*m_current_frontend_parameters);
                } else
                        /* on unmanaged channels, we don't do this. the client will do this. */
                {
                } else
                        /* on unmanaged channels, we don't do this. the client will do this. */
                {
@@ -918,7 +918,7 @@ RESULT eDVBChannel::setChannel(const eDVBChannelID &channelid, ePtr<iDVBFrontend
                        /* if tuning fails, shutdown the channel immediately. */
        int res;
        res = m_frontend->get().tune(*feparm);
                        /* if tuning fails, shutdown the channel immediately. */
        int res;
        res = m_frontend->get().tune(*feparm);
-       m_feparm = feparm;
+       m_current_frontend_parameters = feparm;
        
        if (res)
        {
        
        if (res)
        {
@@ -977,8 +977,13 @@ RESULT eDVBChannel::getFrontend(ePtr<iDVBFrontend> &frontend)
        frontend = &m_frontend->get();
        if (frontend)
                return 0;
        frontend = &m_frontend->get();
        if (frontend)
                return 0;
-       else
-               return -ENODEV;
+       return -ENODEV;
+}
+
+RESULT eDVBChannel::getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &param)
+{
+       param = m_current_frontend_parameters;
+       return 0;
 }
 
 RESULT eDVBChannel::playFile(const char *file)
 }
 
 RESULT eDVBChannel::playFile(const char *file)
index 6209f28..836a494 100644 (file)
@@ -218,7 +218,8 @@ public:
        RESULT setCIRouting(const eDVBCIRouting &routing);
        RESULT getDemux(ePtr<iDVBDemux> &demux, int cap);
        RESULT getFrontend(ePtr<iDVBFrontend> &frontend);
        RESULT setCIRouting(const eDVBCIRouting &routing);
        RESULT getDemux(ePtr<iDVBDemux> &demux, int cap);
        RESULT getFrontend(ePtr<iDVBFrontend> &frontend);
-       
+       RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &param);
+
                /* iDVBPVRChannel */
        RESULT playFile(const char *file);
        void stopFile();
                /* iDVBPVRChannel */
        RESULT playFile(const char *file);
        void stopFile();
@@ -230,7 +231,6 @@ public:
 
        int getUseCount() { return m_use_count; }
 private:
 
        int getUseCount() { return m_use_count; }
 private:
-       ePtr<iDVBFrontendParameters> m_feparm; // for retune on lostlock
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
        
        ePtr<eDVBAllocatedFrontend> m_frontend;
        ePtr<eDVBAllocatedDemux> m_demux, m_decoder_demux;
        
index 5bb6aeb..f44b3fb 100644 (file)
@@ -18,6 +18,9 @@
 #define GUARD_INTERVAL_AUTO            (GuardInterval)4
 #define HIERARCHY_AUTO                 (Hierarchy)4
 #define parm.frequency parm.Frequency
 #define GUARD_INTERVAL_AUTO            (GuardInterval)4
 #define HIERARCHY_AUTO                 (Hierarchy)4
 #define parm.frequency parm.Frequency
+#define parm.inversion parm.Inversion
+#define parm.u.qpsk.symbol_rate parm.u.qpsk.SymbolRate
+#define parm.u.qpsk.fec_inner parm.u.qpsk.FEC_inner
 #define parm.u.qam.symbol_rate parm.u.qam.SymbolRate
 #define parm.u.qam.fec_inner parm.u.qam.FEC_inner
 #define parm.u.qam.modulation parm.u.qam.QAM
 #define parm.u.qam.symbol_rate parm.u.qam.SymbolRate
 #define parm.u.qam.fec_inner parm.u.qam.FEC_inner
 #define parm.u.qam.modulation parm.u.qam.QAM
@@ -28,7 +31,6 @@
 #define parm.u.ofdm.transmission_mode parm.u.ofdm.TransmissionMode
 #define parm.u.ofdm.guard_interval parm.u.ofdm.guardInterval
 #define parm.u.ofdm.hierarchy_information parm.u.ofdm.HierarchyInformation
 #define parm.u.ofdm.transmission_mode parm.u.ofdm.TransmissionMode
 #define parm.u.ofdm.guard_interval parm.u.ofdm.guardInterval
 #define parm.u.ofdm.hierarchy_information parm.u.ofdm.HierarchyInformation
-#define parm.inversion parm.Inversion
 #else
 #include <linux/dvb/frontend.h>
 #endif
 #else
 #include <linux/dvb/frontend.h>
 #endif
@@ -504,10 +506,180 @@ int eDVBFrontend::readFrontendData(int type)
        return 0;
 }
 
        return 0;
 }
 
-PyObject *eDVBFrontend::readTransponderData()
+void PutToDict(PyObject *dict, const char*key, long value)
 {
 {
-       Py_INCREF(Py_None);
-       return Py_None;
+       PyObject *item = PyInt_FromLong(value);
+       if (item)
+       {
+               if (PyDict_SetItemString(dict, key, item))
+                       eDebug("put %s to dict failed", key);
+               Py_DECREF(item);
+       }
+       else
+               eDebug("could not create PyObject for %s", key);
+}
+
+void PutToDict(PyObject *dict, const char*key, const char *value)
+{
+       PyObject *item = PyString_FromString(value);
+       if (item)
+       {
+               if (PyDict_SetItemString(dict, key, item))
+                       eDebug("put %s to dict failed", key);
+               Py_DECREF(item);
+       }
+       else
+               eDebug("could not create PyObject for %s", key);
+}
+
+void fillDictWithSatelliteData(PyObject *dict, const FRONTENDPARAMETERS &parm, eDVBFrontend *fe)
+{
+       int freq_offset=0;
+       int csw=0;
+       fe->getData(0, csw);
+       fe->getData(9, freq_offset);
+       int frequency = parm.frequency + freq_offset;
+       PutToDict(dict, "frequency", frequency);
+       PutToDict(dict, "inversion", parm.inversion);
+       PutToDict(dict, "symbol_rate", parm.u.qpsk.symbol_rate);
+       const char *fec=0;
+       switch(parm.u.qpsk.fec_inner)
+       {
+               case FEC_1_2:
+                       fec = "FEC_1_2";
+                       break;
+               case FEC_2_3:
+                       fec = "FEC_2_3";
+                       break;
+               case FEC_3_4:
+                       fec = "FEC_3_4";
+                       break;
+               case FEC_5_6:
+                       fec = "FEC_5_6";
+                       break;
+               case FEC_7_8:
+                       fec = "FEC_7_8";
+                       break;
+               default:
+               case FEC_AUTO:
+                       fec = "FEC_AUTO";
+                       break;
+       }
+       PutToDict(dict, "fec_inner", fec);
+}
+
+void fillDictWithCableData(PyObject *dict, const FRONTENDPARAMETERS &parm)
+{
+/*
+#define parm.frequency parm.Frequency
+#define parm.inversion parm.Inversion
+#define parm.u.qam.symbol_rate parm.u.qam.SymbolRate
+#define parm.u.qam.fec_inner parm.u.qam.FEC_inner
+#define parm.u.qam.modulation parm.u.qam.QAM
+*/
+}
+
+void fillDictWithTerrestrialData(PyObject *dict, const FRONTENDPARAMETERS &parm)
+{
+/*
+#define parm.frequency parm.Frequency
+#define parm.inversion parm.Inversion
+#define parm.u.ofdm.bandwidth parm.u.ofdm.bandWidth
+#define parm.u.ofdm.code_rate_LP parm.u.ofdm.LP_CodeRate
+#define parm.u.ofdm.code_rate_HP parm.u.ofdm.HP_CodeRate
+#define parm.u.ofdm.constellation parm.u.ofdm.Constellation
+#define parm.u.ofdm.transmission_mode parm.u.ofdm.TransmissionMode
+#define parm.u.ofdm.guard_interval parm.u.ofdm.guardInterval
+#define parm.u.ofdm.hierarchy_information parm.u.ofdm.HierarchyInformation
+*/
+}
+
+PyObject *eDVBFrontend::readTransponderData(bool original)
+{
+       PyObject *ret=PyDict_New();
+
+       if (ret)
+       {
+               bool read=m_fd != -1;
+               const char *tmp = "unknown";
+
+               PutToDict(ret, "tuner number", m_fe);
+
+               switch(m_type)
+               {
+                       case feSatellite:
+                               tmp = "DVB-S";
+                               break;
+                       case feCable:
+                               tmp="DVB-C";
+                               break;
+                       case feTerrestrial:
+                               tmp="DVB-T";
+                               break;
+                       default:
+                               read=false;
+                               break;
+               }
+               PutToDict(ret, "tuner type", tmp);
+
+               if (read)
+               {
+                       FRONTENDPARAMETERS front;
+
+                       tmp = "unknown";
+                       switch(m_state)
+                       {
+                               case stateIdle:
+                                       tmp="idle";
+                                       break;
+                               case stateTuning:
+                                       tmp="tuning";
+                                       break;
+                               case stateFailed:
+                                       tmp="failed";
+                                       break;
+                               case stateLock:
+                                       tmp="lock";
+                                       break;
+                               case stateLostLock:
+                                       tmp="lostlock";
+                                       break;
+                               default:
+                                       break;
+                       }
+                       PutToDict(ret, "tuner state", tmp);
+
+                       PutToDict(ret, "tuner locked", readFrontendData(Locked));
+                       PutToDict(ret, "tuner synced", readFrontendData(Synced));
+                       PutToDict(ret, "tuner bit_error_rate", readFrontendData(bitErrorRate));
+                       PutToDict(ret, "tuner signal_power", readFrontendData(signalPower));
+                       PutToDict(ret, "tuner signal_quality", readFrontendData(signalQuality));
+
+                       if (!original && ioctl(m_fd, FE_GET_FRONTEND, &front)<0)
+                               eDebug("FE_GET_FRONTEND (%m)");
+                       else
+                       {
+                               switch(m_type)
+                               {
+                                       case feSatellite:
+                                               fillDictWithSatelliteData(ret, original?parm:front, this);
+                                               break;
+                                       case feCable:
+                                               fillDictWithCableData(ret, original?parm:front);
+                                               break;
+                                       case feTerrestrial:
+                                               fillDictWithTerrestrialData(ret, original?parm:front);
+                                               break;
+                               }
+                       }
+               }
+       }
+       else
+       {
+               Py_INCREF(Py_None);
+               ret = Py_None;
+       }
+       return ret;
 }
 
 #ifndef FP_IOCTL_GET_ID
 }
 
 #ifndef FP_IOCTL_GET_ID
@@ -819,7 +991,47 @@ RESULT eDVBFrontend::prepare_sat(const eDVBFrontendParametersSatellite &feparm)
        }
        res = m_sec->prepare(*this, parm, feparm, 1 << m_fe);
        if (!res)
        }
        res = m_sec->prepare(*this, parm, feparm, 1 << m_fe);
        if (!res)
+       {
+               parm.u.qpsk.symbol_rate = feparm.symbol_rate;
+               switch (feparm.inversion)
+               {
+                       case eDVBFrontendParametersSatellite::Inversion::On:
+                               parm.inversion = INVERSION_ON;
+                               break;
+                       case eDVBFrontendParametersSatellite::Inversion::Off:
+                               parm.inversion = INVERSION_OFF;
+                               break;
+                       default:
+                       case eDVBFrontendParametersSatellite::Inversion::Unknown:
+                               parm.inversion = INVERSION_AUTO;
+                               break;
+               }
+               switch (feparm.fec)
+               {
+                       default:
+                       case eDVBFrontendParametersSatellite::FEC::fNone:
+                               eDebug("no fec set.. assume auto");
+                       case eDVBFrontendParametersSatellite::FEC::fAuto:
+                               parm.u.qpsk.fec_inner = FEC_AUTO;
+                               break;
+                       case eDVBFrontendParametersSatellite::FEC::f1_2:
+                               parm.u.qpsk.fec_inner = FEC_1_2;
+                               break;
+                       case eDVBFrontendParametersSatellite::FEC::f2_3:
+                               parm.u.qpsk.fec_inner = FEC_2_3;
+                               break;
+                       case eDVBFrontendParametersSatellite::FEC::f3_4:
+                               parm.u.qpsk.fec_inner = FEC_3_4;
+                               break;
+                       case eDVBFrontendParametersSatellite::FEC::f5_6:
+                               parm.u.qpsk.fec_inner = FEC_5_6;
+                               break;
+                       case eDVBFrontendParametersSatellite::FEC::f7_8:
+                               parm.u.qpsk.fec_inner = FEC_7_8;
+                               break;
+               }
                eDebug("tuning to %d mhz", parm.frequency/1000);
                eDebug("tuning to %d mhz", parm.frequency/1000);
+       }
        return res;
 }
 
        return res;
 }
 
index 8c5b757..6d68326 100644 (file)
@@ -56,7 +56,7 @@ class eDVBFrontend: public iDVBFrontend, public Object
 
        eSecCommandList m_sec_sequence;
 
 
        eSecCommandList m_sec_sequence;
 
-       int m_data[9]; /* when satellite frontend then
+       int m_data[10]; /* when satellite frontend then
                data[0] = lastcsw -> state of the committed switch
                data[1] = lastucsw -> state of the uncommitted switch
                data[2] = lastToneburst -> current state of toneburst switch
                data[0] = lastcsw -> state of the committed switch
                data[1] = lastucsw -> state of the uncommitted switch
                data[2] = lastToneburst -> current state of toneburst switch
@@ -65,7 +65,8 @@ class eDVBFrontend: public iDVBFrontend, public Object
                data[5] = curRotorCmd
                data[6] = curRotorPos
                data[7] = linkedToTunerNo
                data[5] = curRotorCmd
                data[6] = curRotorPos
                data[7] = linkedToTunerNo
-               data[8] = dependsToTunerNo (just satpos.. for rotor with twin lnb) */
+               data[8] = dependsToTunerNo (just satpos.. for rotor with twin lnb)
+               data[9] = previousFrequencyOffset */
 
        int m_idleInputpower[2];  // 13V .. 18V
        int m_runningInputpower;
 
        int m_idleInputpower[2];  // 13V .. 18V
        int m_runningInputpower;
@@ -101,7 +102,7 @@ public:
        RESULT setData(int num, int val);
 
        int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality, Locked, Synced
        RESULT setData(int num, int val);
 
        int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality, Locked, Synced
-       PyObject *readTransponderData();
+       PyObject *readTransponderData(bool original);
 
        int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
        int getID() { return m_fe; }
 
        int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
        int getID() { return m_fe; }
index a8f361a..955688b 100644 (file)
@@ -361,7 +361,7 @@ public:
                bitErrorRate, signalPower, signalQuality, Locked, Synced
        };
        virtual int readFrontendData(int type)=0;
                bitErrorRate, signalPower, signalQuality, Locked, Synced
        };
        virtual int readFrontendData(int type)=0;
-       virtual PyObject *readTransponderData()=0;
+       virtual PyObject *readTransponderData(bool original)=0;
 
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
 
        virtual RESULT getData(int num, int &data)=0;
        virtual RESULT setData(int num, int val)=0;
@@ -416,6 +416,7 @@ public:
        
                /* direct frontend access for raw channels and/or status inquiries. */
        virtual RESULT getFrontend(ePtr<iDVBFrontend> &frontend)=0;
        
                /* direct frontend access for raw channels and/or status inquiries. */
        virtual RESULT getFrontend(ePtr<iDVBFrontend> &frontend)=0;
+       virtual RESULT getCurrentFrontendParameters(ePtr<iDVBFrontendParameters> &)=0;
        
                /* use count handling */
        virtual void AddUse() = 0;
        
                /* use count handling */
        virtual void AddUse() = 0;
index 4d6558d..6d11f44 100644 (file)
@@ -3,15 +3,9 @@
 #include <lib/dvb/rotor_calc.h>
 
 #if HAVE_DVB_API_VERSION < 3
 #include <lib/dvb/rotor_calc.h>
 
 #if HAVE_DVB_API_VERSION < 3
-#define INVERSION Inversion
 #define FREQUENCY Frequency
 #define FREQUENCY Frequency
-#define FEC_INNER FEC_inner
-#define SYMBOLRATE SymbolRate
 #else
 #else
-#define INVERSION inversion
 #define FREQUENCY frequency
 #define FREQUENCY frequency
-#define FEC_INNER fec_inner
-#define SYMBOLRATE symbol_rate
 #endif
 #include <lib/base/eerror.h>
 
 #endif
 #include <lib/base/eerror.h>
 
@@ -126,7 +120,7 @@ int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite
 
                                if ( sat.frequency > lnb_param.m_lof_threshold )
                                        band |= 1;
 
                                if ( sat.frequency > lnb_param.m_lof_threshold )
                                        band |= 1;
-                               if (sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal)
+                               if (!(sat.polarisation & eDVBFrontendParametersSatellite::Polarisation::Vertical))
                                        band |= 2;
 
                                bool rotor=false;
                                        band |= 2;
 
                                bool rotor=false;
@@ -344,56 +338,17 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
 
                        parm.FREQUENCY = abs(parm.FREQUENCY);
 
 
                        parm.FREQUENCY = abs(parm.FREQUENCY);
 
-                       if (sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal)
-                               band |= 2;
-
-                       switch (sat.inversion)
-                       {
-                               case eDVBFrontendParametersCable::Inversion::On:
-                                       parm.INVERSION = INVERSION_ON;
-                                       break;
-                               case eDVBFrontendParametersCable::Inversion::Off:
-                                       parm.INVERSION = INVERSION_OFF;
-                                       break;
-                               default:
-                               case eDVBFrontendParametersCable::Inversion::Unknown:
-                                       parm.INVERSION = INVERSION_AUTO;
-                                       break;
-                       }
+                       frontend.setData(9, sat.frequency - parm.FREQUENCY);
 
 
-                       switch (sat.fec)
-                       {
-                               default:
-                               case eDVBFrontendParametersSatellite::FEC::fNone:
-                                       eDebug("no fec set.. assume auto");
-                               case eDVBFrontendParametersSatellite::FEC::fAuto:
-                                       parm.u.qpsk.FEC_INNER = FEC_AUTO;
-                                       break;
-                               case eDVBFrontendParametersSatellite::FEC::f1_2:
-                                       parm.u.qpsk.FEC_INNER = FEC_1_2;
-                                       break;
-                               case eDVBFrontendParametersSatellite::FEC::f2_3:
-                                       parm.u.qpsk.FEC_INNER = FEC_2_3;
-                                       break;
-                               case eDVBFrontendParametersSatellite::FEC::f3_4:
-                                       parm.u.qpsk.FEC_INNER = FEC_3_4;
-                                       break;
-                               case eDVBFrontendParametersSatellite::FEC::f5_6:
-                                       parm.u.qpsk.FEC_INNER = FEC_5_6;
-                                       break;
-                               case eDVBFrontendParametersSatellite::FEC::f7_8: 
-                                       parm.u.qpsk.FEC_INNER = FEC_7_8;
-                                       break;
-                       }
-
-                       parm.u.qpsk.SYMBOLRATE = sat.symbol_rate;
+                       if (!(sat.polarisation & eDVBFrontendParametersSatellite::Polarisation::Vertical))
+                               band |= 2;
 
                        if ( sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::_14V
 
                        if ( sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::_14V
-                               || ( sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Vertical
+                               || ( sat.polarisation & eDVBFrontendParametersSatellite::Polarisation::Vertical
                                        && sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::HV )  )
                                voltage = VOLTAGE(13);
                        else if ( sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::_18V
                                        && sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::HV )  )
                                voltage = VOLTAGE(13);
                        else if ( sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::_18V
-                               || ( sat.polarisation == eDVBFrontendParametersSatellite::Polarisation::Horizontal
+                               || ( !(sat.polarisation & eDVBFrontendParametersSatellite::Polarisation::Vertical)
                                        && sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::HV )  )
                                voltage = VOLTAGE(18);
                        if ( (sw_param.m_22khz_signal == eDVBSatelliteSwitchParameters::ON)
                                        && sw_param.m_voltage_mode == eDVBSatelliteSwitchParameters::HV )  )
                                voltage = VOLTAGE(18);
                        if ( (sw_param.m_22khz_signal == eDVBSatelliteSwitchParameters::ON)
index f318318..354f90a 100644 (file)
@@ -276,7 +276,7 @@ public:
                SyncState
        };
        virtual int getFrontendInfo(int w)=0;
                SyncState
        };
        virtual int getFrontendInfo(int w)=0;
-       virtual PyObject *getFrontendTransponderData()=0;
+       virtual PyObject *getFrontendData(bool original=false)=0;
 };
 
 TEMPLATE_TYPEDEF(ePtr<iFrontendStatusInformation>, iFrontendStatusInformationPtr);
 };
 
 TEMPLATE_TYPEDEF(ePtr<iFrontendStatusInformation>, iFrontendStatusInformationPtr);
index c3bd1e6..0fdeb74 100644 (file)
@@ -1152,7 +1152,7 @@ int eDVBServicePlay::getFrontendInfo(int w)
        return fe->readFrontendData(w);
 }
 
        return fe->readFrontendData(w);
 }
 
-PyObject *eDVBServicePlay::getFrontendTransponderData()
+PyObject *eDVBServicePlay::getFrontendData(bool original)
 {
        PyObject *ret=0;
 
 {
        PyObject *ret=0;
 
@@ -1161,9 +1161,34 @@ PyObject *eDVBServicePlay::getFrontendTransponderData()
        {
                ePtr<iDVBFrontend> fe;
                if(!channel->getFrontend(fe))
        {
                ePtr<iDVBFrontend> fe;
                if(!channel->getFrontend(fe))
-                       ret = fe->readTransponderData();
+               {
+                       ret = fe->readTransponderData(original);
+                       if (ret)
+                       {
+                               ePtr<iDVBFrontendParameters> feparm;
+                               channel->getCurrentFrontendParameters(feparm);
+                               if (feparm)
+                               {
+                                       eDVBFrontendParametersSatellite osat;
+                                       if (!feparm->getDVBS(osat))
+                                       {
+                                               void PutToDict(PyObject *dict, const char*key, long value);
+                                               PutToDict(ret, "orbital_position", osat.orbital_position);
+                                               const char *tmp = "unknown";
+                                               switch(osat.polarisation)
+                                               {
+                                                       case eDVBFrontendParametersSatellite::Polarisation::Horizontal: tmp="horizontal"; break;
+                                                       case eDVBFrontendParametersSatellite::Polarisation::Vertical: tmp="vertical"; break;
+                                                       case eDVBFrontendParametersSatellite::Polarisation::CircularLeft: tmp="circular_left"; break;
+                                                       case eDVBFrontendParametersSatellite::Polarisation::CircularRight: tmp="circular_right"; break;
+                                                       default:break;
+                                               }
+                                               PutToDict(ret, "polarization", osat.polarisation);
+                                       }
+                               }
+                       }
+               }
        }
        }
-
        if (!ret)
        {
                ret = Py_None;
        if (!ret)
        {
                ret = Py_None;
index 437a454..39318b2 100644 (file)
@@ -105,7 +105,7 @@ public:
 
                // iFrontendStatusInformation
        int getFrontendInfo(int w);
 
                // iFrontendStatusInformation
        int getFrontendInfo(int w);
-       PyObject *getFrontendTransponderData();
+       PyObject *getFrontendData(bool);
 
                // iSubserviceList
        int getNumberOfSubservices();
 
                // iSubserviceList
        int getNumberOfSubservices();