How do I use rtems_termios_bufsize?! No doc!

Chris Johns chrisj at rtems.org
Thu Sep 23 05:49:35 UTC 2010



On 22/09/10 10:00 PM, João Rasta wrote:
> Hi,
>
> I'm using rtems_termios_bufsize() to change the software RX/TX fifo size
> of the UART. This is greatly affecting my application results however i
> haven't been unable to understand how it works.
>
> The only documentation i found was
>
> rtems_status_code rtems_termios_bufsize (
>    int cbufsize,     /* cooked buffer size */
>    int raw_input,    /* raw input buffer size */
>    int raw_output    /* raw output buffer size */
> );
>
> But this leaves me with some doubts:
>
> 1) Is the size in bytes? I guess it is, it's just to clarify.
>

Yes.

> 2) What is the cooked buffer and what are the implications of
> increasing/decreasing its size?

Cooked mode or canonical mode returns or outputs a single line at a 
time. I suppose this buffer needs to be big enough to hold a suitable 
length of line.

>
> 3) What are the maximum values i can use for the buffers sizes and the
> implications of increasing it?

I suppose the amount of memory. The buffers are just malloc'ed.

>
> 4) How are the default values set for these buffers if i don't use
> rtems_termios_bufsize()?

By initialised variables. From termios.c:

static int rtems_termios_cbufsize = 256;
static int rtems_termios_raw_input_size = 128;
static int rtems_termios_raw_output_size = 64;

>
> 5) My application hangs on a write() if i set raw_output to 1. But why?
>

I suspect a bug or something related to the fact a 1 byte output buffer 
does not make sense.

Chris



More information about the users mailing list