activate unicable pin, thx DboxOldie

Origin commit data
------------------
Branch: ni/coolstream
Commit: c8e42e2b61
Author: max_10 <max_10@gmx.de>
Date: 2019-05-03 (Fri, 03 May 2019)

Origin message was:
------------------
- activate unicable pin, thx DboxOldie

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2019-05-03 21:39:42 +02:00
committed by vanhofen
parent beea385c6d
commit 3d8c29f241
7 changed files with 28 additions and 7 deletions

View File

@@ -2748,6 +2748,8 @@ tunersetup.mode Betriebsmodus
tunersetup.power 5V-Versorgung bei DVB-T/T2 Kanälen tunersetup.power 5V-Versorgung bei DVB-T/T2 Kanälen
tunersetup.terr Terrestrisch (DVB-T/T2) tunersetup.terr Terrestrisch (DVB-T/T2)
unicable.lnb Unicable Eingang unicable.lnb Unicable Eingang
unicable.pin Unicable PIN
unicable.pin_hint PIN (1 - 255) für Benutzer Frequenz\n0 bedeutet inaktiv / aus
unicable.qrg Unicable Frequenz unicable.qrg Unicable Frequenz
unicable.scr Unicable SCR unicable.scr Unicable SCR
unit.decimal , unit.decimal ,

View File

@@ -2748,6 +2748,8 @@ tunersetup.mode Operation mode
tunersetup.power 5V supply on DVB-T/T2 channels tunersetup.power 5V supply on DVB-T/T2 channels
tunersetup.terr Terrestrial (DVB-T/T2) tunersetup.terr Terrestrial (DVB-T/T2)
unicable.lnb Unicable Input unicable.lnb Unicable Input
unicable.pin Unicable PIN
unicable.pin_hint PIN (1 - 255) for user frequency\n0 means inactive / off
unicable.qrg Unicable Frequency unicable.qrg Unicable Frequency
unicable.scr Unicable SCR unicable.scr Unicable SCR
unit.decimal . unit.decimal .

View File

@@ -1105,9 +1105,13 @@ int CScanSetup::showUnicableSetup()
frontend_config_t &fe_config = fe->getConfig(); frontend_config_t &fe_config = fe->getConfig();
int unicable_scr = fe_config.uni_scr; int unicable_scr = fe_config.uni_scr;
int unicable_qrg = fe_config.uni_qrg; int unicable_qrg = fe_config.uni_qrg;
int unicable_pin = fe_config.uni_pin;
CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, dmode == DISEQC_UNICABLE ? 7 : 31); CMenuOptionNumberChooser *uniscr = new CMenuOptionNumberChooser(LOCALE_UNICABLE_SCR, &unicable_scr, true, 0, dmode == DISEQC_UNICABLE ? 7 : 31);
CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, &unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE); CIntInput *uniqrg = new CIntInput(LOCALE_UNICABLE_QRG, &unicable_qrg, 4, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE);
CMenuOptionNumberChooser *unipin = new CMenuOptionNumberChooser(LOCALE_UNICABLE_PIN, &unicable_pin, true, 0, 255, NULL, CRCInput::RC_nokey, NULL, 0, 0, LOCALE_OPTIONS_OFF);
unipin->setNumericInput(true);
unipin->setHint("", LOCALE_UNICABLE_PIN_HINT);
CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width); CMenuWidget *uni_setup = new CMenuWidget(LOCALE_SATSETUP_UNI_SETTINGS, NEUTRINO_ICON_SETTINGS, width);
uni_setup->addIntroItems(); uni_setup->addIntroItems();
@@ -1115,12 +1119,14 @@ int CScanSetup::showUnicableSetup()
uni_setup->addItem(uniscr); uni_setup->addItem(uniscr);
CMenuForwarder *mf = new CMenuDForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg); CMenuForwarder *mf = new CMenuDForwarder(LOCALE_UNICABLE_QRG, true, uniqrg->getValue(), uniqrg);
uni_setup->addItem(mf); uni_setup->addItem(mf);
uni_setup->addItem(unipin);
res = uni_setup->exec(NULL, ""); res = uni_setup->exec(NULL, "");
delete uni_setup; delete uni_setup;
if (res) { if (res) {
fe_config.uni_scr = unicable_scr; fe_config.uni_scr = unicable_scr;
fe_config.uni_qrg = unicable_qrg; fe_config.uni_qrg = unicable_qrg;
printf("%s: scr: %d qrg: %d\n", __func__, unicable_scr, unicable_qrg); fe_config.uni_pin = unicable_pin;
printf("%s: scr: %d qrg: %d pin: %d\n", __func__, unicable_scr, unicable_qrg, unicable_pin);
} }
return res; return res;
} }

View File

@@ -2775,6 +2775,8 @@ typedef enum
LOCALE_TUNERSETUP_POWER, LOCALE_TUNERSETUP_POWER,
LOCALE_TUNERSETUP_TERR, LOCALE_TUNERSETUP_TERR,
LOCALE_UNICABLE_LNB, LOCALE_UNICABLE_LNB,
LOCALE_UNICABLE_PIN,
LOCALE_UNICABLE_PIN_HINT,
LOCALE_UNICABLE_QRG, LOCALE_UNICABLE_QRG,
LOCALE_UNICABLE_SCR, LOCALE_UNICABLE_SCR,
LOCALE_UNIT_DECIMAL, LOCALE_UNIT_DECIMAL,

View File

@@ -2775,6 +2775,8 @@ const char * locale_real_names[] =
"tunersetup.power", "tunersetup.power",
"tunersetup.terr", "tunersetup.terr",
"unicable.lnb", "unicable.lnb",
"unicable.pin",
"unicable.pin_hint",
"unicable.qrg", "unicable.qrg",
"unicable.scr", "unicable.scr",
"unit.decimal", "unit.decimal",

View File

@@ -250,7 +250,7 @@ bool CFEManager::loadSettings()
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_scr = getConfigValue(fe, "uni_scr", 0);
fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0); fe_config.uni_qrg = getConfigValue(fe, "uni_qrg", 0);
fe_config.uni_pin = getConfigValue(fe, "uni_pin", -1); fe_config.uni_pin = getConfigValue(fe, "uni_pin", 0);
fe_config.diseqc_order = getConfigValue(fe, "diseqc_order", UNCOMMITED_FIRST); fe_config.diseqc_order = getConfigValue(fe, "diseqc_order", UNCOMMITED_FIRST);
fe_config.use_usals = getConfigValue(fe, "use_usals", 0); fe_config.use_usals = getConfigValue(fe, "use_usals", 0);
fe_config.rotor_swap = getConfigValue(fe, "rotor_swap", 0); fe_config.rotor_swap = getConfigValue(fe, "rotor_swap", 0);

View File

@@ -1705,7 +1705,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
WARN("ooops. t > 1024? (%d)", t); WARN("ooops. t > 1024? (%d)", t);
return 0; return 0;
} }
if (pin >= 0 && pin < 0x100) { if (pin > 0 && pin < 0x100) {
cmd.msg[2] = 0x5c; cmd.msg[2] = 0x5c;
cmd.msg[5] = config.uni_pin; cmd.msg[5] = config.uni_pin;
cmd.msg_len = 6; cmd.msg_len = 6;
@@ -1716,7 +1716,7 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
if (!slave && info.type == FE_QPSK) { if (!slave && info.type == FE_QPSK) {
cmd.msg[3] = (config.uni_scr << 5); /* adress */ cmd.msg[3] = (config.uni_scr << 5); /* adress */
if (bank < 2) { /* bank = 0/1 => tune, bank = 2 => standby */ if (bank < 2) { /* bank = 0/1 => tune, bank = 2 => standby */
cmd.msg[3] |= (t >> 8) | /* highest 3 bits of t */ cmd.msg[3] |= (t >> 8) | /* highest 2 bits of t */
(bank << 4) | /* input 0/1 */ (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 */
@@ -1733,20 +1733,27 @@ uint32_t CFrontend::sendEN50494TuningCommand(const uint32_t frequency, const int
uint32_t CFrontend::sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank) uint32_t CFrontend::sendEN50607TuningCommand(const uint32_t frequency, const int high_band, const int horizontal, const int bank)
{ {
uint32_t bpf = config.uni_qrg; uint32_t bpf = config.uni_qrg;
int pin = config.uni_pin;
struct dvb_diseqc_master_cmd cmd = { {0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, 4 }; struct dvb_diseqc_master_cmd cmd = { {0x70, 0x00, 0x00, 0x00, 0x00, 0x00}, 4 };
if (pin > 0 && pin < 0x100) {
cmd.msg[0] = 0x71;
cmd.msg[4] = config.uni_pin;
cmd.msg_len = 5;
}
unsigned int t = frequency / 1000 - 100; unsigned int t = frequency / 1000 - 100;
if (t < 0x800 && config.uni_scr >= 0 && config.uni_scr < 32) if (t < 0x800 && config.uni_scr >= 0 && config.uni_scr < 32)
{ {
uint32_t ret = bpf * 1000; uint32_t ret = bpf * 1000;
INFO("[unicable-JESS] 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); INFO("[unicable-JESS] 18V=%d TONE=%d, freq=%d qrg=%d scr=%d bank=%d pin=%d ret=%d", currentVoltage == SEC_VOLTAGE_18, currentToneMode == SEC_TONE_ON, frequency, bpf, config.uni_scr, bank, pin, ret);
if (!slave && info.type == FE_QPSK) if (!slave && info.type == FE_QPSK)
{ {
cmd.msg[1] = ((config.uni_scr & 0x1F) << 3) | /* user band adress ( 0 to 31) */ cmd.msg[1] = ((config.uni_scr & 0x1F) << 3) | /* user band adress ( 0 to 31) */
/* max. possible tuning word = 0x7FF */ /* max. possible tuning word = 0x7FF */
((t >> 8) & 0x07); /* highest 3 bits of t (MSB) */ ((t >> 8) & 0x07); /* highest 3 bits of t (MSB) */
cmd.msg[2] = t & 0xFF; /* tuning word (LSB) */ cmd.msg[2] = t & 0xFF; /* tuning word (LSB) */
cmd.msg[3] = (0 << 4) | /* no uncommited switch */ cmd.msg[3] = (0 << 4) | /* no commited switch */
/* I really don't know if the combines of option and position bits are right here, /* I really don't know if the combines of option and position bits are right here,
because I can'test it, assuming here 4 sat positions */ because I can'test it, assuming here 4 sat positions */
((bank & 0x03) << 2) | /* input 0/1/2/3 */ ((bank & 0x03) << 2) | /* input 0/1/2/3 */
@@ -1755,7 +1762,7 @@ uint32_t CFrontend::sendEN50607TuningCommand(const uint32_t frequency, const int
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18); fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_18);
usleep(20 * 1000); /* en50494 says: >4ms and < 22 ms */ usleep(20 * 1000); /* en50494 says: >4ms and < 22 ms */
sendDiseqcCommand(&cmd, 80); /* en50494 says: >2ms and < 60 ms */ sendDiseqcCommand(&cmd, 80); /* en50494 says: >2ms and < 60 ms */
fop(ioctl, FE_SET_VOLTAGE, SEC_VOLTAGE_13); fop(ioctl, FE_SET_VOLTAGE, unicable_lowvolt);
} }
return ret; return ret;
} }