Re: stdout

2021-02-05 Thread Alan Carvalho de Assis
Hi Grr, Could you please test your driver with the following application: / * hello_main / int main(int argc, FAR char *argv[]) { char name[

Re: stdout

2021-01-27 Thread Xiang Xiao
On Thu, Jan 28, 2021 at 3:16 AM Grr wrote: > I opted for The Right Thing(TM) and implemented a simple serial input echo > capabilities for serial driver introducing use of ECHO flag in > drivers/serial/serial.c and proper configuration options in menuconfig > > Now the interface of an interactive

Re: stdout

2021-01-27 Thread Grr
I opted for The Right Thing(TM) and implemented a simple serial input echo capabilities for serial driver introducing use of ECHO flag in drivers/serial/serial.c and proper configuration options in menuconfig Now the interface of an interactive serial program works the same in Linux and NuttX :)

Re: stdout

2021-01-26 Thread Grr
Ken: Thanks a lot for your code. I will try it I was researching that echo thing and yes, that's a terminal device driver thing. More exactly, c_lflag of termios struct. Problem is I haven't found yet where that is set in the serial terminal setup sequence El mar, 26 ene 2021 a las 11:28, Johnny

Re: stdout

2021-01-26 Thread Johnny Billquist
On 2021-01-26 16:16, Ken Pettit wrote: Grr, Yeah, in Nuttx, fgets, fgetc, etc. don't echo.  Even in Linux, the echo is actually a function of the terminal, not the running program and 'fgets'. It is actually not a function of the terminal, but the terminal (serial) device driver. Johnny

Re: stdout

2021-01-26 Thread Ken Pettit
Grr, Slightly revised version to remove trailing '\n', just for completenes. :) my_get_command(struct spitest_s *spitest) { charinput[80]; ssize_t len = 0; while (len == 0) { printf("\nEnter Command:"); fflush(stdout); len = readline(input, sizeof(input), stdin, st

Re: stdout

2021-01-26 Thread Ken Pettit
Grr, Yeah, in Nuttx, fgets, fgetc, etc. don't echo. Even in Linux, the echo is actually a function of the terminal, not the running program and 'fgets'. In Nuittx, use the readline routine instead. But keep in mind that readline is only *inspired* by GNU readline and has different calling

Re: stdout

2021-01-26 Thread Grr
Hello That fflush is for fgets Yes, with a stdout flush, message prints but the question remains about why is it needed and how can I get input echo Thanks Grr El lun, 25 ene 2021 a las 13:30, Ken Pettit () escribió: > Hey Grr, > > You need the fflush(stdout) call to be *after* the printf("\n

Re: stdout

2021-01-25 Thread Ken Pettit
Hey Grr, You need the fflush(stdout) call to be *after* the printf("\nEnter Command:"). If the printf doesn't end with \n, then the stdout won't be flushed. Ken On 1/25/21 11:25 AM, Grr wrote: Hello to all Is there a way to get stdout without a LF? I have something like case INPUT_CMD: