3 #include <lib/dvb_ci/dvbci_mmi.h>
4 #include <lib/dvb_ci/dvbci_ui.h>
7 PyObject *list = PyList_New(len);
8 for (i=0; i<len; ++i) {
9 PyObject *tuple = PyTuple_New(3); // 3 eintrge im tuple
10 PyTuple_SetItem(tuple, 0, PyString_FromString("eintrag 1"))
11 PyTuple_SetItem(tuple, 1, PyInt_FromLong(31337));
12 PyTuple_SetItem(tuple, 2, PyString_FromString("eintrag 3"))
13 PyList_SetItem(list, i, tuple);
18 eDVBCIMMISession::eDVBCIMMISession(eDVBCISlot *tslot)
21 slot->mmi_session = this;
24 eDVBCIMMISession::~eDVBCIMMISession()
26 slot->mmi_session = 0;
29 int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
31 printf("SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
32 for (int i=0; i<len; i++)
33 printf("%02x ", ((const unsigned char*)data)[i]);
36 if ((tag[0]==0x9f) && (tag[1]==0x88))
41 printf("MMI display control\n");
42 if (((unsigned char*)data)[0] != 1)
43 printf("kann ich nicht. aber das sag ich dem modul nicht.\n");
44 state=stateDisplayReply;
49 unsigned char *d=(unsigned char*)data;
50 unsigned char *max=((unsigned char*)d) + len;
52 printf("Tmenu_last\n");
59 eDVBCI_UI::getInstance()->mmiScreenBegin(0, 0);
61 eDVBCI_UI::getInstance()->mmiScreenBegin(0, 1);
67 printf("%d texts\n", n);
68 for (int i=0; i < (n+3); ++i)
73 printf("text tag: %02x %02x %02x\n", d[0], d[1], d[2]);
75 d+=parseLengthField(d, textlen);
76 printf("%d bytes text\n", textlen);
77 if ((d+textlen) > max)
80 char str[textlen + 1];
81 memcpy(str, ((char*)d), textlen);
84 eDVBCI_UI::getInstance()->mmiScreenAddText(0, pos++, str);
91 eDVBCI_UI::getInstance()->mmiScreenFinish(0);
95 printf("unknown APDU tag 9F 88 %02x\n", tag[2]);
102 int eDVBCIMMISession::doAction()
109 case stateDisplayReply:
111 unsigned char tag[]={0x9f, 0x88, 0x02};
112 unsigned char data[]={0x01, 0x01};
113 sendAPDU(tag, data, 2);
120 unsigned char tag[]={0x9f, 0x88, 0x0b};
121 unsigned char data[]={5};
122 sendAPDU(tag, data, 1);
134 int eDVBCIMMISession::stopMMI()
136 printf("eDVBCIMMISession::stopMMI()\n");
138 unsigned char tag[]={0x9f, 0x88, 0x00};
139 unsigned char data[]={0x00};
140 sendAPDU(tag, data, 1);
143 int eDVBCIMMISession::answerText(int answer)
145 printf("eDVBCIMMISession::answerText(%d)\n",answer);
147 unsigned char tag[]={0x9f, 0x88, 0x0B};
148 unsigned char data[]={0x00};
149 data[0] = answer & 0xff;
150 sendAPDU(tag, data, 1);