Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vdr] displaying the signal level and the snr
- To: vdr@linuxtv.org
- Subject: [vdr] displaying the signal level and the snr
- From: Alessio Sangalli <alesan@manoweb.com>
- Date: Fri, 29 Mar 2002 10:56:46 +0100
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii; format=flowed
- Delivered-To: mhonarc@limes.convergence.de
- Reply-to: vdr@linuxtv.org
- Sender: vdr-bounce@linuxtv.org
- User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020313
Hi, I've made a little modification to VDR to display the signal
strength and the snr on the osd whenever you press ok or you change
channel; it also puts the values in the syslog.
I put this in dvbapi.c:
int cDvbApi::GetSignalStrength()
{
int signalStrength;
ioctl(fd_frontend, FE_READ_SIGNAL_STRENGTH, &signalStrength);
return signalStrength;
}
int cDvbApi::GetSignalNoiseRatio()
{
int snr;
ioctl(fd_frontend, FE_READ_SNR, &snr);
return snr;
}
in dvbapi.h, inside the class cDvbApi as public functions:
public:
int GetSignalStrength();
int GetSignalNoiseRatio();
then, in config.c, inside the cChannel::Switch function:
for (int i = 3; i--;)
{
switch (DvbApi->SetChannel(number, frequency, polarization, diseqc,
srate, vpid, apid1, apid2, dpid1, dpid2, tpid, ca, pnr))
{
case scrOk:
isyslog(LOG_INFO, "Signal Strength: %ddBm, SNR: %ddB.",
DvbApi->GetSignalStrength(), DvbApi->GetSignalNoiseRatio());
return true;
....
and the last modification in menu.c, in the function
cDisplayChannel::DisplayChannel, at the end:
const char *date = DayDateTime();
cDvbApi *DvbApi = cDvbApi::PrimaryDvbApi;
int signalStrength = DvbApi->GetSignalStrength();
float snr = DvbApi->GetSignalNoiseRatio()/1000000;
snprintf(buffer, BufSize, "SS:%ddBm SNR:%2.1fdB %s", signalStrength,
snr, date
);
Interface->Write(-strlen(buffer), 0, buffer);
sorry if I didn't made a patch but:
1) I've never used diff eheheheh
2) I also made other hacks and applied patches (AIO etc etc) so it would
have been confusing (at least for me!)
what do you think?
ciao
as
Home |
Main Index |
Thread Index