13 messages in net.java.dev.jna.usersRe: [jna-users] handling serial port ...
FromSent OnAttachments
zamekMar 11, 2008 11:58 am 
Marc RavensbergenMar 11, 2008 12:24 pm 
zamekMar 11, 2008 1:47 pm 
Timothy WallMar 12, 2008 5:38 am 
zamekMar 12, 2008 2:34 pm 
Timothy WallMar 12, 2008 4:36 pm 
zamekMar 13, 2008 1:12 pm 
Timothy WallMar 13, 2008 5:04 pm.java
zamekMar 14, 2008 7:26 am 
Timothy WallMar 14, 2008 8:20 am 
zamekMar 14, 2008 8:51 am 
Timothy WallMar 17, 2008 6:58 am 
zamekMar 17, 2008 11:22 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] handling serial port with jan on linuxActions...
From:Timothy Wall (twal@dev.java.net)
Date:Mar 12, 2008 5:38:01 am
List:net.java.dev.jna.users

If you want to evaluate performance, I'd suggest mapping a simple function close to a no-op (atoi, floor, or some such function) and see if you can invoke it from Java sufficiently fast for your purposes, in the way you would call your serial port functions.

If RXTX is too slow, it's not likely JNA would be faster (they're both using JNI) unless you fundamentally change how you're interacting with the serial port (which may be the case if you're tweaking tty settings directly). Ideally you'd have a fairly large buffer which can be filled automatically; character-by-character reading would likely incur too much overhead if you have to cross the VM/native bridge on every one.

On Mar 11, 2008, at 4:47 PM, zamek wrote:

hi,

Ezzel a dátummal: Tuesday 11 March 2008 20.25.13 Marc Ravensbergen ezt írta:

Hi, any reason you wouldn't use something like rxtx, which is basically serial communications for java?

I need to communicate a microcontroller based device which send/ receive 96 bytes packages with 921kb/sec at every 5mS. All are ok, but there is an 5 mS latency between the first character of package and data_available signal.

I tested it with an oscilloscope, first channel was in Rxd, and second channel in RTS. When I got data available signal I set/reset rts. This latency was 5-25mS, but if I tried Molnar Ingo's reat time linux patch, it stabilized to 5mS. And when I tried it in native c based on http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html this latency reduced to 50uS!

I would like to test it with jna.