[Rxtx] noob trouble with rxtx, losing bytes somewhere
Steffen DETTMER
Steffen.DETTMER at ingenico.com
Mon Dec 14 11:49:29 MST 2009
* M.Dec-Gazeta wrote on Mon, Dec 14, 2009 at 13:25 +0100:
> The kind of solution is a big size of the OS buffer, which will not
> overflows when Java is busy.
> But there is a lot of another things as well - vendors drivers, USB /RS232
> hardware and buffers there, USB1.1 vs USB 2.0 etc, another devices in the
> same USB hub etc.
Yes, and different unknown buffer sizes and drivers not telling
whether they overflowed also can be a pain...
> From my experience with real time systems (small embedded
> systems as well), the best way is to prepare serial (or another
> incoming) buffer as big as possible and thinking about tuning
> rest of the application - to have a time to empty this buffer
> in the meantime.
Yes, and I think this also is a good way for non-RT systems: let
the OS handle the "single bytes" and let the own application read
block-wise. If a read(byte) call takes 10 ms, only 10k would be
possible, but with a read(byte[]) or event based block readers
larger blocks are returned when the application calls less
frequently; well, but IIRC rxtx also implements some buffer.
> BTW:
> Few months ago I have helped my friend, who had to change their old
> soft/hard system on RS232 from UART16550 to USB/RS232 dongle.
> Timing in this system is very important.
Yeah, and it can create issues with latency, which under some
circumstances are be seriously bigger than with UART. Well, and
many different USB chips/drivers with their specifics... hum...
> We will have a lot to do when standards UARTS will gone !!!!! :)
Yes, I'm afraid you're right :)
interestingly half of those problems seem to come from ancient
UART limitations coming to USB just when emulating it :)
[AFAIK USB block transfer itself is reliable, fast and
relatively easy to use]
Yes, we won't get bored :)
oki,
Steffen
About Ingenico: Ingenico is a leading provider of payment solutions, with over 15 million terminals deployed in more than 125 countries. Its 2,500 employees worldwide support retailers, banks and service providers to optimize and secure their electronic payments solutions, develop their offer of services and increase their point of sales revenue. More information on http://www.ingenico.com/.
This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation.
P Please consider the environment before printing this e-mail
More information about the Rxtx
mailing list