aboutsummaryrefslogtreecommitdiff
path: root/lib/driver
diff options
context:
space:
mode:
authorAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-01 23:15:24 +0000
committerAndreas Monzner <andreas.monzner@multimedia-labs.de>2008-02-01 23:15:24 +0000
commitd89be097be4a9ac52166c5f47cc189c5522d3441 (patch)
tree7da4329e4fa22017a7312da52bfe7b1df8a16a02 /lib/driver
parentec200e0207d0a5ddb91c9c6c4ab8ae1c8f33ecea (diff)
downloadenigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.tar.gz
enigma2-d89be097be4a9ac52166c5f47cc189c5522d3441.zip
add possibilty to hide menu entries when needed hardware is not available
Diffstat (limited to 'lib/driver')
-rw-r--r--lib/driver/avswitch.cpp14
-rw-r--r--lib/driver/avswitch.h1
-rw-r--r--lib/driver/misc_options.cpp12
-rw-r--r--lib/driver/misc_options.h1
-rw-r--r--lib/driver/rfmod.h2
5 files changed, 29 insertions, 1 deletions
diff --git a/lib/driver/avswitch.cpp b/lib/driver/avswitch.cpp
index d582db81..a936aa54 100644
--- a/lib/driver/avswitch.cpp
+++ b/lib/driver/avswitch.cpp
@@ -1,6 +1,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
+#include <string.h>
#include <lib/base/init.h>
#include <lib/base/init_num.h>
@@ -81,6 +82,19 @@ eAVSwitch *eAVSwitch::getInstance()
return instance;
}
+bool eAVSwitch::haveScartSwitch()
+{
+ char tmp[255];
+ int fd = open("/proc/stb/avs/0/input_choices", O_RDONLY);
+ if(fd < 0) {
+ eDebug("cannot open /proc/stb/avs/0/input_choices");
+ return false;
+ }
+ read(fd, tmp, 255);
+ close(fd);
+ return !!strstr(tmp, "scart");
+}
+
void eAVSwitch::setInput(int val)
{
/*
diff --git a/lib/driver/avswitch.h b/lib/driver/avswitch.h
index 2b3b40fb..cc92e20e 100644
--- a/lib/driver/avswitch.h
+++ b/lib/driver/avswitch.h
@@ -24,6 +24,7 @@ public:
~eAVSwitch();
#endif
static eAVSwitch *getInstance();
+ bool haveScartSwitch();
int getVCRSlowBlanking();
void setFastBlank(int val);
void setColorFormat(int format);
diff --git a/lib/driver/misc_options.cpp b/lib/driver/misc_options.cpp
index ecb7bdb1..c567878c 100644
--- a/lib/driver/misc_options.cpp
+++ b/lib/driver/misc_options.cpp
@@ -39,6 +39,18 @@ int Misc_Options::set_12V_output(int state)
return 0;
}
+bool Misc_Options::detected_12V_output()
+{
+ int fd = open("/proc/stb/misc/12V_output", O_WRONLY);
+ if (fd < 0)
+ {
+ eDebug("couldn't open /proc/stb/misc/12V_output");
+ return false;
+ }
+ close(fd);
+ return true;
+}
+
Misc_Options *Misc_Options::getInstance()
{
return instance;
diff --git a/lib/driver/misc_options.h b/lib/driver/misc_options.h
index 6baf2cf2..81924944 100644
--- a/lib/driver/misc_options.h
+++ b/lib/driver/misc_options.h
@@ -15,6 +15,7 @@ public:
static Misc_Options *getInstance();
int set_12V_output(int val);
int get_12V_output() { return m_12V_output_state; }
+ bool detected_12V_output();
};
#endif // __misc_options_h
diff --git a/lib/driver/rfmod.h b/lib/driver/rfmod.h
index 909a08de..56f9ef50 100644
--- a/lib/driver/rfmod.h
+++ b/lib/driver/rfmod.h
@@ -16,7 +16,7 @@ public:
~eRFmod();
#endif
static eRFmod *getInstance();
-
+ bool detected() { return fd >= 0; }
void setFunction(int val); //0=Enable 1=Disable
void setTestmode(int val); //0=Enable 1=Disable
void setSoundFunction(int val); //0=Enable 1=Disable