[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] Bug? termios functions not working in serial.fs

From: Jerry DeLisle
Subject: [gforth] Bug? termios functions not working in serial.fs
Date: Sat, 25 Oct 2014 09:08:24 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

Hi folks,

I instrumented set-baud in serial.fs as follows.

: set-baud ( baud fd -- )  >r
    r@ t_old tcgetattr .
    t_old t_buf termios move
    t_buf cfmakeraw
    t_buf over cfsetispeed .
    t_buf swap cfsetospeed .
    r> 0 t_buf tcsetattr . ;

replacing the DROP with .

I wanted to check the return values for tcgetattr and tcsetattr.

I am using a simple driver setup in file port-io.fs:

\ port-io.fs
marker forget
include serial.fs

0 value port
: open-port  open-file throw to port ;
s" /dev/ttyUSB0" r/w open-port

The result is:

include port-io.fs  ok
cr B9600 port set-baud
-1 0 0 -1  ok

I can write to the port using write-file with no error and see the data
activity on the port lights.

Am I missing something here or is this a bug?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]