X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/e4034b7fce157a23fcd2668a59ccc7a32d19ac84..bac62ae64bc2b0cba82a26daec4b3623cae3a859:/lib/dvb_ci/dvbci.cpp diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp index e7d9b27b..b15fcce3 100644 --- a/lib/dvb_ci/dvbci.cpp +++ b/lib/dvb_ci/dvbci.cpp @@ -72,7 +72,7 @@ int eDVBCIInterfaces::reset(int slotid) if( (slot = getSlot(slotid)) == 0 ) return -1; - + return slot->reset(); } @@ -82,7 +82,7 @@ int eDVBCIInterfaces::enableTS(int slotid, int enable) if( (slot = getSlot(slotid)) == 0 ) return -1; - + return slot->enableTS(enable); } @@ -92,10 +92,44 @@ int eDVBCIInterfaces::initialize(int slotid) if( (slot = getSlot(slotid)) == 0 ) return -1; - + + slot->resetPrevSentCAPMTVersion(); + PMTHandlerList::iterator it = m_pmt_handlers.begin(); + while (it != m_pmt_handlers.end()) + { + if ( it->cislot == slot ) + { + slot->sendCAPMT(it->pmthandler); // send capmt + break; + } + ++it; + } + return slot->initialize(); } +int eDVBCIInterfaces::sendCAPMT(int slotid) +{ + eDVBCISlot *slot; + + if( (slot = getSlot(slotid)) == 0 ) + return -1; + + slot->resetPrevSentCAPMTVersion(); + PMTHandlerList::iterator it = m_pmt_handlers.begin(); + while (it != m_pmt_handlers.end()) + { + if ( it->cislot == slot ) + { + slot->sendCAPMT(it->pmthandler); // send capmt + return 0; + } + ++it; + } + + return -1; +} + int eDVBCIInterfaces::startMMI(int slotid) { eDVBCISlot *slot; @@ -192,7 +226,7 @@ void eDVBCIInterfaces::removePMTHandler(eDVBServicePMTHandler *pmthandler) if (it != m_pmt_handlers.end()) { eDVBCISlot *slot = it->cislot; - eDVBServicePMTHandler *pmthandler = it->pmthandler; +// eDVBServicePMTHandler *pmthandler = it->pmthandler; m_pmt_handlers.erase(it); if (slot && !--slot->use_count) { @@ -341,6 +375,21 @@ eDVBCISlot::~eDVBCISlot() enableTS(0); } +void eDVBCISlot::setAppManager( eDVBCIApplicationManagerSession *session ) +{ + application_manager=session; +} + +void eDVBCISlot::setMMIManager( eDVBCIMMISession *session ) +{ + mmi_session = session; +} + +void eDVBCISlot::setCAManager( eDVBCICAManagerSession *session ) +{ + ca_manager = session; +} + int eDVBCISlot::getSlotID() { return slotid; @@ -419,7 +468,12 @@ int eDVBCISlot::cancelEnq() int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vector &ids) { - const std::vector &caids = ids.empty() && ca_manager ? ca_manager->getCAIDs() : ids; + if (!ca_manager) + { + eDebug("no ca_manager (no CI plugged?)"); + return -1; + } + const std::vector &caids = ids.empty() ? ca_manager->getCAIDs() : ids; ePtr > ptr; if (pmthandler->getPMT(ptr)) return -1; @@ -467,20 +521,14 @@ int eDVBCISlot::sendCAPMT(eDVBServicePMTHandler *pmthandler, const std::vectorsendCAPMT(raw_data + hlen, wp - hlen); - prev_sent_capmt_version = pmt_version; - } + //dont need tag and lenfield + ca_manager->sendCAPMT(raw_data + hlen, wp - hlen); + prev_sent_capmt_version = pmt_version; } } @@ -492,7 +540,7 @@ int eDVBCISlot::enableTS(int enable) FILE *f; if((f = fopen("/proc/stb/tsmux/input0", "wb")) == NULL) { - printf("cannot open /proc/stb/audio/j1_mute\n"); + printf("cannot open /proc/stb/tsmux/input0\n"); return 0; } @@ -503,5 +551,9 @@ int eDVBCISlot::enableTS(int enable) return 0; } +void eDVBCISlot::resendCAPMT() +{ + eDVBCIInterfaces::getInstance()->sendCAPMT(slotid); +} eAutoInitP0 init_eDVBCIInterfaces(eAutoInitNumbers::dvb, "CI Slots");