everything else
[enigma2.git] / lib / dvb_ci / dvbci.cpp
index 74fa66c794afc8eb879f1c90625d611ee09f0435..71994538aa4bac8c981cb5bbbb38bcd7891f0e7b 100644 (file)
@@ -10,6 +10,8 @@
 #include <lib/dvb_ci/dvbci_session.h>
 
 #include <lib/dvb_ci/dvbci_ui.h>
+#include <lib/dvb_ci/dvbci_appmgr.h>
+#include <lib/dvb_ci/dvbci_mmi.h>
 
 eDVBCIInterfaces *eDVBCIInterfaces::instance = 0;
 
@@ -71,6 +73,16 @@ int eDVBCIInterfaces::reset(int slotid)
        return slot->reset();
 }
 
+int eDVBCIInterfaces::initialize(int slotid)
+{
+       eDVBCISlot *slot;
+
+       if( (slot = getSlot(slotid)) == 0 )
+               return -1;
+       
+       return slot->initialize();
+}
+
 int eDVBCIInterfaces::startMMI(int slotid)
 {
        eDVBCISlot *slot;
@@ -81,6 +93,26 @@ int eDVBCIInterfaces::startMMI(int slotid)
        return slot->startMMI();
 }
 
+int eDVBCIInterfaces::stopMMI(int slotid)
+{
+       eDVBCISlot *slot;
+
+       if( (slot = getSlot(slotid)) == 0 )
+               return -1;
+       
+       return slot->stopMMI();
+}
+
+int eDVBCIInterfaces::answerMMI(int slotid, int answer, char *value)
+{
+       eDVBCISlot *slot;
+
+       if( (slot = getSlot(slotid)) == 0 )
+               return -1;
+       
+       return slot->answerMMI(answer, value);
+}
+
 int eDVBCISlot::send(const unsigned char *data, size_t len)
 {
        int res;
@@ -108,6 +140,9 @@ void eDVBCISlot::data(int what)
                        notifier->setRequested(eSocketNotifier::Read);
                        //HACK
                        eDVBCI_UI::getInstance()->setState(0,0);
+                       //FIXME; do in deconstructor of the appmgr class                        
+                       application_manager = 0;
+                       mmi_session = 0;
                }
                return;
        }
@@ -150,6 +185,9 @@ DEFINE_REF(eDVBCISlot);
 eDVBCISlot::eDVBCISlot(eMainloop *context, int nr)
 {
        char filename[128];
+       
+       application_manager = 0;
+       mmi_session = 0;
 
        slotid = nr;
 
@@ -189,9 +227,35 @@ int eDVBCISlot::reset()
        return 0;
 }
 
+int eDVBCISlot::initialize()
+{
+       printf("edvbcislot: initialize()\n");
+       return 0;
+}
+
 int eDVBCISlot::startMMI()
 {
        printf("edvbcislot: startMMI()\n");
+       
+       if(application_manager)
+               application_manager->startMMI();
+       
+       return 0;
+}
+
+int eDVBCISlot::stopMMI()
+{
+       printf("edvbcislot: stopMMI()\n");
+
+       if(mmi_session)
+               mmi_session->stopMMI();
+       
+       return 0;
+}
+
+int eDVBCISlot::answerMMI(int answer, char *value)
+{
+       printf("edvbcislot: answerMMI()\n");
        return 0;
 }