add transponderlist
[enigma2.git] / lib / dvb_ci / dvbci.cpp
index e6e3237d50e418a4b57d5411a8d644e447b95ba0..014d51a5a74a55b8ae9223d147d8c9f0db6885f0 100644 (file)
@@ -7,10 +7,12 @@
 #include <lib/dvb_ci/dvbci.h>
 #include <lib/dvb_ci/dvbci_session.h>
 
+#include <lib/dvb_ci/dvbci_ui.h>
+
 eDVBCIInterfaces::eDVBCIInterfaces()
 {
        int num_ci = 0;
-
+       
        eDebug("scanning for common interfaces..");
 
        while (1)
@@ -30,7 +32,7 @@ eDVBCIInterfaces::eDVBCIInterfaces()
                ++num_ci;
        }
 
-       eDebug("done, found %d common interface slots");
+       eDebug("done, found %d common interface slots", num_ci);
 }
 
 eDVBCIInterfaces::~eDVBCIInterfaces()
@@ -62,11 +64,12 @@ void eDVBCISlot::data(int what)
                        state = stateRemoved;
                        printf("ci removed\n");
                        notifier->setRequested(eSocketNotifier::Read);
+                       //HACK
+                       eDVBCI_UI::getInstance()->setState(0,0);
                }
                return;
        }
 
-
        __u8 data[4096];
        int r;
        r = ::read(fd, data, 4096);
@@ -74,6 +77,10 @@ void eDVBCISlot::data(int what)
        if(state != stateInserted) {
                state = stateInserted;
                eDebug("ci inserted");
+
+               //HACK
+               eDVBCI_UI::getInstance()->setState(0,1);
+
                /* enable PRI to detect removal or errors */
                notifier->setRequested(eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Write);
        }
@@ -107,6 +114,8 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
        fd = ::open(filename, O_RDWR | O_NONBLOCK);
 
        eDebug("eDVBCISlot has fd %d", fd);
+       
+       state = stateInserted;
 
        if (fd >= 0)
        {