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?

Regards,

Jerry

Reply via email to