projects
/
svn42.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed errors and run script
[svn42.git]
/
door_daemon_go
/
unix_socket_server.go
diff --git
a/door_daemon_go/unix_socket_server.go
b/door_daemon_go/unix_socket_server.go
index
14b9226
..
61893ff
100644
(file)
--- a/
door_daemon_go/unix_socket_server.go
+++ b/
door_daemon_go/unix_socket_server.go
@@
-7,6
+7,7
@@
import "os"
import "io"
import "termios"
import "flag"
import "io"
import "termios"
import "flag"
+import "regexp"
var cmdHandler = map[string]func([]string,string,*bufio.ReadWriter ) {
"test":handleCmdTest,
var cmdHandler = map[string]func([]string,string,*bufio.ReadWriter ) {
"test":handleCmdTest,
@@
-38,7
+39,9
@@
func readLineSafe(rw *bufio.Reader) (string, error) {
//rw.Flush()
return "",nil
}
//rw.Flush()
return "",nil
}
- return line,nil
+ reg := regexp.MustCompile("\r")
+ safe := reg.ReplaceAllString(line, "")
+ return safe,nil
}
func connToReadWriter(c io.Reader,cw io.Writer) (*bufio.ReadWriter) {
}
func connToReadWriter(c io.Reader,cw io.Writer) (*bufio.ReadWriter) {
@@
-127,7
+130,7
@@
func SerialReader(c chan string , serial * bufio.Reader) {
fmt.Printf("Error in read from serial: %v\n",err.Error())
os.Exit(1)
}
fmt.Printf("Error in read from serial: %v\n",err.Error())
os.Exit(1)
}
- fmt.Printf("Serial: Read %v\n",s);
+ //fmt.Printf("Serial: Read %v\n",s);
c<-s
}
}
c<-s
}
}
@@
-143,7
+146,7
@@
func openSerial(filename string) (chan string,chan string) {
func SerialHandler(serial_i chan string) {
for {
func SerialHandler(serial_i chan string) {
for {
- fmt.Printf("Serial said: %v\n",<-serial_i);
+ fmt.Printf("Serial Read: %s\n",<-serial_i);
}
}
func main() {
}
}
func main() {