How do I use rtems_termios_bufsize?! No doc!

João Rasta freakforever at gmail.com
Thu Sep 23 09:52:43 UTC 2010


Thanks Chris, there are still two things i don't understand:

1) When transmitting, the behaviour i expect from the rtems software buffer
is that bytes are read from it one by one and passed to the uart hardware
buffer and then serialized to the serial line. This software buffer is the
raw_output buffer and the cooked buffer will not be used in this case. Is
this correct?

2) I want to transmit a package of 82 bytes, so I set the raw_output buffer
to 82. However at the other end of the transmission lines i don't receive
all 82 bytes, it seems some bytes are lost. If i set the raw_output buffer
bigger, say 256, it starts sending bytes that are not on the package. In a
transmission, only the message bytes in the software buffer should be sent
right?


Best,
JM








On Thu, Sep 23, 2010 at 6:49 AM, Chris Johns <chrisj at rtems.org> wrote:

>
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20100923/1d393192/attachment-0001.html>


More information about the users mailing list