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]);
27 if (state == stateFirstProfileEnquiry)
35 printf("unknown APDU tag 9F 80 %02x\n", tag[2]);
41 int eDVBCIResourceManagerSession::doAction()
47 const unsigned char tag[3]={0x9F, 0x80, 0x10}; // profile enquiry
49 state=stateFirstProfileEnquiry;
52 case stateFirstProfileEnquiry:
54 const unsigned char tag[3]={0x9F, 0x80, 0x12}; // profile change
56 state=stateProfileChange;
59 case stateProfileEnquiry:
61 const unsigned char tag[3]={0x9F, 0x80, 0x11};
62 const unsigned char data[][4]=
64 {0x00, 0x01, 0x00, 0x41},
65 {0x00, 0x02, 0x00, 0x41},
66 {0x00, 0x03, 0x00, 0x41},
67 {0x00, 0x20, 0x00, 0x41},
68 {0x00, 0x24, 0x00, 0x41},
69 {0x00, 0x40, 0x00, 0x41},
70 {0x00, 0x10, 0x00, 0x41}, // auth.
72 sendAPDU(tag, data, sizeof(data));
77 printf("stateFinal und action! kann doch garnicht sein ;)\n");