X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb_ci%2Fdvbci_session.h;h=cf69ca9a05697e5929847f21f094ebe43a33e8a1;hp=dd123eee601bc1f3595aefaa801c70b2db0c6f12;hb=d41938053190e075de41c63acfdcea3e239dcaba;hpb=640fa7fc2dab8135f04952e3dec9abd1d715a328 diff --git a/lib/dvb_ci/dvbci_session.h b/lib/dvb_ci/dvbci_session.h index dd123ee..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); @@ -23,7 +26,13 @@ protected: 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); @@ -33,6 +42,9 @@ public: int getState() { return state; } int getStatus() { return status; } + + static int pollAll(); + }; #endif