openfix-5.4.19-ustym4kpro-20201228 //исправлена функция "Включить 5V для активной антенны" (тюнер DVB-T2), 5 Вольт есть//
С
этим патчем не получилось у меня на
release-7.3Получилось так:
/lib/dvb/frontend.cpp
RESULT eDVBFrontend::setVoltage(int voltage)
{
bool increased=false;
fe_sec_voltage_t vlt;
m_data[CUR_VOLTAGE]=voltage;
switch (voltage)
{
case voltageOff:
m_data[CSW]=m_data[UCSW]=m_data[TONEBURST]=-1; // reset diseqc
vlt = SEC_VOLTAGE_OFF;
+ char filename[256];
+ snprintf(filename, sizeof(filename), "/proc/stb/frontend/%d/active_antenna_power", m_slotid);
+ CFile::writeStr(filename, "off");
break;
case voltage13_5:
increased = true;
case voltage13:
vlt = SEC_VOLTAGE_13;
+ if(m_type == feTerrestrial)
+ {
+ char filename[256];
+ snprintf(filename, sizeof(filename), "/proc/stb/frontend/%d/active_antenna_power", m_slotid);
+ CFile::writeStr(filename, "on");
+ }
break;
case voltage18_5:
increased = true;
case voltage18:
vlt = SEC_VOLTAGE_18;
break;
default:
return -ENODEV;
}
if (m_simulate)
return 0;
eDebug("[eDVBFrontend%d] setVoltage FE_ENABLE_HIGH_LNB_VOLTAGE %d FE_SET_VOLTAGE %d", m_dvbid, increased, vlt);
::ioctl(m_fd, FE_ENABLE_HIGH_LNB_VOLTAGE, increased);
return ::ioctl(m_fd, FE_SET_VOLTAGE, vlt);
}
/lib/base/cfile.cpp
int CFile::writeInt(const char *filename, int value)
{
CFile f(filename, "w");
if (!f)
return -1;
return fprintf(f, "%d", value);
}
+ int CFile::writeStr(const char *filename, std::string value)
+ {
+ CFile f(filename, "w");
+ if (f)
+ fprintf(f, "%s", value.c_str());
+ return 0;
+ }
+
int CFile::write(const char *filename, const char *value)
{
CFile f(filename, "w");
if (!f)
return -1;
return fprintf(f, "%s", value);
}
/lib/base/cfile.h
static int parseInt(int *result, const char *filename);
static int writeIntHex(const char *filename, int value);
static int writeInt(const char *filename, int value);
+ static int writeStr(const char *filename, std::string value);
static int write(const char *filename, const char *value);
static std::string read(const std::string &filename);
static bool contains_word(const std::string &filename, const std::string &word);