X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb_ci%2Fdvbci_session.h;h=cf69ca9a05697e5929847f21f094ebe43a33e8a1;hp=5f95ee82d7c070dbc94da279acd5b110fcbbe45b;hb=d41938053190e075de41c63acfdcea3e239dcaba;hpb=c4bab36eed7b9ce0ba0b16775a9d429c71c5eed7 diff --git a/lib/dvb_ci/dvbci_session.h b/lib/dvb_ci/dvbci_session.h index 5f95ee8..cf69ca9 100644 --- a/lib/dvb_ci/dvbci_session.h +++ b/lib/dvb_ci/dvbci_session.h @@ -2,14 +2,17 @@ #define __dvbci_dvbci_tc_h #include +#include #include #define SLMS 256 class eDVBCISession { - static eDVBCISession *sessions[SLMS]; - static eDVBCISession *eDVBCISession::createSession(eDVBCISlot *slot, const unsigned char *resource_identifier, unsigned char &status); + DECLARE_REF(eDVBCISession); + static ePtr sessions[SLMS]; + static void eDVBCISession::deleteSessions(const eDVBCISlot *slot); + static void eDVBCISession::createSession(eDVBCISlot *slot, const unsigned char *resource_identifier, unsigned char &status, ePtr &ptr); static void eDVBCISession::sendSPDU(eDVBCISlot *slot, unsigned char tag,const void *data, int len, unsigned short session_nb, const void *apdu=0,int alen=0); static void sendOpenSessionResponse(eDVBCISlot *slot,unsigned char session_status, const unsigned char *resource_identifier,unsigned short session_nb); void recvCreateSessionResponse(const unsigned char *data); @@ -22,7 +25,14 @@ protected: 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); + virtual int doAction()=0; + void handleClose(); public: + virtual ~eDVBCISession(); + + + int poll() { if (action) { action=doAction(); return 1; } return 0; } enum { stateInCreation, stateBusy, stateInDeletion, stateStarted, statePrivate}; static int parseLengthField(const unsigned char *pkt, int &len); @@ -32,6 +42,9 @@ public: int getState() { return state; } int getStatus() { return status; } + + static int pollAll(); + }; #endif