javax.comm write error

Reply

Join Date: Aug 2004
Posts: 153
Reputation: cosi is an unknown quantity at this point 
Solved Threads: 1
cosi's Avatar
cosi cosi is offline Offline
Junior Poster

javax.comm write error

 
0
  #1
Sep 13th, 2004
I recently bumped into this interesting problem when writing code that used serial port communications. Writing data to serial port fails after ~ 30 seconds of use. Everything works fine for the first 30 seconds or so, then an IOException: write error occurs.

I am writing data to the OutputStream a serial port configured like this:
  1. fSerialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE);
  2.  
  3. fSerialPort.setSerialPortParams(baudrate, SerialPort.DATABITS_8,
  4. SerialPort.STOPBITS_1, SerialPort.PARITY_NONE);

This problem is similarly described in these Sun Java Forums. However, no one seems to have a solution to this problem, and those forum threads died long ago. I hope dani's community might have some answers.

http://forum.java.sun.com/thread.jsp...message=817968
http://forum.java.sun.com/thread.jsp...essage=1104701

Below is a snip of the output as well as the stack trace:

  1. COMM|Sending: Ask for Embedded Status. Header: 4 0 12 8
  2. java.io.IOException: write error
  3. at com.sun.comm.Win32SerialPort.write(Win32SerialPort.java:677)
  4. at com.sun.comm.Win32SerialOutputStream.write(Win32SerialOutputStream.java:43)
  5. at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:66)
  6. at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:124)
  7. at edu.dartmouth.robot.tenzing.comm.TimerSender.send(TimerSender.java:103)
  8. at edu.dartmouth.robot.tenzing.comm.RobotComm.run(RobotComm.java:157)

Perhaps this is a java bug that I should report, but I just want to be sure.


Ed
In a world without walls or fences,
What use are Windows and Gates.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC