From: ghost Date: Fri, 27 Feb 2009 11:12:07 +0000 (+0100) Subject: add eDVBCiInterfaces::readCICaids X-Git-Tag: 2.6.0~396 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/574d0f07a04f5b9c295e7aa1e4e00a14fa6b2d5e add eDVBCiInterfaces::readCICaids --- diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index 0227c43c..c34ea0c0 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -898,6 +898,23 @@ RESULT eDVBCIInterfaces::setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject) return 0; } +PyObject *eDVBCIInterfaces::readCICaIds(int slotid) +{ + eDVBCISlot *slot = getSlot(slotid); + if (!slot) + { + char tmp[255]; + snprintf(tmp, 255, "eDVBCIInterfaces::readCICaIds try to get CAIds for CI Slot %d... but just %d slots are available", slotid, m_slots.size()); + PyErr_SetString(PyExc_StandardError, tmp); + return 0; + } + int idx=0; + ePyObject list = PyList_New(slot->possible_caids.size()); + for (caidSet::iterator it = slot->possible_caids.begin(); it != slot->possible_caids.end(); ++it) + PyList_SET_ITEM(list, idx++, PyLong_FromLong(*it)); + return list; +} + int eDVBCISlot::send(const unsigned char *data, size_t len) { int res=0; diff --git a/lib/dvb_ci/dvbci.h b/lib/dvb_ci/dvbci.h index 7164d25a..c11a1203 100644 --- a/lib/dvb_ci/dvbci.h +++ b/lib/dvb_ci/dvbci.h @@ -153,6 +153,7 @@ public: int getNumOfSlots() { return m_slots.size(); } PyObject *getDescrambleRules(int slotid); RESULT setDescrambleRules(int slotid, SWIG_PYOBJECT(ePyObject) ); + PyObject *readCICaIds(int slotid); }; #endif