944,192 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 5943
  • Java RSS
Sep 13th, 2004
0

javax.comm write error

Expand Post »
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:
Java Syntax (Toggle Plain Text)
  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:

Java Syntax (Toggle Plain Text)
  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
Similar Threads
Reputation Points: 17
Solved Threads: 1
Junior Poster
cosi is offline Offline
153 posts
since Aug 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Applet Help
Next Thread in Java Forum Timeline: Help Needed ! ! !





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC