1 from fcntl import ioctl
2 from struct import pack, unpack
6 fp = open("/dev/dbox/fp0")
7 return ioctl(fp.fileno(),0)
9 print "getFPVersion failed!"
12 def setFPWakeuptime(wutime):
14 open("/proc/stb/fp/wakeup_time", "w").write(str(wutime))
17 fp = open("/dev/dbox/fp0")
18 ioctl(fp.fileno(), 6, pack('L', wutime)) # set wake up
20 print "setFPWakeupTime failed!"
22 def getFPWakeuptime():
25 ret = long(open("/proc/stb/fp/wakeup_time", "r").read())
28 fp = open("/dev/dbox/fp0")
29 ret = unpack('L', ioctl(fp.fileno(), 5, ' '))[0] # get wakeuptime
31 print "getFPWakeupTime failed!"
34 def getFPWasTimerWakeup():
37 was_wakeup = int(open("/proc/stb/fp/was_timer_wakeup", "r").read()) and True or False
40 fp = open("/dev/dbox/fp0")
41 was_wakeup = unpack('B', ioctl(fp.fileno(), 9, ' '))[0] and True or False
43 print "wasTimerWakeup failed!"
46 def clearFPWasTimerWakeup():
48 open("/proc/stb/fp/was_timer_wakeup", "w").write('0')
51 fp = open("/dev/dbox/fp0")
52 ioctl(fp.fileno(), 10)
54 print "clearFPWasTimerWakeup failed!"