-static void checkLinkedParams(int direction, int &linked_ptr, int &ret, const eDVBFrontendParametersSatellite &sat, int csw, int ucsw, int toneburst, bool diseqc, bool rotor, int RotorPos)
+static void checkLinkedParams(int direction, long &linked_ptr, int &ret, const eDVBFrontendParametersSatellite &sat, int csw, int ucsw, int toneburst, bool diseqc, bool rotor, int RotorPos)
}
int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite &sat, iDVBFrontend *fe, int slot_id )
}
int eDVBSatelliteEquipmentControl::canTune(const eDVBFrontendParametersSatellite &sat, iDVBFrontend *fe, int slot_id )
{
int begin = turn_speed >> 16; // high word is start time
int end = turn_speed&0xFFFF; // low word is end time
{
int begin = turn_speed >> 16; // high word is start time
int end = turn_speed&0xFFFF; // low word is end time
tm nowTime;
localtime_r(&now_time, &nowTime);
int now = (nowTime.tm_hour + 1) * 60 + nowTime.tm_min + 1;
tm nowTime;
localtime_r(&now_time, &nowTime);
int now = (nowTime.tm_hour + 1) * 60 + nowTime.tm_min + 1;
-RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int slot_id)
+RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPARAMETERS &parm, const eDVBFrontendParametersSatellite &sat, int slot_id, unsigned int tunetimeout)
bool doSetFrontend = true;
bool doSetVoltageToneFrontend = m_not_linked_slot_mask & slot_id;
bool allowDiseqc1_2 = true;
bool doSetFrontend = true;
bool doSetVoltageToneFrontend = m_not_linked_slot_mask & slot_id;
bool allowDiseqc1_2 = true;
voltage = iDVBFrontend::voltageOff,
tone = iDVBFrontend::toneOff,
csw = di_param.m_committed_cmd,
voltage = iDVBFrontend::voltageOff,
tone = iDVBFrontend::toneOff,
csw = di_param.m_committed_cmd,
- eDebug("RotorCmd %02x, lastRotorCmd %02x", RotorCmd, lastRotorCmd);
+ eDebug("RotorCmd %02x, lastRotorCmd %02lx", RotorCmd, lastRotorCmd);
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
eDVBDiseqcCommand diseqc;
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
eDVBDiseqcCommand diseqc;
if ( rotor_param.m_inputpower_parameters.m_use )
{ // use measure rotor input power to detect rotor state
if ( rotor_param.m_inputpower_parameters.m_use )
{ // use measure rotor input power to detect rotor state
sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) ); // check if rotor has started
sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout .. we assume now the rotor is already at the correct position
sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // goto loop start
sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) ); // check if rotor has started
sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout .. we assume now the rotor is already at the correct position
sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // goto loop start
sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, m_params[MOTOR_RUNNING_TIMEOUT]*20) ); // 2 minutes running timeout
// rotor running loop
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // wait 50msec
sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
cmd.direction=0; // check for stopped rotor
sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, m_params[MOTOR_RUNNING_TIMEOUT]*20) ); // 2 minutes running timeout
// rotor running loop
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // wait 50msec
sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
cmd.direction=0; // check for stopped rotor
sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // running loop start
/////////////////////
sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // running loop start
/////////////////////
sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) );
}
frontend.setSecSequence(sec_sequence);
sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND) );
}
frontend.setSecSequence(sec_sequence);
//reset some tuner configuration
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
{
//reset some tuner configuration
for (eSmartPtrList<eDVBRegisteredFrontend>::iterator it(m_avail_frontends.begin()); it != m_avail_frontends.end(); ++it)
{
if (!strcmp(it->m_frontend->getDescription(), "BCM4501 (internal)") && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1)
{
FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
if (!strcmp(it->m_frontend->getDescription(), "BCM4501 (internal)") && !it->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp) && tmp != -1)
{
FILE *f=fopen("/proc/stb/tsmux/lnb_b_input", "w");
p1->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
if (tmp != -1)
p1 = (eDVBRegisteredFrontend*)tmp;
p1->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
if (tmp != -1)
p1 = (eDVBRegisteredFrontend*)tmp;
p2->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
if (tmp != -1)
p2 = (eDVBRegisteredFrontend*)tmp;
p2->m_frontend->getData(eDVBFrontend::LINKED_PREV_PTR, tmp);
if (tmp != -1)
p2 = (eDVBRegisteredFrontend*)tmp;
// check for rotor dependency
p1->m_frontend->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, tmp1);
if (tmp1 != -1)
// check for rotor dependency
p1->m_frontend->getData(eDVBFrontend::SATPOS_DEPENDS_PTR, tmp1);
if (tmp1 != -1)
- p1->m_frontend->setData(eDVBFrontend::LINKED_PREV_PTR, (int)p2);
- p2->m_frontend->setData(eDVBFrontend::LINKED_NEXT_PTR, (int)p1);
+ 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 (!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");
- p1->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (int)p2);
- p2->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (int)p1);
+ p1->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (long)p2);
+ p2->m_frontend->setData(eDVBFrontend::SATPOS_DEPENDS_PTR, (long)p1);