X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fdvb%2Fsec.cpp;h=9124688950af12d3a2060da4c9e1f72375796ace;hp=71c8a19cfd10a3ed5874a13c8a4a46ecae79e667;hb=e90006f23e9a87b65a3fbb8b5abf5f6b4432817c;hpb=29c3340e877cfa1d1818a140f76f14270b84c3d2 diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index 71c8a19..9124688 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -37,7 +37,7 @@ void eDVBSatelliteEquipmentControl::setParam(int param, int value) } eDVBSatelliteEquipmentControl::eDVBSatelliteEquipmentControl(eSmartPtrList &avail_frontends, eSmartPtrList &avail_simulate_frontends) - :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(false) + :m_lnbidx((sizeof(m_lnbs) / sizeof(eDVBSatelliteLNBParameters))-1), m_curSat(m_lnbs[0].m_satellites.end()), m_avail_frontends(avail_frontends), m_avail_simulate_frontends(avail_simulate_frontends), m_rotorMoving(0) { if (!instance) instance = this; @@ -976,7 +976,8 @@ RESULT eDVBSatelliteEquipmentControl::clear() for (eSmartPtrList::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it) { long tmp; - if (!strcmp(it->m_frontend->getDescription(), "BCM4501 (internal)") && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1) + 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) @@ -1385,8 +1386,8 @@ RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2) if (tu1 != tu2) { eDVBRegisteredFrontend *p1=NULL, *p2=NULL; - - for (eSmartPtrList::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it) + eSmartPtrList::iterator it(m_avail_frontends.begin()); + for (; it != m_avail_frontends.end(); ++it) { if (it->m_frontend->getSlotID() == tu1) p1 = *it; @@ -1395,9 +1396,10 @@ RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2) } if (p1 && p2) { + 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()) && !strcmp(p1->m_frontend->getDescription(), "BCM4501 (internal)")) + 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) @@ -1411,7 +1413,8 @@ RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2) } p1=p2=NULL; - for (eSmartPtrList::iterator it(m_avail_simulate_frontends.begin()); it != m_avail_simulate_frontends.end(); ++it) + it=m_avail_simulate_frontends.begin(); + for (; it != m_avail_simulate_frontends.end(); ++it) { if (it->m_frontend->getSlotID() == tu1) p1 = *it; @@ -1478,7 +1481,10 @@ bool eDVBSatelliteEquipmentControl::isRotorMoving() return m_rotorMoving; } -void eDVBSatelliteEquipmentControl::setRotorMoving(bool b) +void eDVBSatelliteEquipmentControl::setRotorMoving(int slot_no, bool b) { - m_rotorMoving=b; + if (b) + m_rotorMoving |= (1 << slot_no); + else + m_rotorMoving &= ~(1 << slot_no); }