LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2009, 05:18 AM   #1
siriyu
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Rep: Reputation: 0
rxtx serial port event problems with usb adapter


My java application communicates with datalogger via rs232. Rxtx library works fine on *linux and windows system using serial port. The problems come when I use an usb* adapter* FTDI chip-set based (http://www.ftdichip.com/Products/Eva.../US232R-10.htm) on my lunux system (2.6.24 kernel), where there is no need of driver. On windows instead I have no problem. My program is event based; This adapter works correctly using Mincom. But in my program I use serialPort.notifyOnDataAvailable(true) and serialPort.notifyOnOutputEmpty(true)* calls.
My application send first message correctly but I get an error in response:
at gnu.io.RXTXPort.sendEvent(RXTXPort.java:732)
at gnu.io.RXTXPort.nativeDrain(Native Method)
at gnu.io.RXTXPort$SerialOutputStream.flush(RXTXPort.java:1201)

*If I comment flush() command after send first message I have no response and my time-out exceeds. It seems there are problems when generating SerialPortEvent.DATA_AVAILABLE event.
How can I resolve this problems ?
 
Old 06-30-2009, 10:23 AM   #2
justin.caseof
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
hi!
i encounter exact same same problems as you do. my SerialPortEventListener never receives any SerialPortEvents.
have you already found any solution to this? i really would appreciate any help!
thx so far,
tobias
 
Old 07-03-2009, 03:17 AM   #3
siriyu
LQ Newbie
 
Registered: Mar 2009
Posts: 4

Original Poster
Rep: Reputation: 0
I develop a "polling" logic.


/** */
public class SerialWriter implements Runnable
{ //TRAnSMISsion
OutputStream out;

public SerialWriter ( OutputStream out )
{
this.out = out;
}

public void run ()
{
try {
while(end==false){......






public class SerialReader implements Runnable
{ //RICEIVING
InputStream in;
MisureUtil misureUtil = new MisureUtil();

public SerialReader ( InputStream in )
{
this.in = in;
}

public void run ()
{
try {
while(end==false){...

I use semaphore variable.
Bye.
Luca
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
belkin usb > serial port adapter > external dialup modem -- no authentication SharpyWarpy Linux - Hardware 2 02-24-2009 10:13 AM
problem installing rxtx for serial port control rastavideo Linux - Software 1 01-17-2008 09:29 PM
Startech USB-to-Serial 4 Port adapter on RH9 mscollins1 Linux - Hardware 6 08-26-2005 11:25 PM
zoom external serial with usb to serial adapter foustware Linux - Hardware 1 12-07-2003 02:02 AM
RING event on the serial port ruchika Linux - Software 3 08-28-2003 02:43 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration