1 /* DVB CI Resource Manager */
3 #include <lib/base/eerror.h>
4 #include <lib/dvb_ci/dvbci_resmgr.h>
6 int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
8 eDebugNoNewLine("SESSION(%d) %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
9 for (int i=0; i<len; i++)
10 eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
12 if ((tag[0]==0x9f) && (tag[1]==0x80))
16 case 0x10: // profile enquiry
17 eDebug("cam fragt was ich kann.");
18 state=stateProfileEnquiry;
21 case 0x11: // Tprofile
22 eDebugNoNewLine("mein cam kann: ");
26 for (int i=0; i<len; i++)
27 eDebugNoNewLine("%02x ", ((const unsigned char*)data)[i]);
29 if (state == stateFirstProfileEnquiry)
37 eDebug("unknown APDU tag 9F 80 %02x", tag[2]);
44 int eDVBCIResourceManagerSession::doAction()
50 const unsigned char tag[3]={0x9F, 0x80, 0x10}; // profile enquiry
52 state = stateFirstProfileEnquiry;
55 case stateFirstProfileEnquiry:
57 const unsigned char tag[3]={0x9F, 0x80, 0x12}; // profile change
59 state=stateProfileChange;
62 case stateProfileChange:
67 case stateProfileEnquiry:
69 const unsigned char tag[3]={0x9F, 0x80, 0x11};
70 const unsigned char data[][4]=
72 {0x00, 0x01, 0x00, 0x41},
73 {0x00, 0x02, 0x00, 0x41},
74 {0x00, 0x03, 0x00, 0x41},
75 // {0x00, 0x20, 0x00, 0x41}, // host control
76 {0x00, 0x24, 0x00, 0x41},
77 {0x00, 0x40, 0x00, 0x41},
78 // {0x00, 0x10, 0x00, 0x41}, // auth.
80 sendAPDU(tag, data, sizeof(data));
85 eDebug("stateFinal und action! kann doch garnicht sein ;)");