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
34 TUNER_A, TUNER_B, TUNER_C, TUNER_D, CI_A, CI_B, CI_C, CI_D
37 class eDVBCISlot: public iObject, public Object
39 DECLARE_REF(eDVBCISlot);
44 eSocketNotifier *notifier;
47 std::map<uint16_t, uint8_t> running_services;
48 eDVBCIApplicationManagerSession *application_manager;
49 eDVBCICAManagerSession *ca_manager;
50 eDVBCIMMISession *mmi_session;
51 std::priority_queue<queueData> sendqueue;
53 enum {stateRemoved, stateInserted, stateInvalid, stateResetted};
55 eDVBCISlot *linked_next; // needed for linked CI handling
56 data_source current_source;
59 eDVBCISlot(eMainloop *context, int nr);
62 int send(const unsigned char *data, size_t len);
64 void setAppManager( eDVBCIApplicationManagerSession *session );
65 void setMMIManager( eDVBCIMMISession *session );
66 void setCAManager( eDVBCICAManagerSession *session );
68 eDVBCIApplicationManagerSession *getAppManager() { return application_manager; }
69 eDVBCIMMISession *getMMIManager() { return mmi_session; }
70 eDVBCICAManagerSession *getCAManager() { return ca_manager; }
72 int getState() { return state; }
77 int answerText(int answer);
78 int answerEnq(char *value);
81 int sendCAPMT(eDVBServicePMTHandler *ptr, const std::vector<uint16_t> &caids=std::vector<uint16_t>());
82 void removeService(uint16_t program_number=0xFFFF);
83 int getNumOfServices() { return running_services.size(); }
84 int setSource(data_source source);
89 eDVBServicePMTHandler *pmthandler;
92 :pmthandler(NULL), cislot(NULL)
94 CIPmtHandler( const CIPmtHandler &x )
95 :pmthandler(x.pmthandler), cislot(x.cislot)
97 CIPmtHandler( eDVBServicePMTHandler *ptr )
98 :pmthandler(ptr), cislot(NULL)
100 bool operator==(const CIPmtHandler &x) const { return x.pmthandler == pmthandler; }
103 typedef std::list<CIPmtHandler> PMTHandlerList;
105 class eDVBCIInterfaces
107 DECLARE_REF(eDVBCIInterfaces);
108 static eDVBCIInterfaces *instance;
110 eSmartPtrList<eDVBCISlot> m_slots;
111 eDVBCISlot *getSlot(int slotid);
112 PMTHandlerList m_pmt_handlers;
117 void addPMTHandler(eDVBServicePMTHandler *pmthandler);
118 void removePMTHandler(eDVBServicePMTHandler *pmthandler);
119 void recheckPMTHandlers();
120 void gotPMT(eDVBServicePMTHandler *pmthandler);
121 void ciRemoved(eDVBCISlot *slot);
122 int getSlotState(int slot);
124 static eDVBCIInterfaces *getInstance();
127 int initialize(int slot);
128 int startMMI(int slot);
129 int stopMMI(int slot);
130 int answerText(int slot, int answer);
131 int answerEnq(int slot, char *value);
132 int cancelEnq(int slot);
133 int getMMIState(int slot);
134 int sendCAPMT(int slot);
135 int setInputSource(int tunerno, data_source source);