- case 0x09: //Tmenu_last
- case 0x0c: //Tlist_last
- {
- unsigned char *d=(unsigned char*)data;
- unsigned char *max=((unsigned char*)d) + len;
- int pos = 0;
- eDebug("Tmenu_last");
- if (d > max)
- break;
- int n=*d++;
-
- if(tag[2] == 0x09) //menu
- eDVBCI_UI::getInstance()->mmiScreenBegin(slot->getSlotID(), 0);
- else //list
- eDVBCI_UI::getInstance()->mmiScreenBegin(slot->getSlotID(), 1);
-
- if (n == 0xFF)
- n=0;
- else
- n++;
- eDebug("%d texts", n);
- for (int i=0; i < (n+3); ++i)
- {
- int textlen;
- if ((d+3) > max)
- break;
- eDebug("text tag: %02x %02x %02x", d[0], d[1], d[2]);
- d+=3;
- d+=parseLengthField(d, textlen);
- eDebug("%d bytes text", textlen);
- if ((d+textlen) > max)
- break;
-
- char str[textlen + 1];
- memcpy(str, ((char*)d), textlen);
- str[textlen] = '\0';
-
- eDVBCI_UI::getInstance()->mmiScreenAddText(slot->getSlotID(), pos++, (char*)convertDVBUTF8(str).c_str());
-
- while (textlen--)
- eDebugNoNewLine("%c", *d++);
- eDebug("");
- }
- eDVBCI_UI::getInstance()->mmiScreenFinish(slot->getSlotID());
- break;
- }
- default:
- eDebug("unknown APDU tag 9F 88 %02x", tag[2]);
- break;
- }
- }