+ return slot->answerMMI(answer, value);
+}
+
+int eDVBCISlot::send(const unsigned char *data, size_t len)
+{
+ int res;
+ //int i;
+ //printf("< ");
+ //for(i=0;i<len;i++)
+ // printf("%02x ",data[i]);
+ //printf("\n");
+
+ res = ::write(fd, data, len);
+
+ //printf("write() %d\n",res);
+
+ notifier->setRequested(eSocketNotifier::Read | eSocketNotifier::Priority | eSocketNotifier::Write);
+
+ return res;
+}
+
+void eDVBCISlot::data(int what)
+{
+ if(what == eSocketNotifier::Priority) {
+ if(state != stateRemoved) {
+ state = stateRemoved;
+ printf("ci removed\n");
+ notifier->setRequested(eSocketNotifier::Read);
+ //HACK
+ eDVBCI_UI::getInstance()->setState(0,0);
+ }
+ return;
+ }
+
+ __u8 data[4096];
+ int r;
+ r = ::read(fd, data, 4096);
+
+ if(state != stateInserted) {
+ state = stateInserted;
+ eDebug("ci inserted");
+
+ //HACK
+ eDVBCI_UI::getInstance()->setState(0,1);
+
+ /* enable PRI to detect removal or errors */
+ notifier->setRequested(eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Write);
+ }
+
+ if(r > 0) {
+ //int i;
+ //printf("> ");
+ //for(i=0;i<r;i++)
+ // printf("%02x ",data[i]);
+ //printf("\n");
+ eDVBCISession::receiveData(this, data, r);
+ notifier->setRequested(eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Write);
+ return;
+ }
+
+ if(what == eSocketNotifier::Write) {
+ if(eDVBCISession::pollAll() == 0) {
+ notifier->setRequested(eSocketNotifier::Read | eSocketNotifier::Priority);
+ }
+ }