parse enq
authorRonny Strutz <ronny.strutz@multimedia-labs.de>
Wed, 23 Nov 2005 02:16:21 +0000 (02:16 +0000)
committerRonny Strutz <ronny.strutz@multimedia-labs.de>
Wed, 23 Nov 2005 02:16:21 +0000 (02:16 +0000)
lib/dvb_ci/dvbci_mmi.cpp
lib/dvb_ci/dvbci_mmi.h

index b652da89fafddd005a87beb70ae6916cfe09a08d..90d2f9f50acc83f5e73f76ed4d3abe1b5ab965e9 100644 (file)
@@ -43,8 +43,37 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i
                                printf("kann ich nicht. aber das sag ich dem modul nicht.\n");
                        state=stateDisplayReply;
                        return 1;
-               case 0x09:
-               case 0x0c:
+               case 0x07:              //Tmenu_enq
+               {
+                       unsigned char *d=(unsigned char*)data;
+                       unsigned char *max=((unsigned char*)d) + len;
+                       int textlen = len - 2;
+                       int i;
+
+                       printf("in enq\n");
+                       
+                       if ((d+2) > max)
+                               break;
+                               
+                       int blind = *d++ & 1;
+                       int alen = *d++;
+
+                       printf("%d bytes text\n", textlen);
+                       if ((d+textlen) > max)
+                               break;
+                       
+                       char str[textlen + 1];
+                       memcpy(str, ((char*)d), textlen);
+                       str[textlen] = '\0';
+                       
+                       printf("enq-text: %s\n",str);
+                       
+                       eDVBCI_UI::getInstance()->mmiScreenEnq(0, blind, alen, str);
+
+                       break;          
+               }
+               case 0x09:              //Tmenu_last
+               case 0x0c:              //Tlist_last
                {
                        unsigned char *d=(unsigned char*)data;
                        unsigned char *max=((unsigned char*)d) + len;
@@ -55,9 +84,9 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i
                        int n=*d++;
                        
                        //FIXME: slotid
-                       if(tag[2] == 0x09)
+                       if(tag[2] == 0x09)      //menu
                                eDVBCI_UI::getInstance()->mmiScreenBegin(0, 0);
-                       else
+                       else                                                            //list
                                eDVBCI_UI::getInstance()->mmiScreenBegin(0, 1);
                        
                        if (n == 0xFF)
@@ -150,3 +179,12 @@ int eDVBCIMMISession::answerText(int answer)
        sendAPDU(tag, data, 1);
 }
 
+int eDVBCIMMISession::cancelEnq()
+{
+       printf("eDVBCIMMISession::cancelEnq()\n");
+
+       unsigned char tag[]={0x9f, 0x88, 0x08};
+       unsigned char data[]={0x00};
+       sendAPDU(tag, data, 1);
+}
+
index 6b5426704ae096662589d2534f18df5f080f7fce..06cb8b082dcea571a369b488dc703c6b47b470b6 100644 (file)
@@ -17,6 +17,7 @@ public:
        ~eDVBCIMMISession();
        int stopMMI();
        int answerText(int answer);
+       int cancelEnq();
 
 };