1 /* DVB CI Resource Manager */
3 #include <lib/dvb_ci/dvbci_resmgr.h>
5 int eDVBCIResourceManagerSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
7 printf("SESSION(%d) %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
8 for (int i=0; i<len; i++)
9 printf("%02x ", ((const unsigned char*)data)[i]);
11 if ((tag[0]==0x9f) && (tag[1]==0x80))
15 case 0x10: // profile enquiry
16 printf("cam fragt was ich kann.\n");
17 state=stateProfileEnquiry;
20 case 0x11: // Tprofile
21 printf("mein cam kann: ");
25 for (int i=0; i<len; i++)
26 printf("%02x ", ((const unsigned char*)data)[i]);
28 if (state == stateFirstProfileEnquiry)
36 printf("unknown APDU tag 9F 80 %02x\n", tag[2]);
43 int eDVBCIResourceManagerSession::doAction()
49 const unsigned char tag[3]={0x9F, 0x80, 0x10}; // profile enquiry
51 state = stateFirstProfileEnquiry;
54 case stateFirstProfileEnquiry:
56 const unsigned char tag[3]={0x9F, 0x80, 0x12}; // profile change
58 state=stateProfileChange;
61 case stateProfileChange:
63 printf("bla kaputt\n");
66 case stateProfileEnquiry:
68 const unsigned char tag[3]={0x9F, 0x80, 0x11};
69 const unsigned char data[][4]=
71 {0x00, 0x01, 0x00, 0x41},
72 {0x00, 0x02, 0x00, 0x41},
73 {0x00, 0x03, 0x00, 0x41},
74 {0x00, 0x20, 0x00, 0x41},
75 {0x00, 0x24, 0x00, 0x41},
76 {0x00, 0x40, 0x00, 0x41},
77 {0x00, 0x10, 0x00, 0x41}, // auth.
79 sendAPDU(tag, data, sizeof(data));
84 printf("stateFinal und action! kann doch garnicht sein ;)\n");