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;
30 eDVBCISlot(eMainloop *context, int nr);
33 int send(const unsigned char *data, size_t len);
35 eDVBCIApplicationManagerSession *application_manager;
36 eDVBCICAManagerSession *ca_manager;
37 eDVBCIMMISession *mmi_session;
44 int answerText(int answer);
45 int answerEnq(char *value);
48 int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector<uint16_t> &caids=std::vector<uint16_t>());
49 uint8_t getPrevSentCAPMTVersion() const { return prev_sent_capmt_version; }
50 void resetPrevSentCAPMTVersion() { prev_sent_capmt_version = 0xFF; }
55 eDVBServicePMTHandler *pmthandler;
58 :pmthandler(NULL), cislot(NULL)
60 CIPmtHandler( const CIPmtHandler &x )
61 :pmthandler(x.pmthandler), cislot(x.cislot)
63 CIPmtHandler( eDVBServicePMTHandler *ptr )
64 :pmthandler(ptr), cislot(NULL)
66 bool operator==(const CIPmtHandler &x) const { return x.pmthandler == pmthandler; }
69 typedef std::list<CIPmtHandler> PMTHandlerList;
71 class eDVBCIInterfaces
73 DECLARE_REF(eDVBCIInterfaces);
74 static eDVBCIInterfaces *instance;
76 eSmartPtrList<eDVBCISlot> m_slots;
77 eDVBCISlot *getSlot(int slotid);
79 PMTHandlerList m_pmt_handlers;
84 void addPMTHandler(eDVBServicePMTHandler *pmthandler);
85 void removePMTHandler(eDVBServicePMTHandler *pmthandler);
86 void gotPMT(eDVBServicePMTHandler *pmthandler);
88 static eDVBCIInterfaces *getInstance();
91 int initialize(int slot);
92 int startMMI(int slot);
93 int stopMMI(int slot);
94 int answerText(int slot, int answer);
95 int answerEnq(int slot, char *value);
96 int cancelEnq(int slot);
97 int getMMIState(int slot);