From: Bernhard Tittelbach Date: Thu, 21 Nov 2013 11:41:08 +0000 (+0000) Subject: test termios set speed X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;h=cc0d836917509cceb40a4c71bdf8ad647cf635e8;p=svn42.git test termios set speed --- diff --git a/go/termios/termios.go b/go/termios/termios.go index 11325c9..71ba332 100644 --- a/go/termios/termios.go +++ b/go/termios/termios.go @@ -119,3 +119,16 @@ func SetRaw () { if err = tty_raw (); err != nil { return } //if err = screenio (); err != nil { return } } + +func SetSpeed (speed uint) { + var err error + + defer func () { + if err != nil { fmt.Printf ("SetSpeed Error: %v\n",err) } + } (); + + if err = getTermios (&orig_termios); err != nil { return } + orig_termios.c_ispeed = speed_t(speed) + orig_termios.c_ospeed = speed_t(speed) + err = setTermios (&orig_termios) +}