3 #include <lib/dvb_ci/dvbci_mmi.h>
4 #include <lib/dvb_ci/dvbci_ui.h>
9 PyObject *list = PyList_New(len);
10 for (i=0; i<len; ++i) {
11 PyObject *tuple = PyTuple_New(3); // 3 eintrge im tuple
12 PyTuple_SetItem(tuple, 0, PyString_FromString("eintrag 1"))
13 PyTuple_SetItem(tuple, 1, PyInt_FromLong(31337));
14 PyTuple_SetItem(tuple, 2, PyString_FromString("eintrag 3"))
15 PyList_SetItem(list, i, tuple);
20 eDVBCIMMISession::eDVBCIMMISession(eDVBCISlot *tslot)
23 slot->setMMIManager(this);
26 eDVBCIMMISession::~eDVBCIMMISession()
28 slot->setMMIManager(NULL);
29 eDVBCI_UI::getInstance()->mmiSessionDestroyed(slot->getSlotID());
32 int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len)
34 eDebugNoNewLine("SESSION(%d)/MMI %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
35 for (int i=0; i<len; i++)
36 eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
39 if ((tag[0]==0x9f) && (tag[1]==0x88))
40 if (eDVBCI_UI::getInstance()->processMMIData(slot->getSlotID(), tag, data, len) == 1)
42 state=stateDisplayReply;
49 int eDVBCIMMISession::doAction()
56 case stateDisplayReply:
58 unsigned char tag[]={0x9f, 0x88, 0x02};
59 unsigned char data[]={0x01, 0x01};
60 sendAPDU(tag, data, 2);
68 unsigned char tag[]={0x9f, 0x88, 0x0b};
69 unsigned char data[]={5};
70 sendAPDU(tag, data, 1);
82 int eDVBCIMMISession::stopMMI()
84 eDebug("eDVBCIMMISession::stopMMI()");
86 unsigned char tag[]={0x9f, 0x88, 0x00};
87 unsigned char data[]={0x00};
88 sendAPDU(tag, data, 1);
93 int eDVBCIMMISession::answerText(int answer)
95 eDebug("eDVBCIMMISession::answerText(%d)",answer);
97 unsigned char tag[]={0x9f, 0x88, 0x0B};
98 unsigned char data[]={0x00};
99 data[0] = answer & 0xff;
100 sendAPDU(tag, data, 1);
105 int eDVBCIMMISession::answerEnq(char *answer)
107 unsigned int len = strlen(answer);
108 eDebug("eDVBCIMMISession::answerEnq(%d bytes)", len);
110 unsigned char data[len+1];
111 data[0] = 0x01; // answer ok
112 memcpy(data+1, answer, len);
114 unsigned char tag[]={0x9f, 0x88, 0x08};
115 sendAPDU(tag, data, len+1);
120 int eDVBCIMMISession::cancelEnq()
122 eDebug("eDVBCIMMISession::cancelEnq()");
124 unsigned char tag[]={0x9f, 0x88, 0x08};
125 unsigned char data[]={0x00}; // canceled
126 sendAPDU(tag, data, 1);