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
RESULT setSecSequence(const eSecCommandList &list);
RESULT getData(int num, int &data);
RESULT setData(int num, int val);
-
+
+ int readFrontendData(int type); // bitErrorRate, signalPower, signalQuality
+
int isCompatibleWith(ePtr<iDVBFrontendParameters> &feparm);
int getID() { return m_fe; }
virtual RESULT sendToneburst(int burst)=0;
virtual RESULT setSEC(iDVBSatelliteEquipmentControl *sec)=0;
virtual RESULT setSecSequence(const eSecCommandList &list)=0;
+
+ enum {
+ bitErrorRate, signalPower, signalQuality
+ };
+ virtual int readFrontendData(int type)=0;
+
virtual RESULT getData(int num, int &data)=0;
virtual RESULT setData(int num, int val)=0;
TEMPLATE_TYPEDEF(ePtr<iServiceInformation>, iServiceInformationPtr);
+class iFrontendStatusInformation: public iObject
+{
+public:
+ enum {
+ bitErrorRate,
+ signalPower,
+ signalQuality
+ };
+ virtual int getFrontendInfo(int w)=0;
+};
+
+TEMPLATE_TYPEDEF(ePtr<iFrontendStatusInformation>, iFrontendStatusInformationPtr);
+
class iPauseableService: public iObject
{
public:
virtual SWIG_VOID(RESULT) pause(ePtr<iPauseableService> &SWIG_OUTPUT)=0;
virtual SWIG_VOID(RESULT) info(ePtr<iServiceInformation> &SWIG_OUTPUT)=0;
virtual SWIG_VOID(RESULT) audioTracks(ePtr<iAudioTrackSelection> &SWIG_OUTPUT)=0;
+ virtual SWIG_VOID(RESULT) frontendStatusInfo(ePtr<iFrontendStatusInformation> &SWIG_OUTPUT)=0;
};
TEMPLATE_TYPEDEF(ePtr<iPlayableService>, iPlayableServicePtr);
return pvr_channel->getCurrentPosition(demux, pos);
}
+RESULT eDVBServicePlay::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr)
+{
+ ptr = this;
+ return 0;
+}
+
RESULT eDVBServicePlay::info(ePtr<iServiceInformation> &ptr)
{
ptr = this;
return 0;
}
+int eDVBServicePlay::getFrontendInfo(int w)
+{
+ eUsePtr<iDVBChannel> channel;
+ if(m_service_handler.getChannel(channel))
+ return 0;
+ ePtr<iDVBFrontend> fe;
+ if(channel->getFrontend(fe))
+ return 0;
+ return fe->readFrontendData(w);
+}
+
DEFINE_REF(eDVBServicePlay)
eAutoInitPtr<eServiceFactoryDVB> init_eServiceFactoryDVB(eAutoInitNumbers::service+1, "eServiceFactoryDVB");
class eDVBServicePlay: public iPlayableService, public iPauseableService,
public iSeekableService, public Object, public iServiceInformation,
- public iAudioTrackSelection
+ public iAudioTrackSelection, public iFrontendStatusInformation
{
DECLARE_REF(eDVBServicePlay);
public:
RESULT pause(ePtr<iPauseableService> &ptr);
RESULT info(ePtr<iServiceInformation> &ptr);
RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr);
+ RESULT frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr);
// iPauseableService
RESULT pause();
RESULT selectTrack(unsigned int i);
RESULT getTrackInfo(struct iAudioTrackInfo &, unsigned int n);
+ // iFrontendStatusInformation
+ int getFrontendInfo(int w);
+
private:
friend class eServiceFactoryDVB;
eServiceReference m_reference;
RESULT eServiceMP3::pause(ePtr<iPauseableService> &ptr) { ptr=this; return 0; }
RESULT eServiceMP3::seek(ePtr<iSeekableService> &ptr) { ptr = 0; return -1; }
+RESULT eServiceMP3::frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr) { ptr = 0; return -1; }
RESULT eServiceMP3::audioTracks(ePtr<iAudioTrackSelection> &ptr) { ptr = 0; return -1; };
// iPausableService
RESULT pause(ePtr<iPauseableService> &ptr);
RESULT seek(ePtr<iSeekableService> &ptr);
RESULT audioTracks(ePtr<iAudioTrackSelection> &ptr);
+ RESULT frontendStatusInfo(ePtr<iFrontendStatusInformation> &ptr);
// iPausableService
RESULT pause();