servicemp3.cpp: more simple/flexible streaming detection
[enigma2.git] / lib / python / Tools / DreamboxHardware.py
index 2a0ddee..9e81bb4 100644 (file)
@@ -2,12 +2,16 @@ from fcntl import ioctl
 from struct import pack, unpack
 
 def getFPVersion():
+       ret = None
        try:
-               fp = open("/dev/dbox/fp0")
-               return ioctl(fp.fileno(),0)
+               ret = long(open("/proc/stb/fp/version", "r").read())
        except IOError:
-               print "getFPVersion failed!"
-               return None
+               try:
+                       fp = open("/dev/dbox/fp0")
+                       ret = ioctl(fp.fileno(),0)
+               except IOError:
+                       print "getFPVersion failed!"
+       return ret
 
 def setFPWakeuptime(wutime):
        try:
@@ -19,6 +23,16 @@ def setFPWakeuptime(wutime):
                except IOError:
                        print "setFPWakeupTime failed!"
 
+def setRTCtime(wutime):
+       try:
+               open("/proc/stb/fp/rtc", "w").write(str(wutime))
+       except IOError:
+               try:
+                       fp = open("/dev/dbox/fp0")
+                       ioctl(fp.fileno(), 0x101, pack('L', wutime)) # set wake up
+               except IOError:
+                       print "setRTCtime failed!"
+
 def getFPWakeuptime():
        ret = 0
        try: