projects
/
svn42.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
889622e
)
update status at daemon start
author
realraum
<realraum@realraum.at>
Thu, 30 Apr 2009 04:18:17 +0000
(
04:18
+0000)
committer
realraum
<realraum@realraum.at>
Thu, 30 Apr 2009 04:18:17 +0000
(
04:18
+0000)
door_daemon.py
patch
|
blob
|
history
diff --git
a/door_daemon.py
b/door_daemon.py
index
fefc6cd
..
8df0761
100755
(executable)
--- a/
door_daemon.py
+++ b/
door_daemon.py
@@
-50,7
+50,8
@@
class ArduinoUSBThread ( threading.Thread ):
self.cv_updatestatus = threading.Condition(); #lock ist automatically created withing condition
self.file_dev_ttyusb=file_dev_ttyusb
#self.fh = open(self.file_dev_ttyusb,"w+")
self.cv_updatestatus = threading.Condition(); #lock ist automatically created withing condition
self.file_dev_ttyusb=file_dev_ttyusb
#self.fh = open(self.file_dev_ttyusb,"w+")
- self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK),"r+")
+ self.fh = os.fdopen(os.open(self.file_dev_ttyusb, os.O_RDWR | os.O_NONBLOCK),"r+")
+ #pythons sucks just like perl: we need nonblock or we can't write to FileHandle while we block reading on same filehandle
self.statusdisplay = StatusDisplay()
threading.Thread.__init__(self)
self.statusdisplay = StatusDisplay()
threading.Thread.__init__(self)
@@
-206,6
+207,8
@@
arduino.start()
ctrlfifo = ControlFIFOThread(fifofile,arduino)
ctrlfifo.start()
ctrlfifo = ControlFIFOThread(fifofile,arduino)
ctrlfifo.start()
+arduino.send_statusrequest()
+
def exit_handler(signum, frame):
global arduino, ctrlfifo
logging.info("Door Daemon stopping")
def exit_handler(signum, frame):
global arduino, ctrlfifo
logging.info("Door Daemon stopping")