aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-06-21 00:47:54 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2006-06-21 00:47:54 +0000
commit24c472e37de8db4007cdd4c5d67d3fd4e914f0b1 (patch)
tree48b0395dc60206e2ac8abd1ba5d0b14e310f6d6b
parentea65d88df7ab329f5950a6f5f8fee817c19f78c3 (diff)
downloadenigma2-24c472e37de8db4007cdd4c5d67d3fd4e914f0b1.tar.gz
enigma2-24c472e37de8db4007cdd4c5d67d3fd4e914f0b1.zip
Pip is now working with CI
fixes for more than one CI
-rw-r--r--lib/dvb/pmt.cpp12
-rw-r--r--lib/dvb_ci/dvbci.cpp16
-rw-r--r--lib/dvb_ci/dvbci_resmgr.cpp4
-rw-r--r--lib/dvb_ci/dvbci_ui.cpp6
-rw-r--r--lib/python/Screens/Ci.py54
5 files changed, 52 insertions, 40 deletions
diff --git a/lib/dvb/pmt.cpp b/lib/dvb/pmt.cpp
index 3b7a376f..d0119508 100644
--- a/lib/dvb/pmt.cpp
+++ b/lib/dvb/pmt.cpp
@@ -100,8 +100,7 @@ void eDVBServicePMTHandler::PMTready(int error)
eDVBCAService::register_service(m_reference, demuxes, m_ca_servicePtr);
eDVBCIInterfaces::getInstance()->recheckPMTHandlers();
}
- else
- eDVBCIInterfaces::getInstance()->gotPMT(this);
+ eDVBCIInterfaces::getInstance()->gotPMT(this);
}
if (m_ca_servicePtr)
{
@@ -449,6 +448,11 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
ref.getChannelID(chid);
res = m_resourceManager->allocateChannel(chid, m_channel);
eDebug("allocate Channel: res %d", res);
+
+ ePtr<iDVBChannelList> db;
+ if (!m_resourceManager->getChannelList(db))
+ db->getService((eServiceReferenceDVB&)m_reference, m_service);
+
if (!res)
eDVBCIInterfaces::getInstance()->addPMTHandler(this);
} else
@@ -482,10 +486,6 @@ int eDVBServicePMTHandler::tune(eServiceReferenceDVB &ref, int use_decode_demux,
m_channel = m_pvr_channel;
}
- ePtr<iDVBChannelList> db;
- if (!m_resourceManager->getChannelList(db))
- db->getService((eServiceReferenceDVB&)m_reference, m_service);
-
if (m_channel)
{
m_channel->connectStateChange(
diff --git a/lib/dvb_ci/dvbci.cpp b/lib/dvb_ci/dvbci.cpp
index c24ddd25..9c4e0ac2 100644
--- a/lib/dvb_ci/dvbci.cpp
+++ b/lib/dvb_ci/dvbci.cpp
@@ -250,9 +250,6 @@ void eDVBCIInterfaces::recheckPMTHandlers()
{
for (eSmartPtrList<eDVBCISlot>::iterator ci_it(m_slots.begin()); ci_it != m_slots.end(); ++ci_it)
{
- if (ci_it->getState() == eDVBCISlot::stateInvalid)
- ci_it->reset();
-
bool useThis=false;
eDVBCICAManagerSession *ca_manager = ci_it->getCAManager();
if (ca_manager)
@@ -358,12 +355,15 @@ void eDVBCIInterfaces::removePMTHandler(eDVBServicePMTHandler *pmthandler)
bool sameServiceExist=false;
for (PMTHandlerList::iterator i=m_pmt_handlers.begin(); i != m_pmt_handlers.end(); ++i)
{
- eServiceReferenceDVB ref;
- i->pmthandler->getServiceReference(ref);
- if ( ref == service_to_remove )
+ if (i->cislot)
{
- sameServiceExist=true;
- break;
+ eServiceReferenceDVB ref;
+ i->pmthandler->getServiceReference(ref);
+ if ( ref == service_to_remove )
+ {
+ sameServiceExist=true;
+ break;
+ }
}
}
diff --git a/lib/dvb_ci/dvbci_resmgr.cpp b/lib/dvb_ci/dvbci_resmgr.cpp
index 69ff611c..e9e4bd1b 100644
--- a/lib/dvb_ci/dvbci_resmgr.cpp
+++ b/lib/dvb_ci/dvbci_resmgr.cpp
@@ -71,10 +71,10 @@ int eDVBCIResourceManagerSession::doAction()
{0x00, 0x01, 0x00, 0x41},
{0x00, 0x02, 0x00, 0x41},
{0x00, 0x03, 0x00, 0x41},
- {0x00, 0x20, 0x00, 0x41},
+// {0x00, 0x20, 0x00, 0x41}, // host control
{0x00, 0x24, 0x00, 0x41},
{0x00, 0x40, 0x00, 0x41},
- {0x00, 0x10, 0x00, 0x41}, // auth.
+// {0x00, 0x10, 0x00, 0x41}, // auth.
};
sendAPDU(tag, data, sizeof(data));
state=stateFinal;
diff --git a/lib/dvb_ci/dvbci_ui.cpp b/lib/dvb_ci/dvbci_ui.cpp
index 56ca25fc..ce9aac1f 100644
--- a/lib/dvb_ci/dvbci_ui.cpp
+++ b/lib/dvb_ci/dvbci_ui.cpp
@@ -22,7 +22,7 @@ eDVBCI_UI::eDVBCI_UI()
slotdata[i].mmiScreen=NULL;
slotdata[i].mmiScreenReady=0;
slotdata[i].mmiTuplePos=0;
- slotdata[i].state=0;
+ slotdata[i].state=-1;
}
}
@@ -43,11 +43,7 @@ eDVBCI_UI *eDVBCI_UI::getInstance()
int eDVBCI_UI::getState(int slot)
{
if (slot < MAX_SLOTS)
- {
- if (eDVBCIInterfaces::getInstance()->getSlotState(slot) == eDVBCISlot::stateInvalid)
- eDVBCIInterfaces::getInstance()->reset(slot);
return slotdata[slot].state;
- }
return 0;
}
diff --git a/lib/python/Screens/Ci.py b/lib/python/Screens/Ci.py
index cf9efd10..b3653d21 100644
--- a/lib/python/Screens/Ci.py
+++ b/lib/python/Screens/Ci.py
@@ -273,19 +273,22 @@ class CiSelection(Screen):
self.dlg = None
self.state = { }
self.list = [ ]
- self["entries"] = MenuList(list)
- self.clearMenu()
- self.createMenu(0) # FIXME more than one CI
- CiHandler.registerCIMessageHandler(0, self.ciStateChanged)
- def clearMenu(self):
- self.list = [ ]
+ for slot in range(4):
+ state = eDVBCI_UI.getInstance().getState(slot)
+ self.appendEntries(slot, state) # FIXME more than one CI
+ CiHandler.registerCIMessageHandler(slot, self.ciStateChanged)
+
+ menuList = MenuList(list)
+ menuList.list = self.list
+ menuList.l.setList(self.list)
+ self["entries"] = menuList
- def createMenu(self, slot):
+ def appendEntries(self, slot, state):
+ self.state[slot] = state
self.list.append( (_("Reset"), 0, slot) )
self.list.append( (_("Init"), 1, slot) )
- self.state[slot] = eDVBCI_UI.getInstance().getState(slot)
if self.state[slot] == 0: #no module
self.list.append( (_("no module found"), 2, slot) )
elif self.state[slot] == 1: #module in init
@@ -295,8 +298,29 @@ class CiSelection(Screen):
appname = eDVBCI_UI.getInstance().getAppName(slot)
self.list.append( (appname, 2, slot) )
- self["entries"].list = self.list
- self["entries"].l.setList(self.list)
+ def updateState(self, slot):
+ state = eDVBCI_UI.getInstance().getState(slot)
+ self.state[slot] = state
+
+ slotidx=0
+ while self.list[slotidx][2] != slot:
+ slotidx += 1
+
+ slotidx += 1 # do not change Reset
+ slotidx += 1 # do not change Init
+
+ if state == 0: #no module
+ self.list[slotidx] = (_("no module found"), 2, slot)
+ elif state == 1: #module in init
+ self.list[slotidx] = (_("init module"), 2, slot)
+ elif state == 2: #module ready
+ #get appname
+ appname = eDVBCI_UI.getInstance().getAppName(slot)
+ self.list[slotidx] = (appname, 2, slot)
+
+ lst = self["entries"]
+ lst.list = self.list
+ lst.l.setList(self.list)
def ciStateChanged(self, slot):
if self.dlg:
@@ -306,8 +330,7 @@ class CiSelection(Screen):
if self.state[slot] != state:
#print "something happens"
self.state[slot] = state
- self.clearMenu()
- self.createMenu(slot)
+ self.updateState(slot)
def dlgClosed(self, slot):
self.dlg = None
@@ -324,13 +347,6 @@ class CiSelection(Screen):
elif self.state[slot] == 2:
self.dlg = self.session.openWithCallback(self.dlgClosed, CiMmi, slot, action)
- #generate menu / list
- #list = [ ]
- #list.append( ("TEXT", "CA-Info") )
- #list.append( ("TEXT", "Card Status") )
- #list.append( ("PIN", 6, "Card Pin", 1) )
- #self.session.open(CiMmi, 0, 0, "Wichtiges CI", "Mainmenu", "Footer", list)
-
def cancel(self):
CiHandler.unregisterCIMessageHandler(0)
self.close()