1 #ifndef __dvbci_dvbci_h
2 #define __dvbci_dvbci_h
4 #include <lib/base/ebase.h>
9 class eDVBCIApplicationManagerSession;
10 class eDVBCICAManagerSession;
11 class eDVBCIMMISession;
12 class eDVBServicePMTHandler;
15 class eDVBCISlot: public iObject, public Object
17 DECLARE_REF(eDVBCISlot);
22 eSocketNotifier *notifier;
25 enum {stateRemoved, stateInserted};
26 uint8_t prev_sent_capmt_version;
27 eDVBCIApplicationManagerSession *application_manager;
28 eDVBCICAManagerSession *ca_manager;
29 eDVBCIMMISession *mmi_session;
33 eDVBCISlot(eMainloop *context, int nr);
36 int send(const unsigned char *data, size_t len);
38 void setAppManager( eDVBCIApplicationManagerSession *session );
39 void setMMIManager( eDVBCIMMISession *session );
40 void setCAManager( eDVBCICAManagerSession *session );
42 eDVBCIApplicationManagerSession *getAppManager() { return application_manager; }
43 eDVBCIMMISession *getMMIManager() { return mmi_session; }
44 eDVBCICAManagerSession *getCAManager() { return ca_manager; }
51 int answerText(int answer);
52 int answerEnq(char *value);
56 int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector<uint16_t> &caids=std::vector<uint16_t>());
57 uint8_t getPrevSentCAPMTVersion() const { return prev_sent_capmt_version; }
58 void resetPrevSentCAPMTVersion() { prev_sent_capmt_version = 0xFF; }
60 int enableTS(int enable);
66 eDVBServicePMTHandler *pmthandler;
69 :pmthandler(NULL), cislot(NULL)
71 CIPmtHandler( const CIPmtHandler &x )
72 :pmthandler(x.pmthandler), cislot(x.cislot)
74 CIPmtHandler( eDVBServicePMTHandler *ptr )
75 :pmthandler(ptr), cislot(NULL)
77 bool operator==(const CIPmtHandler &x) const { return x.pmthandler == pmthandler; }
80 typedef std::list<CIPmtHandler> PMTHandlerList;
82 class eDVBCIInterfaces
84 DECLARE_REF(eDVBCIInterfaces);
85 static eDVBCIInterfaces *instance;
87 eSmartPtrList<eDVBCISlot> m_slots;
88 eDVBCISlot *getSlot(int slotid);
90 PMTHandlerList m_pmt_handlers;
95 void addPMTHandler(eDVBServicePMTHandler *pmthandler);
96 void removePMTHandler(eDVBServicePMTHandler *pmthandler);
97 void gotPMT(eDVBServicePMTHandler *pmthandler);
99 static eDVBCIInterfaces *getInstance();
102 int initialize(int slot);
103 int startMMI(int slot);
104 int stopMMI(int slot);
105 int answerText(int slot, int answer);
106 int answerEnq(int slot, char *value);
107 int cancelEnq(int slot);
108 int getMMIState(int slot);
109 int enableTS(int slot, int enable);
110 int sendCAPMT(int slot);