#include <lib/base/ebase.h>
class eDVBCISession;
+class eDVBCIApplicationManagerSession;
+class eDVBCICAManagerSession;
class eDVBCISlot: public iObject, public Object
{
virtual ~eDVBCISlot();
int eDVBCISlot::write(const unsigned char *data, size_t len);
+
+ eDVBCIApplicationManagerSession *application_manager;
+ eDVBCICAManagerSession *ca_manager;
};
class eDVBCIInterfaces
#include <lib/dvb_ci/dvbci_camgr.h>
+int eDVBCICAManagerSession::receivedAPDU(const unsigned char *tag, const void *data, int len)
+{
+ printf("SESSION(%d)/CA %02x %02x %02x: ", session_nb, tag[0], tag[1],tag[2]);
+ for (int i=0; i<len; i++)
+ printf("%02x ", ((const unsigned char*)data)[i]);
+ printf("\n");
+
+ if ((tag[0]==0x9f) && (tag[1]==0x80))
+ {
+ switch (tag[2])
+ {
+ case 0x31:
+ printf("ca info:\n");
+ for (int i=0; i<len; i+=2)
+ {
+ printf("%04x ", (((const unsigned char*)data)[i]<<8)|(((const unsigned char*)data)[i+1]));
+ caids.insert((((const unsigned char*)data)[i]<<8)|(((const unsigned char*)data)[i+1]));
+ }
+ printf("\n");
+ break;
+ default:
+ printf("unknown APDU tag 9F 80 %02x\n", tag[2]);
+ break;
+ }
+ }
+ return 0;
+}
+
+int eDVBCICAManagerSession::doAction()
+{
+ switch (state)
+ {
+ case stateStarted:
+ {
+ const unsigned char tag[3]={0x9F, 0x80, 0x30}; // ca info enq
+ sendAPDU(tag);
+ state=stateFinal;
+ return 0;
+ }
+ case stateFinal:
+ printf("stateFinal und action! kann doch garnicht sein ;)\n");
+ default:
+ return 0;
+ }
+}
#include <lib/dvb_ci/dvbci_session.h>
#include <lib/dvb_ci/dvbci_resmgr.h>
+#include <lib/dvb_ci/dvbci_appmgr.h>
+#include <lib/dvb_ci/dvbci_camgr.h>
int eDVBCISession::buildLengthField(unsigned char *pkt, int len)
{
sendSPDU(0x90, 0, 0, pkt, len+3+l);
}
+void eDVBCISession::sendSPDU(unsigned char tag, const void *data, int len, const void *apdu, int alen)
+{
+ sendSPDU(slot, tag, data, len, session_nb, apdu, alen);
+}
+
void eDVBCISession::sendSPDU(eDVBCISlot *slot, unsigned char tag, const void *data, int len, unsigned short session_nb, const void *apdu,int alen)
{
unsigned char pkt[4096];
printf("RESOURCE MANAGER\n");
break;
case 0x00020041:
-// session=eDVBCIModule::getInstance()->application_manager = new eDVBCIApplicationManagerSession;
+ session=slot->application_manager = new eDVBCIApplicationManagerSession;
printf("APPLICATION MANAGER\n");
break;
case 0x00030041:
-// session=eDVBCIModule::getInstance()->ca_manager=new eDVBCICAManagerSession;
+ session=slot->ca_manager=new eDVBCICAManagerSession;
printf("CA MANAGER\n");
break;
case 0x00240041:
unsigned short session_nb;
virtual int receivedAPDU(const unsigned char *tag, const void *data, int len) = 0;
void eDVBCISession::sendAPDU(const unsigned char *tag, const void *data=0,int len=0);
+ void eDVBCISession::sendSPDU(unsigned char tag, const void *data, int len,const void *apdu=0, int alen=0);
public:
enum { stateInCreation, stateBusy, stateInDeletion, stateStarted, statePrivate};