{
case iDVBFrontend::feSatellite:
{
- hash = sat.frequency & 0xFFFF;
- hash |= sat.orbital_position << 16;
+ hash = (sat.orbital_position << 16);
+ hash |= ((sat.frequency/1000)&0xFFFF)|((sat.polarisation&1) << 15);
return 0;
}
case iDVBFrontend::feCable:
ok = 0;
return;
}
- else
- eDebug("m_secfd is %d", m_secfd);
-
FrontendInfo fe_info;
sprintf(filename, "/dev/dvb/card%d/frontend%d", adap, fe);
#else
for (int i=0; i<entries; ++i)
m_data[i] = -1;
- m_data[7] = !m_fe;
+// m_data[7] = !m_fe;
- eDebug("m_data[7] = %d %d", m_data[7], m_fe);
+// eDebug("m_data[7] = %d %d", m_data[7], m_fe);
return;
}
m_tuning = 0;
}
+int eDVBFrontend::readFrontendData(int type)
+{
+ switch(type)
+ {
+ case bitErrorRate:
+ {
+ uint32_t ber=0;
+ if (ioctl(m_fd, FE_READ_BER, &ber) < 0 && errno != ERANGE)
+ eDebug("FE_READ_BER failed (%m)");
+ return ber;
+ }
+ case signalPower:
+ {
+ uint16_t snr=0;
+ if (ioctl(m_fd, FE_READ_SNR, &snr) < 0 && errno != ERANGE)
+ eDebug("FE_READ_SNR failed (%m)");
+ return snr;
+ }
+ case signalQuality:
+ {
+ uint16_t strength=0;
+ if (ioctl(m_fd, FE_READ_SIGNAL_STRENGTH, &strength) < 0 && errno != ERANGE)
+ eDebug("FE_READ_SIGNAL_STRENGTH failed (%m)");
+ return strength;
+ }
+ }
+ return 0;
+}
+
#ifndef FP_IOCTL_GET_ID
#define FP_IOCTL_GET_ID 0
#endif
int eDVBFrontend::readInputpower()
{
- int power=0;
-// if ( eSystemInfo::getInstance()->canMeasureLNBCurrent() )
+ int power=m_fe; // this is needed for read inputpower from the correct tuner !
+
+ // open front prozessor
+ int fp=::open("/dev/dbox/fp0", O_RDWR);
+ if (fp < 0)
{
-// switch ( eSystemInfo::getInstance()->getHwType() )
- {
-// case eSystemInfo::DM7000:
-// case eSystemInfo::DM7020:
- {
- // open front prozessor
- int fp=::open("/dev/dbox/fp0", O_RDWR);
- if (fp < 0)
- {
- eDebug("couldn't open fp");
- return -1;
- }
- static bool old_fp = (::ioctl(fp, FP_IOCTL_GET_ID) < 0);
- if ( ioctl( fp, old_fp ? 9 : 0x100, &power ) < 0 )
- {
- eDebug("FP_IOCTL_GET_LNB_CURRENT failed (%m)");
- return -1;
- }
- ::close(fp);
-// break;
- }
-// default:
-// eDebug("Inputpower read for platform %d not yet implemented", eSystemInfo::getInstance()->getHwType());
- }
+ eDebug("couldn't open fp");
+ return -1;
}
+ static bool old_fp = (::ioctl(fp, FP_IOCTL_GET_ID) < 0);
+ if ( ioctl( fp, old_fp ? 9 : 0x100, &power ) < 0 )
+ {
+ eDebug("FP_IOCTL_GET_LNB_CURRENT failed (%m)");
+ return -1;
+ }
+ ::close(fp);
+
return power;
}
break;
case eSecCommand::SET_POWER_LIMITING_MODE:
{
- int fd=::open("/dev/i2c/0", O_RDWR);
+ int fd = m_fe ?
+ ::open("/dev/i2c/1", O_RDWR) :
+ ::open("/dev/i2c/0", O_RDWR);
+
unsigned char data[2];
::ioctl(fd, I2C_SLAVE_FORCE, 0x10 >> 1);
if(::read(fd, data, 1) != 1)
{
if ( num < (int)(sizeof(m_data)/sizeof(int)) )
{
- if ( num == 0 )
- eDebug("(%d) set csw %02x", m_fe, val);
m_data[num] = val;
return 0;
}