Fazecast / jSerialComm

Platform-independent serial port access for Java
GNU Lesser General Public License v3.0
1.35k stars 287 forks source link

Line speed setup on Linux #2

Closed bbudai closed 9 years ago

bbudai commented 9 years ago

Hi! I had trouble reading data from a USB attached APM2.5 autopilot board in my x86_64 Linux. This device shows up as /dev/ttyACM0 and works at 115200bps with 8N1, RTS/CTS settings with other software but not jSerialComm. My Java code was pretty straightforward so I started to investigate jSerialComm source code. Turned out setting a custom baud rate doesn't work in my case. Changing the speed setup code to use cfsetispeed() and cfsetospeed() with B115200 did the trick for me, maybe others had similar issue.

regards, Benamin Budai

hedgecrw commented 9 years ago

Hey! Thanks so much for your comment...definitely a pain making sure this works under all Linux distros! I've made several changes that should fix the issue you were experiencing while still allowing for custom baud rates. If you wouldn't mind trying out the following library version, I'd appreciate it: https://dl.dropboxusercontent.com/u/3274122/jSerialComm-1.1.1.jar

Let me know if this works for you, and I'll push the changes to the repo and Maven.

bbudai commented 9 years ago

Thanks for the quick fix, works great.

hedgecrw commented 9 years ago

Changes pushed to Maven. Official version is now 1.1.1.