+ try:
+ fp = open("/dev/dbox/fp0")
+ ret = unpack('L', ioctl(fp.fileno(), 5, ' '))[0] # get wakeuptime
+ except IOError:
+ print "getFPWakeupTime failed!"
+ return ret
+
+def getFPWasTimerWakeup():
+ was_wakeup = False
+ try:
+ was_wakeup = int(open("/proc/stb/fp/was_timer_wakeup", "r").read()) and True or False
+ except:
+ try:
+ fp = open("/dev/dbox/fp0")
+ was_wakeup = unpack('B', ioctl(fp.fileno(), 9, ' '))[0] and True or False
+ except IOError:
+ print "wasTimerWakeup failed!"
+ return was_wakeup
+
+def clearFPWasTimerWakeup():
+ try:
+ open("/proc/stb/fp/was_timer_wakeup", "w").write('0')
+ except:
+ try:
+ fp = open("/dev/dbox/fp0")
+ ioctl(fp.fileno(), 10)
+ except IOError:
+ print "clearFPWasTimerWakeup failed!"