use frontend type infomation in /proc/nim_sockets to detect if a frontend
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 27 Aug 2008 15:26:37 +0000 (15:26 +0000)
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>
Wed, 27 Aug 2008 15:26:37 +0000 (15:26 +0000)
can handle dvb-s2 instead of do a string compare

lib/dvb/frontend.cpp
lib/python/Components/NimManager.py

index fb321996396263ca464a7ac8e9b36a912266fe3a..af627e26a9683717cfdcdf7d2b45e24e2258af1e 100644 (file)
@@ -2351,13 +2351,14 @@ int eDVBFrontend::isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm)
 
 bool eDVBFrontend::setSlotInfo(ePyObject obj)
 {
 
 bool eDVBFrontend::setSlotInfo(ePyObject obj)
 {
-       ePyObject Id, Descr, Enabled;
-       if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 3)
+       ePyObject Id, Descr, Enabled, IsDVBS2;
+       if (!PyTuple_Check(obj) || PyTuple_Size(obj) != 4)
                goto arg_error;
        Id = PyTuple_GET_ITEM(obj, 0);
        Descr = PyTuple_GET_ITEM(obj, 1);
        Enabled = PyTuple_GET_ITEM(obj, 2);
                goto arg_error;
        Id = PyTuple_GET_ITEM(obj, 0);
        Descr = PyTuple_GET_ITEM(obj, 1);
        Enabled = PyTuple_GET_ITEM(obj, 2);
-       if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled))
+       IsDVBS2 = PyTuple_GET_ITEM(obj, 3);
+       if (!PyInt_Check(Id) || !PyString_Check(Descr) || !PyBool_Check(Enabled) || !PyBool_Check(IsDVBS2))
                goto arg_error;
        strcpy(m_description, PyString_AS_STRING(Descr));
        m_slotid = PyInt_AsLong(Id);
                goto arg_error;
        strcpy(m_description, PyString_AS_STRING(Descr));
        m_slotid = PyInt_AsLong(Id);
@@ -2367,7 +2368,7 @@ bool eDVBFrontend::setSlotInfo(ePyObject obj)
                !!strstr(m_description, "Alps BSBE2") ||
                !!strstr(m_description, "Alps -S") ||
                !!strstr(m_description, "BCM4501");
                !!strstr(m_description, "Alps BSBE2") ||
                !!strstr(m_description, "Alps -S") ||
                !!strstr(m_description, "BCM4501");
-       m_can_handle_dvbs2 = !!strstr(m_description, "Alps BSBE2") || !!strstr(m_description, "BCM4501");
+       m_can_handle_dvbs2 = IsDVBS2 == Py_True;
        eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s, DVB-S2 %s",
                m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No", m_can_handle_dvbs2 ? "Yes" : "No" );
        return true;
        eDebug("setSlotInfo for dvb frontend %d to slotid %d, descr %s, need rotorworkaround %s, enabled %s, DVB-S2 %s",
                m_dvbid, m_slotid, m_description, m_need_rotor_workaround ? "Yes" : "No", m_enabled ? "Yes" : "No", m_can_handle_dvbs2 ? "Yes" : "No" );
        return true;
index 1d8e354ce43cd2e29d2f66dbb0a4195dcbe5a7a6..bf718fd038d96274feeb4fa030f4a647f23acdb8 100644 (file)
@@ -123,7 +123,7 @@ class SecConfigure:
 
                for slot in nim_slots:
                        if slot.type is not None:
 
                for slot in nim_slots:
                        if slot.type is not None:
-                               used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False))
+                               used_nim_slots.append((slot.slot, slot.description, slot.config.configMode.value != "nothing" and True or False, slot.isCompatible("DVB-S2")))
                eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots)
 
                for slot in nim_slots:
                eDVBResourceManager.getInstance().setFrontendSlotInformations(used_nim_slots)
 
                for slot in nim_slots: