X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/7b56077dd54d70a237abf8bc8c53169f39a9575e..7abf1d06a7a051f55708af14aef49ad7fea093ac:/lib/dvb_ci/dvbci.cpp diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 6a748118..014d51a5 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -7,10 +7,12 @@ #include #include +#include + eDVBCIInterfaces::eDVBCIInterfaces() { int num_ci = 0; - + eDebug("scanning for common interfaces.."); while (1) @@ -30,7 +32,7 @@ eDVBCIInterfaces::eDVBCIInterfaces() ++num_ci; } - eDebug("done, found %d common interfaces"); + eDebug("done, found %d common interface slots", num_ci); } eDVBCIInterfaces::~eDVBCIInterfaces() @@ -40,18 +42,17 @@ eDVBCIInterfaces::~eDVBCIInterfaces() int eDVBCISlot::send(const unsigned char *data, size_t len) { int res; - int i; - - printf("< "); - for(i=0;isetRequested(eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Write); + notifier->setRequested(eSocketNotifier::Read | eSocketNotifier::Priority | eSocketNotifier::Write); return res; } @@ -63,45 +64,42 @@ void eDVBCISlot::data(int what) 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(r < 0) - // eWarning("ERROR reading from CI - %m\n"); if(state != stateInserted) { state = stateInserted; eDebug("ci inserted"); - /* enable HUP to detect removal or errors */ - //notifier_event->start(); + //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 "); + //for(i=0;isetRequested(eSocketNotifier::Read|eSocketNotifier::Priority|eSocketNotifier::Write); return; } if(what == eSocketNotifier::Write) { - printf("pollall\n"); if(eDVBCISession::pollAll() == 0) { - printf("disable pollout\n"); notifier->setRequested(eSocketNotifier::Read | eSocketNotifier::Priority); } - return; } } @@ -116,6 +114,8 @@ eDVBCISlot::eDVBCISlot(eMainloop *context, int nr) fd = ::open(filename, O_RDWR | O_NONBLOCK); eDebug("eDVBCISlot has fd %d", fd); + + state = stateInserted; if (fd >= 0) {