package main
import (
"log"
"github.com/goburrow/serial"
)
func main() {
port, err := serial.Open(&serial.Config{Address: "/dev/ttyUSB0"})
if err != nil {
log.Fatal(err)
}
defer port.Close()
_, err = port.Write([]byte("serial"))
if err != nil {
log.Fatal(err)
}
}
socat -d -d pty,raw,echo=0 pty,raw,echo=0
- on Mac OS, the socat command can be installed using homebrew:
brew install socat