//reset some tuner configuration
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
{
- long tmp;
- char c;
- if (sscanf(it->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1 && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1)
- {
- FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
- if (!f || fwrite("B", 1, 1, f) != 1)
- eDebug("set /proc/stb/tsmux/lnb_b_input to B failed!! (%m)");
- else
- {
- eDebug("set /proc/stb/tsmux/lnb_b_input to B OK");
- fclose(f);
- }
- }
it->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, -1);
it->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, -1);
it->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, -1);
char c;
p1->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, (long)p2);
p2->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, (long)p1);
- if (!strcmp(p1->m_frontend->getDescription(), p2->m_frontend->getDescription()) && sscanf(p1->m_frontend->getDescription(), "BCM450%c (internal)", &c) == 1)
- {
- FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
- if (!f || fwrite("A", 1, 1, f) != 1)
- eDebug("set /proc/stb/tsmux/lnb_b_input to A failed!! (%m)");
- else
- {
- eDebug("set /proc/stb/tsmux/lnb_b_input to A OK");
- fclose(f);
- }
- }
}
p1=p2=NULL;
def setSatposDepends(self, sec, nim1, nim2):
print "tuner", nim1, "depends on satpos of", nim2
sec.setTunerDepends(nim1, nim2)
+
+ def linkInternally(self, slotid):
+ nim = self.NimManager.getNim(slotid)
+ if nim.internallyConnectableTo is not None:
+ nim.setInternalLink()
def linkNIMs(self, sec, nim1, nim2):
print "link tuner", nim1, "to tuner", nim2
+ if nim2 == (nim1 - 1):
+ self.linkInternally(nim1)
sec.setTunerLinked(nim1, nim2)
def getRoot(self, slotid, connto):
def update(self):
sec = secClass.getInstance()
self.configuredSatellites = set()
+ for slotid in self.NimManager.getNimListOfType("DVB-S"):
+ if self.NimManager.nimInternallyConnectableTo(slotid) is not None:
+ self.NimManager.nimRemoveInternalLink(slotid)
sec.clear() ## this do unlinking NIMs too !!
print "sec config cleared"
def internallyConnectableTo(self):
return self.internally_connectable
+ def setInternalLink(self):
+ if self.internally_connectable is not None:
+ print "setting internal link on frontend id", self.frontend_id
+ open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("internal")
+
+ def removeInternalLink(self):
+ if self.internally_connectable is not None:
+ print "removing internal link on frontend id", self.frontend_id
+ open("/proc/stb/frontend/%d/rf_switch" % self.frontend_id, "w").write("external")
+
def isMultiType(self):
return (len(self.multi_type) > 0)
def getNimName(self, slotid):
return self.nim_slots[slotid].description
+
+ def getNim(self, slotid):
+ return self.nim_slots[slotid]
def getNimListOfType(self, type, exception = -1):
# returns a list of indexes for NIMs compatible to the given type, except for 'exception'
def hasOutputs(self, slotid):
return self.nim_slots[slotid].hasOutputs()
+ def nimInternallyConnectableTo(self, slotid):
+ return self.nim_slots[slotid].internallyConnectableTo()
+
+ def nimRemoveInternalLink(self, slotid):
+ self.nim_slots[slotid].removeInternalLink()
+
def canConnectTo(self, slotid):
slots = []
if self.nim_slots[slotid].internallyConnectableTo() is not None: