1 #ifndef __dvbci_dvbci_h
2 #define __dvbci_dvbci_h
4 #include <lib/base/ebase.h>
10 class eDVBCIApplicationManagerSession;
11 class eDVBCICAManagerSession;
12 class eDVBCIMMISession;
13 class eDVBServicePMTHandler;
21 queueData( unsigned char *data, unsigned int len, __u8 prio = 0 )
22 :prio(prio), data(data), len(len)
26 bool operator < ( const struct queueData &a ) const
32 class eDVBCISlot: public iObject, public Object
34 DECLARE_REF(eDVBCISlot);
39 eSocketNotifier *notifier;
42 std::map<uint16_t, uint8_t> running_services;
43 eDVBCIApplicationManagerSession *application_manager;
44 eDVBCICAManagerSession *ca_manager;
45 eDVBCIMMISession *mmi_session;
46 std::priority_queue<queueData> sendqueue;
48 enum {stateRemoved, stateInserted, stateInvalid, stateResetted};
51 eDVBCISlot(eMainloop *context, int nr);
54 int send(const unsigned char *data, size_t len);
56 void setAppManager( eDVBCIApplicationManagerSession *session );
57 void setMMIManager( eDVBCIMMISession *session );
58 void setCAManager( eDVBCICAManagerSession *session );
60 eDVBCIApplicationManagerSession *getAppManager() { return application_manager; }
61 eDVBCIMMISession *getMMIManager() { return mmi_session; }
62 eDVBCICAManagerSession *getCAManager() { return ca_manager; }
64 int getState() { return state; }
69 int answerText(int answer);
70 int answerEnq(char *value);
73 int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector<uint16_t> &caids=std::vector<uint16_t>());
74 void removeService(uint16_t program_number=0xFFFF);
75 int getNumOfServices() { return running_services.size(); }
77 int enableTS(int enable, int tuner=0);
83 eDVBServicePMTHandler *pmthandler;
86 :pmthandler(NULL), cislot(NULL)
88 CIPmtHandler( const CIPmtHandler &x )
89 :pmthandler(x.pmthandler), cislot(x.cislot)
91 CIPmtHandler( eDVBServicePMTHandler *ptr )
92 :pmthandler(ptr), cislot(NULL)
94 bool operator==(const CIPmtHandler &x) const { return x.pmthandler == pmthandler; }
97 typedef std::list<CIPmtHandler> PMTHandlerList;
99 class eDVBCIInterfaces
101 DECLARE_REF(eDVBCIInterfaces);
102 static eDVBCIInterfaces *instance;
104 eSmartPtrList<eDVBCISlot> m_slots;
105 eDVBCISlot *getSlot(int slotid);
107 PMTHandlerList m_pmt_handlers;
112 void addPMTHandler(eDVBServicePMTHandler *pmthandler);
113 void removePMTHandler(eDVBServicePMTHandler *pmthandler);
114 void recheckPMTHandlers();
115 void gotPMT(eDVBServicePMTHandler *pmthandler);
116 void ciRemoved(eDVBCISlot *slot);
117 int getSlotState(int slot);
119 static eDVBCIInterfaces *getInstance();
122 int initialize(int slot);
123 int startMMI(int slot);
124 int stopMMI(int slot);
125 int answerText(int slot, int answer);
126 int answerEnq(int slot, char *value);
127 int cancelEnq(int slot);
128 int getMMIState(int slot);
129 int enableTS(int slot, int enable);
130 int sendCAPMT(int slot);