aboutsummaryrefslogtreecommitdiffstats
path: root/dvb.c
diff options
context:
space:
mode:
authorreinelt <>2003-07-19 09:42:42 +0000
committerreinelt <>2003-07-19 09:42:42 +0000
commite155ff3a4230d8c934fbbe45c8936218c31b7c40 (patch)
tree0eb9527bc9dab4266905873cbf750180471e62b4 /dvb.c
parent1ad0d29b1e2b54ecbe9f3c5665e65da46906eed4 (diff)
downloadlcd4linux-e155ff3a4230d8c934fbbe45c8936218c31b7c40.tar.gz
[lcd4linux @ 2003-07-19 09:42:42 by reinelt]
check for dvb/frontend.h and disable DVB client if not found.
Diffstat (limited to 'dvb.c')
-rw-r--r--dvb.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/dvb.c b/dvb.c
index be01168..53bf8d7 100644
--- a/dvb.c
+++ b/dvb.c
@@ -41,6 +41,30 @@
#include <time.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+
+#ifndef HAVE_LINUX_DVB_FRONTEND_H
+
+#warning linux/dvb/frontend.h not found.
+#warning DVB client will be disabled.
+
+int DVB (double *strength, double *snr)
+{
+ static int flag=0;
+
+ if (flag==0) {
+ error("lcd4linux has been compiled without DVB support");
+ error("DVB client will be disabled");
+ flag=1;
+ }
+
+ *strength=0.0;
+ *snr=0.0;
+
+ return 0;
+}
+
+#else
+
#include <linux/dvb/frontend.h>
#include "debug.h"
@@ -79,20 +103,21 @@ int DVB (double *strength, double *snr)
fd=-1;
return -1;
}
-
+
if (ioctl(fd, FE_READ_SNR, &raw_snr)) {
error("ioctl(FE_READ_SNR) failed: %s", strerror(errno));
fd=-1;
return -1;
}
-
+
// Normalize to 1.0
strength0=raw_strength/65535.0;
snr0=raw_snr/65535.0;
-
+
*strength=strength0;
*snr=snr0;
return 0;
}
+#endif