lib/python/Tools/DreamboxHardware.py: add function to set RTC Time
authorghost <andreas.monzner@multimedia-labs.de>
Wed, 4 Mar 2009 23:11:55 +0000 (00:11 +0100)
committerghost <andreas.monzner@multimedia-labs.de>
Wed, 4 Mar 2009 23:11:55 +0000 (00:11 +0100)
lib/python/Tools/DreamboxHardware.py

index 5461f7b05828adad2d3b12c943bd63eff49fd692..9e81bb476a564e9a72cef9ab8e31eb450da723df 100644 (file)
@@ -23,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: