+static void checkLinkedParams(int direction, int &linked_ptr, int &ret, const eDVBFrontendParametersSatellite &sat, int csw, int ucsw, int toneburst, bool diseqc, bool rotor)
+{
+ eDVBRegisteredFrontend *linked_fe = (eDVBRegisteredFrontend*) linked_ptr;
+ int oRotorPos = -1;
+ linked_fe->m_frontend->getData(eDVBFrontend::ROTOR_POS, oRotorPos);
+ if (linked_fe->m_inuse)
+ {
+ int ocsw = -1,
+ oucsw = -1,
+ oToneburst = -1;
+ linked_fe->m_frontend->getData(eDVBFrontend::CSW, ocsw);
+ linked_fe->m_frontend->getData(eDVBFrontend::UCSW, oucsw);
+ linked_fe->m_frontend->getData(eDVBFrontend::TONEBURST, oToneburst);
+#if 0
+ eDebug("compare csw %02x == lcsw %02x",
+ csw, ocsw);
+ if ( diseqc )
+ eDebug("compare ucsw %02x == lucsw %02x\ncompare toneburst %02x == oToneburst %02x",
+ ucsw, oucsw, toneburst, oToneburst);
+ if ( rotor )
+ eDebug("compare pos %d == current pos %d",
+ sat.orbital_position, oRotorPos);
+#endif
+ if ( (csw != ocsw) ||
+ ( diseqc && (ucsw != oucsw || toneburst != oToneburst) ) ||
+ ( rotor && oRotorPos != sat.orbital_position ) )
+ {
+// eDebug("can not tune this transponder with linked tuner in use!!");
+ ret=0;
+ }
+// else
+// eDebug("OK .. can tune this transponder with linked tuner in use :)");
+ }
+ else if (rotor && oRotorPos != -1)
+ {
+ ret -= abs(oRotorPos-sat.orbital_position);
+// eDebug("decrement rotor pos for linked tuner!!");
+ }
+ linked_fe->m_frontend->getData(direction, linked_ptr);
+}
+