diff options
| author | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-23 12:29:43 +0000 |
|---|---|---|
| committer | Andreas Monzner <andreas.monzner@multimedia-labs.de> | 2006-05-23 12:29:43 +0000 |
| commit | 27ac653dea3ebb218d915604a8fce4b0d34d9278 (patch) | |
| tree | b5a2f64effe029c1b87f4f8f4b02d3f6ebabb82f /lib/dvb_ci | |
| parent | b1f62dfee6033cb1074c0b1063e68ef365ce6a76 (diff) | |
| download | enigma2-27ac653dea3ebb218d915604a8fce4b0d34d9278.tar.gz enigma2-27ac653dea3ebb218d915604a8fce4b0d34d9278.zip | |
CI mmi is now working every time (for support alphacrypt parental control or other messages from CI)
Diffstat (limited to 'lib/dvb_ci')
| -rw-r--r-- | lib/dvb_ci/dvbci_appmgr.cpp | 4 | ||||
| -rw-r--r-- | lib/dvb_ci/dvbci_mmi.cpp | 22 | ||||
| -rw-r--r-- | lib/dvb_ci/dvbci_session.cpp | 2 | ||||
| -rw-r--r-- | lib/dvb_ci/dvbci_ui.cpp | 34 | ||||
| -rw-r--r-- | lib/dvb_ci/dvbci_ui.h | 6 |
5 files changed, 60 insertions, 8 deletions
diff --git a/lib/dvb_ci/dvbci_appmgr.cpp b/lib/dvb_ci/dvbci_appmgr.cpp index 201b36c4..f8159730 100644 --- a/lib/dvb_ci/dvbci_appmgr.cpp +++ b/lib/dvb_ci/dvbci_appmgr.cpp @@ -47,9 +47,9 @@ int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const printf("%c", ((unsigned char*)data)[i+6]); printf("\n"); - eDVBCI_UI::getInstance()->setState(slot->getSlotID(), 2); - eDVBCI_UI::getInstance()->setAppName(slot->getSlotID(), str); + + eDVBCI_UI::getInstance()->setState(slot->getSlotID(), 2); break; } default: diff --git a/lib/dvb_ci/dvbci_mmi.cpp b/lib/dvb_ci/dvbci_mmi.cpp index d3f564d9..29710660 100644 --- a/lib/dvb_ci/dvbci_mmi.cpp +++ b/lib/dvb_ci/dvbci_mmi.cpp @@ -25,6 +25,7 @@ eDVBCIMMISession::eDVBCIMMISession(eDVBCISlot *tslot) eDVBCIMMISession::~eDVBCIMMISession() { slot->setMMIManager(NULL); + eDVBCI_UI::getInstance()->mmiSessionDestroyed(slot->getSlotID()); } int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, int len) @@ -38,7 +39,26 @@ int eDVBCIMMISession::receivedAPDU(const unsigned char *tag, const void *data, i { switch (tag[2]) { - case 0x01: + case 0x00: //Tmmi_close + { + unsigned char *d=(unsigned char*)data; + int timeout=0; + if (d[3] == 1) + { + if (len > 4) + timeout = d[4]; + else + { + eDebug("mmi close tag incorrect.. no timeout given.. assume 5 seconds"); + timeout = 5; + } + } + else if (timeout>1) + eDebug("mmi close tag incorrect.. byte 4 should be 0 or 1"); + eDVBCI_UI::getInstance()->mmiScreenClose(slot->getSlotID(), timeout); + break; + } + case 0x01: printf("MMI display control\n"); if (((unsigned char*)data)[0] != 1) printf("kann ich nicht. aber das sag ich dem modul nicht.\n"); diff --git a/lib/dvb_ci/dvbci_session.cpp b/lib/dvb_ci/dvbci_session.cpp index 7156811d..e0e64be3 100644 --- a/lib/dvb_ci/dvbci_session.cpp +++ b/lib/dvb_ci/dvbci_session.cpp @@ -319,6 +319,6 @@ void eDVBCISession::receiveData(eDVBCISlot *slot, const unsigned char *ptr, size eDVBCISession::~eDVBCISession() { - printf("destroy %p\n", this); +// printf("destroy %p\n", this); } diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp index 306bcd13..56ca25fc 100644 --- a/lib/dvb_ci/dvbci_ui.cpp +++ b/lib/dvb_ci/dvbci_ui.cpp @@ -54,7 +54,10 @@ int eDVBCI_UI::getState(int slot) void eDVBCI_UI::setState(int slot, int newState) { if (slot < MAX_SLOTS) + { slotdata[slot].state = newState; + /*emit*/ ciStateChanged(slot); + } } std::string eDVBCI_UI::getAppName(int slot) @@ -117,6 +120,28 @@ int eDVBCI_UI::availableMMI(int slot) return false; } +int eDVBCI_UI::mmiScreenClose(int slot, int timeout) +{ + if (slot >= MAX_SLOTS) + return 0; + + slot_ui_data &data = slotdata[slot]; + + data.mmiScreenReady = 0; + + if (data.mmiScreen) + Py_DECREF(data.mmiScreen); + data.mmiScreen = PyList_New(1); + + PyObject *tuple = PyTuple_New(2); + PyTuple_SET_ITEM(tuple, 0, PyString_FromString("CLOSE")); + PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong(timeout)); + PyList_SET_ITEM(data.mmiScreen, 0, tuple); + data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; +} + int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) { if (slot >= MAX_SLOTS) @@ -144,6 +169,8 @@ int eDVBCI_UI::mmiScreenEnq(int slot, int blind, int answerLen, char *text) data.mmiScreenReady = 1; + /*emit*/ ciStateChanged(slot); + return 0; } @@ -217,11 +244,16 @@ int eDVBCI_UI::mmiScreenFinish(int slot) { printf("eDVBCI_UI::mmiScreenFinish\n"); slotdata[slot].mmiScreenReady = 1; - /*emit*/ mmiAvail(slot); + /*emit*/ ciStateChanged(slot); } return 0; } +void eDVBCI_UI::mmiSessionDestroyed(int slot) +{ + /*emit*/ ciStateChanged(slot); +} + int eDVBCI_UI::getMMIState(int slot) { return eDVBCIInterfaces::getInstance()->getMMIState(slot); diff --git a/lib/dvb_ci/dvbci_ui.h b/lib/dvb_ci/dvbci_ui.h index 640a3b9f..b7922bb5 100644 --- a/lib/dvb_ci/dvbci_ui.h +++ b/lib/dvb_ci/dvbci_ui.h @@ -28,7 +28,7 @@ class eDVBCI_UI ~eDVBCI_UI(); #endif public: - PSignal1<void,int> mmiAvail; + PSignal1<void,int> ciStateChanged; #ifndef SWIG eDVBCI_UI(); ~eDVBCI_UI(); @@ -45,17 +45,17 @@ public: int stopMMI(int slot); int availableMMI(int slot); int getMMIState(int slot); - int answerMenu(int slot, int answer); int answerEnq(int slot, char *val); int cancelEnq(int slot); PyObject *getMMIScreen(int slot); - + int mmiScreenClose(int slot, int timeout); int mmiScreenEnq(int slot, int blind, int answerLen, char *text); int mmiScreenBegin(int slot, int listmenu); int mmiScreenAddText(int slot, int type, char *value); int mmiScreenFinish(int slot); + void mmiSessionDestroyed(int slot); }; #endif |
