chan buffer and --bug
authorBernhard Tittelbach <xro@realraum.at>
Tue, 24 Sep 2013 22:54:55 +0000 (22:54 +0000)
committerBernhard Tittelbach <xro@realraum.at>
Tue, 24 Sep 2013 22:54:55 +0000 (22:54 +0000)
go/door_daemon_zmq/handle_commands.go
go/door_daemon_zmq/serial_tty.go

index 1595561..0cfee8d 100644 (file)
@@ -15,7 +15,7 @@ var cmdToDoorCmdHandler = map[string]DoorCmdHandler {
   "open": DoorCmdHandler{ checkCmdDoorControl, "o"},
   "close": DoorCmdHandler{ checkCmdDoorControl, "c"},
   "toggle": DoorCmdHandler{ checkCmdDoorControl, "t"},
-  "status": DoorCmdHandler{ checkCmdDoorControl, "s"},
+  "status": DoorCmdHandler{ checkCmdStatus, "s"},
 }
 
 // ---------- Command Handling Code -------------
index 89f0b0c..ea246ca 100644 (file)
@@ -51,7 +51,7 @@ func OpenAndHandleSerial(filename string) (chan string, chan [][]byte, error) {
     if err != nil {
         return nil, nil, err
     }
-    wr := make(chan string)
+    wr := make(chan string, 1)
        rd := make(chan [][]byte, 20)
     go serialWriter(wr, serial)
     go serialReader(rd, serial)