1 /* DVB CI Application Manager */
3 #include <lib/base/eerror.h>
4 #include <lib/dvb_ci/dvbci_appmgr.h>
5 #include <lib/dvb_ci/dvbci_ui.h>
7 eDVBCIApplicationManagerSession::eDVBCIApplicationManagerSession(eDVBCISlot *tslot)
10 slot->setAppManager(this);
13 eDVBCIApplicationManagerSession::~eDVBCIApplicationManagerSession()
15 slot->setAppManager(NULL);
18 int eDVBCIApplicationManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
20 eDebugNoNewLine("SESSION(%d)/APP %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
21 for (int i=0; i<len; i++)
22 eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
25 if ((tag[0]==0x9f) && (tag[1]==0x80))
32 eDebug("application info:");
33 eDebug(" len: %d", len);
34 eDebug(" application_type: %d", ((unsigned char*)data)[0]);
35 eDebug(" application_manufacturer: %02x %02x", ((unsigned char*)data)[2], ((unsigned char*)data)[1]);
36 eDebug(" manufacturer_code: %02x %02x", ((unsigned char*)data)[4],((unsigned char*)data)[3]);
37 eDebugNoNewLine(" menu string: ");
38 dl=((unsigned char*)data)[5];
41 eDebug("warning, invalid length (%d vs %d)", dl+6, len);
45 memcpy(str, ((char*)data) + 6, dl);
47 for (int i = 0; i < dl; ++i)
48 eDebugNoNewLine("%c", ((unsigned char*)data)[i+6]);
51 eDVBCI_UI::getInstance()->setAppName(slot->getSlotID(), str);
53 eDVBCI_UI::getInstance()->setState(slot->getSlotID(), 2);
57 eDebug("unknown APDU tag 9F 80 %02x", tag[2]);
64 int eDVBCIApplicationManagerSession::doAction()
70 const unsigned char tag[3]={0x9F, 0x80, 0x20}; // application manager info e sendAPDU(tag);
76 eDebug("in final state.");
80 eDebug("wantmenu: sending Tenter_menu");
81 const unsigned char tag[3]={0x9F, 0x80, 0x22}; // Tenter_menu
92 int eDVBCIApplicationManagerSession::startMMI()
94 eDebug("in appmanager -> startmmi()");
95 const unsigned char tag[3]={0x9F, 0x80, 0x22}; // Tenter_menu