loading and saving the cable transponders to lamedb works now
[enigma2.git] / lib / dvb_ci / dvbci_mmi.cpp
index 8ac4748c398079b2480795a80d89af1f98fac578..d1103c55c344ad268356656481a1bf3ca7b73d9f 100644 (file)
@@ -19,12 +19,12 @@ return list;
 eDVBCIMMISession::eDVBCIMMISession(eDVBCISlot *tslot)
 {
        slot = tslot;
-       slot->mmi_session = this;
+       slot->setMMIManager(this);
 }
 
 eDVBCIMMISession::~eDVBCIMMISession()
 {
-       slot->mmi_session = 0;
+       slot->setMMIManager(NULL);
 }
 
 int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
@@ -49,7 +49,6 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i
                        unsigned char *d=(unsigned char*)data;
                        unsigned char *max=((unsigned char*)d) + len;
                        int textlen = len - 2;
-                       int i;
 
                        printf("in enq\n");
                        
@@ -185,12 +184,27 @@ int eDVBCIMMISession::answerText(int answer)
        return 0;
 }
 
+int eDVBCIMMISession::answerEnq(char *answer)
+{
+       unsigned int len = strlen(answer);
+       printf("eDVBCIMMISession::answerEnq(%d bytes)\n", len);
+
+       unsigned char data[len+1];
+       data[0] = 0x01; // answer ok
+       memcpy(data+1, answer, len);
+
+       unsigned char tag[]={0x9f, 0x88, 0x08};
+       sendAPDU(tag, data, len+1);
+
+       return 0;
+}
+
 int eDVBCIMMISession::cancelEnq()
 {
        printf("eDVBCIMMISession::cancelEnq()\n");
 
        unsigned char tag[]={0x9f, 0x88, 0x08};
-       unsigned char data[]={0x00};
+       unsigned char data[]={0x00}; // canceled
        sendAPDU(tag, data, 1);
        
        return 0;