+
+RESULT eDVBSatelliteEquipmentControl::setRotorTurningSpeed(int speed)
+{
+ eSecDebug("eDVBSatelliteEquipmentControl::setRotorTurningSpeed(%d)", speed);
+ if ( currentLNBValid() )
+ m_lnbs[m_lnbidx].m_rotor_parameters.m_inputpower_parameters.m_turning_speed = speed;
+ else
+ return -ENOENT;
+ return 0;
+}
+
+struct sat_compare
+{
+ int orb_pos, lofl, lofh;
+ sat_compare(int o, int lofl, int lofh)
+ :orb_pos(o), lofl(lofl), lofh(lofh)
+ {}
+ sat_compare(const sat_compare &x)
+ :orb_pos(x.orb_pos), lofl(x.lofl), lofh(x.lofh)
+ {}
+ bool operator < (const sat_compare & cmp) const
+ {
+ if (orb_pos == cmp.orb_pos)
+ {
+ if ( abs(lofl-cmp.lofl) < 200000 )
+ {
+ if (abs(lofh-cmp.lofh) < 200000)
+ return false;
+ return lofh<cmp.lofh;
+ }
+ return lofl<cmp.lofl;
+ }
+ return orb_pos < cmp.orb_pos;
+ }
+};
+
+RESULT eDVBSatelliteEquipmentControl::setTunerLinked(int tu1, int tu2)
+{
+ eSecDebug("eDVBSatelliteEquipmentControl::setTunerLinked(%d, %d)", tu1, tu2);
+ if (tu1 != tu2)
+ {
+ eDVBRegisteredFrontend *p1=NULL, *p2=NULL;
+
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
+ {
+ if (it->m_frontend->getSlotID() == tu1)
+ p1 = *it;
+ else if (it->m_frontend->getSlotID() == tu2)
+ p2 = *it;
+ }
+ if (p1 && p2)
+ {
+ 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)"))
+ {
+ 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);
+ }
+ }
+ return 0;
+ }
+ }
+ return -1;
+}
+
+RESULT eDVBSatelliteEquipmentControl::setTunerDepends(int tu1, int tu2)
+{
+ eSecDebug("eDVBSatelliteEquipmentControl::setTunerDepends(%d, %d)", tu1, tu2);
+ if (tu1 == tu2)
+ return -1;
+
+ eDVBRegisteredFrontend *p1=NULL, *p2=NULL;
+
+ for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
+ {
+ if (it->m_frontend->getSlotID() == tu1)
+ p1 = *it;
+ else if (it->m_frontend->getSlotID() == tu2)
+ p2 = *it;
+ }
+ if (p1 && p2)
+ {
+ p1->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (long)p2);
+ p2->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (long)p1);
+ return 0;
+ }
+ return -1;
+}
+
+void eDVBSatelliteEquipmentControl::setSlotNotLinked(int slot_no)
+{
+ eSecDebug("eDVBSatelliteEquipmentControl::setSlotNotLinked(%d)", slot_no);
+ m_not_linked_slot_mask |= (1 << slot_no);
+}
+
+bool eDVBSatelliteEquipmentControl::isRotorMoving()
+{
+ return m_rotorMoving;
+}
+
+void eDVBSatelliteEquipmentControl::setRotorMoving(bool b)
+{
+ m_rotorMoving=b;
+}