#include <fcntl.h>
+#include <sys/ioctl.h>
#include <lib/base/init.h>
#include <lib/base/init_num.h>
+#include <lib/base/ebase.h>
#include <lib/base/eerror.h>
#include <lib/dvb_ci/dvbci.h>
#include <lib/dvb_ci/dvbci_ui.h>
+eDVBCIInterfaces *eDVBCIInterfaces::instance = 0;
+
eDVBCIInterfaces::eDVBCIInterfaces()
{
int num_ci = 0;
-
+
+ instance = this;
+
eDebug("scanning for common interfaces..");
while (1)
{
}
+eDVBCIInterfaces *eDVBCIInterfaces::getInstance()
+{
+ return instance;
+}
+
+eDVBCISlot *eDVBCIInterfaces::getSlot(int slotid)
+{
+ for(eSmartPtrList<eDVBCISlot>::iterator i(m_slots.begin()); i != m_slots.end(); ++i)
+ if(i->getSlotID() == slotid)
+ return i;
+
+ return 0;
+}
+
+int eDVBCIInterfaces::reset(int slotid)
+{
+ eDVBCISlot *slot;
+
+ if( (slot = getSlot(slotid)) == 0 ) {
+ printf("FIXME: request for unknown slot\n");
+ return 0;
+ }
+
+ return slot->reset();
+}
+
int eDVBCISlot::send(const unsigned char *data, size_t len)
{
int res;
return;
}
-
__u8 data[4096];
int r;
r = ::read(fd, data, 4096);
{
char filename[128];
+ slotid = nr;
+
sprintf(filename, "/dev/ci%d", nr);
fd = ::open(filename, O_RDWR | O_NONBLOCK);
eDebug("eDVBCISlot has fd %d", fd);
+
+ state = stateInserted;
if (fd >= 0)
{
{
}
+int eDVBCISlot::getSlotID()
+{
+ return slotid;
+}
+
+int eDVBCISlot::reset()
+{
+ printf("edvbcislot: reset requested\n");
+
+ ioctl(fd, 0);
+
+ return 0;
+}
+
eAutoInitP0<eDVBCIInterfaces> init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots");