1 from fcntl import ioctl
2 from struct import pack, unpack
7 ret = long(open("/proc/stb/fp/version", "r").read())
10 fp = open("/dev/dbox/fp0")
11 ret = ioctl(fp.fileno(),0)
13 print "getFPVersion failed!"
16 def setFPWakeuptime(wutime):
18 open("/proc/stb/fp/wakeup_time", "w").write(str(wutime))
21 fp = open("/dev/dbox/fp0")
22 ioctl(fp.fileno(), 6, pack('L', wutime)) # set wake up
24 print "setFPWakeupTime failed!"
26 def getFPWakeuptime():
29 ret = long(open("/proc/stb/fp/wakeup_time", "r").read())
32 fp = open("/dev/dbox/fp0")
33 ret = unpack('L', ioctl(fp.fileno(), 5, ' '))[0] # get wakeuptime
35 print "getFPWakeupTime failed!"
38 def getFPWasTimerWakeup():
41 was_wakeup = int(open("/proc/stb/fp/was_timer_wakeup", "r").read()) and True or False
44 fp = open("/dev/dbox/fp0")
45 was_wakeup = unpack('B', ioctl(fp.fileno(), 9, ' '))[0] and True or False
47 print "wasTimerWakeup failed!"
50 def clearFPWasTimerWakeup():
52 open("/proc/stb/fp/was_timer_wakeup", "w").write('0')
55 fp = open("/dev/dbox/fp0")
56 ioctl(fp.fileno(), 10)
58 print "clearFPWasTimerWakeup failed!"