neutrino: update unicable code

* add an own diseqc type for unicable
* do not configure scr / freq per satellite but only per frontend
* use the diseqc setting of the satellite for determining input 0/1


Origin commit data
------------------
Branch: ni/coolstream
Commit: e1c7f95d63
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-12-31 (Mon, 31 Dec 2012)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-12-31 22:12:52 +01:00
parent 451901ebaa
commit 013b9ea4e7
14 changed files with 121 additions and 74 deletions

View File

@@ -1569,6 +1569,8 @@ satsetup.satellite Satellit
satsetup.select_sat Auswahl Satellit satsetup.select_sat Auswahl Satellit
satsetup.smatvremote SMATV Remote Tuning satsetup.smatvremote SMATV Remote Tuning
satsetup.uncomm_input Uncommitted satsetup.uncomm_input Uncommitted
satsetup.uni_settings Unicable Einstellungen
satsetup.unicable Unicable
satsetup.usals_repeat USALS wiederholen satsetup.usals_repeat USALS wiederholen
satsetup.use_bat Benutze BAT satsetup.use_bat Benutze BAT
satsetup.use_fta_flag nur FTA Kanäle satsetup.use_fta_flag nur FTA Kanäle

View File

@@ -1569,6 +1569,8 @@ satsetup.satellite Satellite
satsetup.select_sat Select satellites satsetup.select_sat Select satellites
satsetup.smatvremote SMATV Remote Tuning satsetup.smatvremote SMATV Remote Tuning
satsetup.uncomm_input Uncommited input satsetup.uncomm_input Uncommited input
satsetup.uni_settings Unicable Settings
satsetup.unicable Unicable
satsetup.usals_repeat USALS command repeat satsetup.usals_repeat USALS command repeat
satsetup.use_bat Use BAT satsetup.use_bat Use BAT
satsetup.use_fta_flag just free Channels satsetup.use_fta_flag just free Channels

View File

@@ -97,7 +97,8 @@ const CMenuOptionChooser::keyval SATSETUP_DISEQC_OPTIONS[SATSETUP_DISEQC_OPTION_
{ DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 }, { DISEQC_1_1, LOCALE_SATSETUP_DISEQC11 },
/*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/ /*{ DISEQC_1_2, LOCALE_SATSETUP_DISEQC12 },*/
{ DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED }, { DISEQC_ADVANCED, LOCALE_SATSETUP_DISEQC_ADVANCED },
{ SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE } { DISEQC_UNICABLE, LOCALE_SATSETUP_UNICABLE }
// { SMATV_REMOTE_TUNING, LOCALE_SATSETUP_SMATVREMOTE }
}; };
#define SATSETUP_SCANTP_FEC_COUNT 21 #define SATSETUP_SCANTP_FEC_COUNT 21
@@ -281,6 +282,10 @@ int CScanSetup::exec(CMenuTarget* parent, const std::string &actionKey)
{ {
return showScanMenuLnbSetup(); return showScanMenuLnbSetup();
} }
else if(actionKey=="unisetup")
{
return showUnicableSetup();
}
else if(actionKey=="satfind") else if(actionKey=="satfind")
{ {
return showScanMenuSatFind(); return showScanMenuSatFind();
@@ -568,7 +573,7 @@ int CScanSetup::showFrontendSetup(int number)
mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE); mc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCTYPE);
setupMenu->addItem(mc); setupMenu->addItem(mc);
ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), 0, 2, NULL); ojDiseqcRepeats = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQCREPEAT, (int *)&fe_config.diseqcRepeats, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED) && (dmode != DISEQC_UNICABLE), 0, 2, NULL);
ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT); ojDiseqcRepeats->setHint("", LOCALE_MENU_HINT_SCAN_DISEQCREPEAT);
setupMenu->addItem(ojDiseqcRepeats); setupMenu->addItem(ojDiseqcRepeats);
@@ -592,6 +597,9 @@ int CScanSetup::showFrontendSetup(int number)
fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP); fsatSetup->setHint("", LOCALE_MENU_HINT_SCAN_SATSETUP);
setupMenu->addItem(fsatSetup); setupMenu->addItem(fsatSetup);
uniSetup = new CMenuForwarder(LOCALE_SATSETUP_UNI_SETTINGS, (dmode == DISEQC_UNICABLE), NULL, this, "unisetup", CRCInput::convertDigitToKey(shortcut++));
setupMenu->addItem(uniSetup);
setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR)); setupMenu->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SATSETUP_EXTENDED_MOTOR));
CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL); CMenuOptionNumberChooser * nc = new CMenuOptionNumberChooser(LOCALE_EXTRA_ZAPIT_MOTOR_SPEED, (int *)&fe_config.motorRotationSpeed, true, 0, 64, NULL);
nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED); nc->setHint("", LOCALE_MENU_HINT_SCAN_MOTOR_SPEED);
@@ -619,6 +627,35 @@ int CScanSetup::showFrontendSetup(int number)
return res; return res;
} }
int CScanSetup::showUnicableSetup()
{
printf("[neutrino] CScanSetup call %s fe %d\n", __func__, fenumber);
int res = menu_return::RETURN_REPAINT;
CFrontend *fe = CFEManager::getInstance()->getFE(fenumber);
frontend_config_t &fe_config = fe->getConfig();
int unicable_scr = fe_config.uni_scr;
int unicable_qrg = fe_config.uni_qrg;
CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, 7);
CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
uni_setup->addIntroItems();
uni_setup->addItem(uniscr);
CMenuForwarder *mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg);
uni_setup->addItem(mf);
res = uni_setup->exec(NULL, "");
delete uni_setup;
if (res) {
fe_config.uni_scr = unicable_scr;
fe_config.uni_qrg = unicable_qrg;
printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg);
}
return res;
}
int CScanSetup::showScanMenuLnbSetup() int CScanSetup::showScanMenuLnbSetup()
{ {
printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber); printf("[neutrino] CScanSetup call %s fe %d\n", __FUNCTION__, fenumber);
@@ -795,21 +832,33 @@ int CScanSetup::showScanMenuSatFind()
//init tempsat menu //init tempsat menu
void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig) void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satconfig)
{ {
bool unicable = (dmode == DISEQC_UNICABLE);
temp_sat->addIntroItems(); temp_sat->addIntroItems();
CMenuOptionNumberChooser *diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, ((dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED)), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); CMenuOptionNumberChooser *diseqc;
diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC); CMenuOptionNumberChooser *comm;
CMenuOptionNumberChooser *comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); CMenuOptionNumberChooser *uncomm;
comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED); CMenuOptionNumberChooser *unilnb;
CMenuOptionNumberChooser *uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF); CMenuOptionNumberChooser *motor;
uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED); CMenuOptionChooser *usals;
CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &satconfig.unicable_scr, true, -1, 7, NULL, 0, -1, LOCALE_OPTIONS_OFF); CMenuForwarder *mf;
CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, (int&) satconfig.unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
CMenuOptionNumberChooser *unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.unicable_lnb, true, 0, 1); if (!unicable) {
CMenuOptionNumberChooser *motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF); diseqc = new CMenuOptionNumberChooser(LOCALE_SATSETUP_DISEQC_INPUT, &satconfig.diseqc, (dmode != NO_DISEQC) && (dmode != DISEQC_ADVANCED), -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS); diseqc->setHint("", LOCALE_MENU_HINT_SCAN_DISEQC);
CMenuOptionChooser *usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/); comm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_COMM_INPUT, &satconfig.commited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS); comm->setHint("", LOCALE_MENU_HINT_SCAN_COMMITED);
uncomm = new CMenuOptionNumberChooser(LOCALE_SATSETUP_UNCOMM_INPUT, &satconfig.uncommited, dmode == DISEQC_ADVANCED, -1, 15, NULL, 1, -1, LOCALE_OPTIONS_OFF);
uncomm->setHint("", LOCALE_MENU_HINT_SCAN_UNCOMMITED);
motor = new CMenuOptionNumberChooser(LOCALE_SATSETUP_MOTOR_POS, &satconfig.motor_position, true /*dmode == DISEQC_ADVANCED*/, 0, 64, NULL, 0, 0, LOCALE_OPTIONS_OFF);
motor->setHint("", LOCALE_MENU_HINT_SCAN_MOTORPOS);
usals = new CMenuOptionChooser(LOCALE_EXTRA_USE_GOTOXX, &satconfig.use_usals, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true /*dmode == DISEQC_ADVANCED*/);
usals->setHint("", LOCALE_MENU_HINT_SCAN_USEUSALS);
} else {
if (satconfig.diseqc < 0)
satconfig.diseqc = 0;
unilnb = new CMenuOptionNumberChooser(LOCALE_UNICABLE_LNB, &satconfig.diseqc, true, 0, 1);
}
if(!satconfig.use_usals) if(!satconfig.use_usals)
all_usals = 0; all_usals = 0;
@@ -818,15 +867,15 @@ void CScanSetup::addScanMenuTempSat(CMenuWidget *temp_sat, sat_config_t & satcon
CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput* lofH = new CIntInput(LOCALE_SATSETUP_LOFH, (int&) satconfig.lnbOffsetHigh, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput* lofS = new CIntInput(LOCALE_SATSETUP_LOFS, (int&) satconfig.lnbSwitch, 5, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
temp_sat->addItem(diseqc); if (!unicable) {
temp_sat->addItem(comm); temp_sat->addItem(diseqc);
temp_sat->addItem(uncomm); temp_sat->addItem(comm);
temp_sat->addItem(uniscr); temp_sat->addItem(uncomm);
CMenuForwarder * mf = new CMenuForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); temp_sat->addItem(motor);
temp_sat->addItem(mf); temp_sat->addItem(usals);
temp_sat->addItem(unilnb); } else {
temp_sat->addItem(motor); temp_sat->addItem(unilnb);
temp_sat->addItem(usals); }
mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL); mf = new CMenuDForwarder(LOCALE_SATSETUP_LOFL, true, lofL->getValue(), lofL);
mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL); mf->setHint("", LOCALE_MENU_HINT_SCAN_LOFL);
@@ -1140,7 +1189,8 @@ bool CScanSetup::changeNotify(const neutrino_locale_t OptionName, void * /*data*
printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode); printf("[neutrino] CScanSetup::%s: diseqc %d \n", __FUNCTION__, dmode);
//FIXME 2 frontends ?? //FIXME 2 frontends ??
fautoScanAll->setActive(dmode != NO_DISEQC); fautoScanAll->setActive(dmode != NO_DISEQC);
if(dmode == NO_DISEQC) { uniSetup->setActive(dmode == DISEQC_UNICABLE);
if (dmode == NO_DISEQC || dmode == DISEQC_UNICABLE) {
ojDiseqcRepeats->setActive(false); ojDiseqcRepeats->setActive(false);
} }
else if(dmode < DISEQC_ADVANCED) { else if(dmode < DISEQC_ADVANCED) {

View File

@@ -57,6 +57,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
CMenuForwarder *fautoScanAll; CMenuForwarder *fautoScanAll;
CMenuForwarder *frontendSetup; CMenuForwarder *frontendSetup;
CMenuForwarder *fsatSetup; CMenuForwarder *fsatSetup;
CMenuForwarder *uniSetup;
CMenuOptionNumberChooser * ojDiseqcRepeats; CMenuOptionNumberChooser * ojDiseqcRepeats;
CIntInput * nid; CIntInput * nid;
CMenuOptionChooser * lcnhd; CMenuOptionChooser * lcnhd;
@@ -84,6 +85,7 @@ class CScanSetup : public CMenuTarget, public CChangeObserver
int showFrontendSetup(int number); int showFrontendSetup(int number);
int showScanMenuLnbSetup(); int showScanMenuLnbSetup();
int showUnicableSetup();
int showScanMenuSatFind(); int showScanMenuSatFind();
void fillSatSelect(CMenuOptionStringChooser *select); void fillSatSelect(CMenuOptionStringChooser *select);
void fillCableSelect(CMenuOptionStringChooser *select); void fillCableSelect(CMenuOptionStringChooser *select);

View File

@@ -1596,6 +1596,8 @@ typedef enum
LOCALE_SATSETUP_SELECT_SAT, LOCALE_SATSETUP_SELECT_SAT,
LOCALE_SATSETUP_SMATVREMOTE, LOCALE_SATSETUP_SMATVREMOTE,
LOCALE_SATSETUP_UNCOMM_INPUT, LOCALE_SATSETUP_UNCOMM_INPUT,
LOCALE_SATSETUP_UNI_SETTINGS,
LOCALE_SATSETUP_UNICABLE,
LOCALE_SATSETUP_USALS_REPEAT, LOCALE_SATSETUP_USALS_REPEAT,
LOCALE_SATSETUP_USE_BAT, LOCALE_SATSETUP_USE_BAT,
LOCALE_SATSETUP_USE_FTA_FLAG, LOCALE_SATSETUP_USE_FTA_FLAG,

View File

@@ -1596,6 +1596,8 @@ const char * locale_real_names[] =
"satsetup.select_sat", "satsetup.select_sat",
"satsetup.smatvremote", "satsetup.smatvremote",
"satsetup.uncomm_input", "satsetup.uncomm_input",
"satsetup.uni_settings",
"satsetup.unicable",
"satsetup.usals_repeat", "satsetup.usals_repeat",
"satsetup.use_bat", "satsetup.use_bat",
"satsetup.use_fta_flag", "satsetup.use_fta_flag",

View File

@@ -39,7 +39,8 @@ typedef enum {
DISEQC_1_0, DISEQC_1_0,
DISEQC_1_1, DISEQC_1_1,
DISEQC_1_2, DISEQC_1_2,
DISEQC_ADVANCED DISEQC_ADVANCED,
DISEQC_UNICABLE
#if 0 #if 0
, DISEQC_2_0, , DISEQC_2_0,
DISEQC_2_1, DISEQC_2_1,

View File

@@ -156,7 +156,6 @@ class CFrontend
uint8_t getDiseqcPosition(void) const { return currentTransponder.diseqc; } uint8_t getDiseqcPosition(void) const { return currentTransponder.diseqc; }
uint8_t getDiseqcRepeats(void) const { return config.diseqcRepeats; } uint8_t getDiseqcRepeats(void) const { return config.diseqcRepeats; }
diseqc_t getDiseqcType(void) const { return (diseqc_t) config.diseqcType; } diseqc_t getDiseqcType(void) const { return (diseqc_t) config.diseqcType; }
int getUniSCR(void) const { return config.uni_scr; }
uint32_t getFrequency(void) const { return currentTransponder.feparams.dvb_feparams.frequency; } uint32_t getFrequency(void) const { return currentTransponder.feparams.dvb_feparams.frequency; }
bool getHighBand() { return (int) getFrequency() >= lnbSwitch; } bool getHighBand() { return (int) getFrequency() >= lnbSwitch; }
static fe_modulation_t getModulation(const uint8_t modulation); static fe_modulation_t getModulation(const uint8_t modulation);

View File

@@ -36,9 +36,6 @@ typedef struct sat_config {
std::string name; std::string name;
int have_channels; int have_channels;
int input; int input;
int unicable_scr;
int unicable_qrg;
int unicable_lnb;
int configured; int configured;
int cable_nid; int cable_nid;
} sat_config_t; } sat_config_t;

View File

@@ -115,7 +115,7 @@ void CFEManager::setConfigValue(CFrontend * fe, const char * name, uint32_t val)
configfile.setInt32(cfg_key, val); configfile.setInt32(cfg_key, val);
} }
#define SATCONFIG_SIZE 15 #define SATCONFIG_SIZE 12
void CFEManager::setSatelliteConfig(CFrontend * fe, sat_config_t &satconfig) void CFEManager::setSatelliteConfig(CFrontend * fe, sat_config_t &satconfig)
{ {
char cfg_key[81]; char cfg_key[81];
@@ -133,9 +133,6 @@ void CFEManager::setSatelliteConfig(CFrontend * fe, sat_config_t &satconfig)
satConfig.push_back(satconfig.use_in_scan); satConfig.push_back(satconfig.use_in_scan);
satConfig.push_back(satconfig.use_usals); satConfig.push_back(satconfig.use_usals);
satConfig.push_back(satconfig.configured); satConfig.push_back(satconfig.configured);
satConfig.push_back(satconfig.unicable_scr);
satConfig.push_back(satconfig.unicable_qrg);
satConfig.push_back(satconfig.unicable_lnb);
sprintf(cfg_key, "fe%d_position_%d", fe->fenumber, satconfig.position); sprintf(cfg_key, "fe%d_position_%d", fe->fenumber, satconfig.position);
//INFO("set %s", cfg_key); //INFO("set %s", cfg_key);
@@ -162,10 +159,6 @@ bool CFEManager::getSatelliteConfig(CFrontend * fe, sat_config_t &satconfig)
satconfig.use_in_scan = satConfig[i++]; satconfig.use_in_scan = satConfig[i++];
satconfig.use_usals = satConfig[i++]; satconfig.use_usals = satConfig[i++];
satconfig.configured = satConfig[i++]; satconfig.configured = satConfig[i++];
satconfig.unicable_scr = satConfig[i++];
satconfig.unicable_qrg = satConfig[i++];
satconfig.unicable_lnb = satConfig[i++];
return true; return true;
} }
return false; return false;
@@ -191,6 +184,8 @@ bool CFEManager::loadSettings()
fe_config.diseqcRepeats = getConfigValue(fe, "diseqcRepeats", 0); fe_config.diseqcRepeats = getConfigValue(fe, "diseqcRepeats", 0);
fe_config.motorRotationSpeed = getConfigValue(fe, "motorRotationSpeed", 18); fe_config.motorRotationSpeed = getConfigValue(fe, "motorRotationSpeed", 18);
fe_config.highVoltage = getConfigValue(fe, "highVoltage", 0); fe_config.highVoltage = getConfigValue(fe, "highVoltage", 0);
fe_config.uni_scr = getConfigValue(fe, "uni_scr", 0);
fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0);
fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0)); fe->setRotorSatellitePosition(getConfigValue(fe, "lastSatellitePosition", 0));
@@ -229,9 +224,6 @@ bool CFEManager::loadSettings()
satconfig.use_usals = 0; satconfig.use_usals = 0;
satconfig.input = 0; satconfig.input = 0;
satconfig.configured = 0; satconfig.configured = 0;
satconfig.unicable_scr = -1;
satconfig.unicable_qrg = 0;
satconfig.unicable_lnb = 0;
satmap.insert(satellite_pair_t(position, satconfig)); satmap.insert(satellite_pair_t(position, satconfig));
@@ -262,6 +254,8 @@ void CFEManager::saveSettings(bool write)
setConfigValue(fe, "diseqcRepeats", fe_config.diseqcRepeats); setConfigValue(fe, "diseqcRepeats", fe_config.diseqcRepeats);
setConfigValue(fe, "motorRotationSpeed", fe_config.motorRotationSpeed); setConfigValue(fe, "motorRotationSpeed", fe_config.motorRotationSpeed);
setConfigValue(fe, "highVoltage", fe_config.highVoltage); setConfigValue(fe, "highVoltage", fe_config.highVoltage);
setConfigValue(fe, "uni_scr", fe_config.uni_scr);
setConfigValue(fe, "uni_qrg", fe_config.uni_qrg);
setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition()); setConfigValue(fe, "lastSatellitePosition", fe->getRotorSatellitePosition());
std::vector<int> satList; std::vector<int> satList;

View File

@@ -192,7 +192,7 @@ CFrontend::CFrontend(int Number, int Adapter)
config.diseqcType = NO_DISEQC; config.diseqcType = NO_DISEQC;
config.diseqcRepeats = 0; config.diseqcRepeats = 0;
config.uni_scr = -1; /* the unicable SCR address, -1 == no unicable */ config.uni_scr = 0; /* the unicable SCR address 0-7 */
config.uni_qrg = 0; /* the unicable frequency in MHz */ config.uni_qrg = 0; /* the unicable frequency in MHz */
config.uni_lnb = 0; /* for two-position switches */ config.uni_lnb = 0; /* for two-position switches */
config.highVoltage = false; config.highVoltage = false;
@@ -788,11 +788,11 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
} }
if (config.uni_scr >= 0) if (config.diseqcType == DISEQC_UNICABLE)
cmdseq.props[FREQUENCY].u.data = sendEN50494TuningCommand(feparams->dvb_feparams.frequency, cmdseq.props[FREQUENCY].u.data = sendEN50494TuningCommand(feparams->dvb_feparams.frequency,
currentToneMode == SEC_TONE_ON, currentToneMode == SEC_TONE_ON,
currentVoltage == SEC_VOLTAGE_18, currentVoltage == SEC_VOLTAGE_18,
config.uni_lnb); !!config.uni_lnb);
cmdseq.num += nrOfProps; cmdseq.num += nrOfProps;
@@ -860,7 +860,7 @@ void CFrontend::secSetTone(const fe_sec_tone_mode_t toneMode, const uint32_t ms)
if (currentToneMode == toneMode) if (currentToneMode == toneMode)
return; return;
if (config.uni_scr >= 0) { if (config.diseqcType == DISEQC_UNICABLE) {
/* this is too ugly for words. the "currentToneMode" is the only place /* this is too ugly for words. the "currentToneMode" is the only place
where the global "highband" state is saved. So we need to fake it for where the global "highband" state is saved. So we need to fake it for
unicable and still set the tone on... */ unicable and still set the tone on... */
@@ -889,7 +889,7 @@ void CFrontend::secSetVoltage(const fe_sec_voltage_t voltage, const uint32_t ms)
return; return;
printf("[fe%d] voltage %s\n", fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18"); printf("[fe%d] voltage %s\n", fenumber, voltage == SEC_VOLTAGE_OFF ? "OFF" : voltage == SEC_VOLTAGE_13 ? "13" : "18");
if (config.uni_scr >= 0) { if (config.diseqcType == DISEQC_UNICABLE) {
/* see my comment in secSetTone... */ /* see my comment in secSetTone... */
currentVoltage = voltage; /* need to know polarization for unicable */ currentVoltage = voltage; /* need to know polarization for unicable */
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */ fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); /* voltage must not be 18V */
@@ -947,6 +947,9 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force)
case DISEQC_ADVANCED: case DISEQC_ADVANCED:
INFO("fe%d: DISEQC_ADVANCED", fenumber); INFO("fe%d: DISEQC_ADVANCED", fenumber);
break; break;
case DISEQC_UNICABLE:
INFO("fe%d: DISEQC_UNICABLE", fenumber);
break;
#if 0 #if 0
case DISEQC_2_0: case DISEQC_2_0:
INFO("DISEQC_2_0"); INFO("DISEQC_2_0");
@@ -963,7 +966,11 @@ void CFrontend::setDiseqcType(const diseqc_t newDiseqcType, bool force)
return; return;
} }
if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC) if (newDiseqcType == DISEQC_UNICABLE) {
secSetTone(SEC_TONE_OFF, 0);
secSetVoltage(SEC_VOLTAGE_13, 0);
}
else if ((force && (newDiseqcType != NO_DISEQC)) || ((config.diseqcType <= MINI_DISEQC)
&& (newDiseqcType > MINI_DISEQC))) { && (newDiseqcType > MINI_DISEQC))) {
secSetTone(SEC_TONE_OFF, 15); secSetTone(SEC_TONE_OFF, 15);
sendDiseqcPowerOn(); sendDiseqcPowerOn();
@@ -1065,12 +1072,13 @@ void CFrontend::setInput(t_satellite_position satellitePosition, uint32_t freque
{ {
sat_iterator_t sit = satellites.find(satellitePosition); sat_iterator_t sit = satellites.find(satellitePosition);
/* unicable */ /* unicable uses diseqc parameter for input selection */
config.uni_scr = sit->second.unicable_scr; config.uni_lnb = sit->second.diseqc;
config.uni_qrg = sit->second.unicable_qrg;
config.uni_lnb = sit->second.unicable_lnb;
setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch); setLnbOffsets(sit->second.lnbOffsetLow, sit->second.lnbOffsetHigh, sit->second.lnbSwitch);
if (config.diseqcType == DISEQC_UNICABLE)
return;
if (config.diseqcType != DISEQC_ADVANCED) { if (config.diseqcType != DISEQC_ADVANCED) {
setDiseqc(sit->second.diseqc, polarization, frequency); setDiseqc(sit->second.diseqc, polarization, frequency);
return; return;
@@ -1100,11 +1108,12 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350; unsigned int t = (frequency / 1000 + bpf + 2) / 4 - 350;
if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8) if (t < 1024 && config.uni_scr >= 0 && config.uni_scr < 8)
{ {
INFO("[unicable] VOLT18=%d TONE_ON=%d, freq=%d bpf=%d uni_scr=%d bank=%d ret=%d\n", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, (t + 350) * 4000 - frequency); uint32_t ret = (t + 350) * 4000 - frequency;
INFO("[unicable] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, ret);
if (!slave && info.type == FE_QPSK) { if (!slave && info.type == FE_QPSK) {
cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */ cmd.msg[3] = (t >> 8) | /* highest 3 bits of t */
(config.uni_scr << 5) | /* adress */ (config.uni_scr << 5) | /* adress */
(bank << 4) | /* not implemented yet */ (bank << 4) | /* input 0/1 */
(horizontal << 3) | /* horizontal == 0x08 */ (horizontal << 3) | /* horizontal == 0x08 */
(high_band) << 2; /* high_band == 0x04 */ (high_band) << 2; /* high_band == 0x04 */
cmd.msg[4] = t & 0xFF; cmd.msg[4] = t & 0xFF;
@@ -1113,7 +1122,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */ sendDiseqcCommand(&cmd, 50); /* en50494 says: >2ms and < 60 ms */
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13);
} }
return (t + 350) * 4000 - frequency; return ret;
} }
WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr); WARN("ooops. t > 1024? (%d) or uni_scr out of range? (%d)", t, config.uni_scr);
return 0; return 0;

View File

@@ -539,7 +539,6 @@ int CServiceManager::LoadMotorPositions(void)
char buffer[256] = ""; char buffer[256] = "";
t_satellite_position satellitePosition; t_satellite_position satellitePosition;
int spos = 0, mpos = 0, diseqc = 0, uncom = 0, com = 0, usals = 0, inuse, input = 0; int spos = 0, mpos = 0, diseqc = 0, uncom = 0, com = 0, usals = 0, inuse, input = 0;
int uniscr = -1, uniqrg = 0, unilnb = 0;
int offH = 10600, offL = 9750, sw = 11700; int offH = 10600, offL = 9750, sw = 11700;
printf("[getservices] loading motor positions...\n"); printf("[getservices] loading motor positions...\n");
@@ -549,12 +548,7 @@ int CServiceManager::LoadMotorPositions(void)
if ((fd = fopen(SATCONFIG, "r"))) { if ((fd = fopen(SATCONFIG, "r"))) {
fgets(buffer, 255, fd); fgets(buffer, 255, fd);
while(!feof(fd)) { while(!feof(fd)) {
if (sscanf(buffer, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d", sscanf(buffer, "%d %d %d %d %d %d %d %d %d %d %d", &spos, &mpos, &diseqc, &com, &uncom, &offL, &offH, &sw, &inuse, &usals, &input);
&spos, &mpos, &diseqc, &com, &uncom, &offL, &offH,
&sw, &inuse, &usals, &input, &uniscr, &uniqrg, &unilnb) < 14) {
uniqrg = unilnb = 0;
uniscr = -1;
}
int configured = 0; int configured = 0;
if (diseqc != -1 || com != -1 || uncom != -1 || usals != 0 || mpos != 0) if (diseqc != -1 || com != -1 || uncom != -1 || usals != 0 || mpos != 0)
@@ -573,9 +567,6 @@ int CServiceManager::LoadMotorPositions(void)
sit->second.use_usals = usals; sit->second.use_usals = usals;
sit->second.input = input; sit->second.input = input;
sit->second.position = satellitePosition; sit->second.position = satellitePosition;
sit->second.unicable_scr = uniscr;
sit->second.unicable_qrg = uniqrg;
sit->second.unicable_lnb = unilnb;
sit->second.configured = configured; sit->second.configured = configured;
} }
fgets(buffer, 255, fd); fgets(buffer, 255, fd);
@@ -600,12 +591,11 @@ void CServiceManager::SaveMotorPositions()
printf("[zapit] cannot open %s\n", SATCONFIG); printf("[zapit] cannot open %s\n", SATCONFIG);
return; return;
} }
fprintf(fd, "# sat position, stored rotor, diseqc, commited, uncommited, low, high, switch, use in full scan, use usals, input, unicable_scr, unicable_freq, unicable_lnb\n"); fprintf(fd, "# sat position, stored rotor, diseqc, commited, uncommited, low, high, switch, use in full scan, use usals, input\n");
for(sit = satellitePositions.begin(); sit != satellitePositions.end(); ++sit) { for(sit = satellitePositions.begin(); sit != satellitePositions.end(); ++sit) {
fprintf(fd, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", sit->first, sit->second.motor_position, fprintf(fd, "%d %d %d %d %d %d %d %d %d %d %d\n", sit->first, sit->second.motor_position,
sit->second.diseqc, sit->second.commited, sit->second.uncommited, sit->second.lnbOffsetLow, sit->second.diseqc, sit->second.commited, sit->second.uncommited, sit->second.lnbOffsetLow,
sit->second.lnbOffsetHigh, sit->second.lnbSwitch, sit->second.use_in_scan, sit->second.use_usals, sit->second.input, sit->second.lnbOffsetHigh, sit->second.lnbSwitch, sit->second.use_in_scan, sit->second.use_usals, sit->second.input);
sit->second.unicable_scr, sit->second.unicable_qrg, sit->second.unicable_lnb);
} }
fdatasync(fileno(fd)); fdatasync(fileno(fd));
fclose(fd); fclose(fd);
@@ -626,9 +616,6 @@ bool CServiceManager::InitSatPosition(t_satellite_position position, char * name
satellitePositions[position].use_in_scan = 0; satellitePositions[position].use_in_scan = 0;
satellitePositions[position].use_usals = 0; satellitePositions[position].use_usals = 0;
satellitePositions[position].input = 0; satellitePositions[position].input = 0;
satellitePositions[position].unicable_scr = -1;
satellitePositions[position].unicable_qrg = 0;
satellitePositions[position].unicable_lnb = 0;
satellitePositions[position].configured = 0; satellitePositions[position].configured = 0;
satellitePositions[position].cable_nid = 0; satellitePositions[position].cable_nid = 0;
if(name) if(name)

View File

@@ -148,7 +148,7 @@ bool CServiceScan::tuneFrequency(FrontendParameters *feparams, uint8_t polarizat
} }
} }
/* for unicable, retry tuning two times before assuming it failed */ /* for unicable, retry tuning two times before assuming it failed */
int retry = (frontend->getUniSCR() >= 0) * 2 + 1; int retry = (frontend->getDiseqcType() == DISEQC_UNICABLE) * 2 + 1;
do { do {
ret = frontend->tuneFrequency(feparams, polarization, false); ret = frontend->tuneFrequency(feparams, polarization, false);
if (ret) if (ret)

View File

@@ -511,7 +511,7 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay
SaveSettings(false); SaveSettings(false);
/* retry tuning twice when using unicable */ /* retry tuning twice when using unicable */
int retry = (live_fe->getUniSCR() >= 0) * 2; int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2;
again: again:
if(!TuneChannel(live_fe, newchannel, transponder_change)) { if(!TuneChannel(live_fe, newchannel, transponder_change)) {
if (retry < 1) { if (retry < 1) {
@@ -578,7 +578,7 @@ bool CZapit::ZapForRecord(const t_channel_id channel_id)
CZapitChannel* newchannel; CZapitChannel* newchannel;
bool transponder_change; bool transponder_change;
/* retry tuning twice when using unicable */ /* retry tuning twice when using unicable */
int retry = (live_fe->getUniSCR() >= 0) * 2; int retry = (live_fe->getDiseqcType() == DISEQC_UNICABLE) * 2;
if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) { if((newchannel = CServiceManager::getInstance()->FindChannel(channel_id)) == NULL) {
printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id); printf("zapit_to_record: channel_id " PRINTF_CHANNEL_ID_TYPE " not found", channel_id);