We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › serial library - flush and virtual serial ports
Page Index Toggle Pages: 1
serial library - flush and virtual serial ports (Read 1372 times)
serial library - flush and virtual serial ports
Aug 15th, 2006, 12:45pm
 
Hi,

I am using the virtual serial port of my bluetooth dongle to communicate with a midlet on my phone. I kept getting an "java.io.IOException: No error in nativeDrain" when I tried writing to the port. After looking at different forums I saw that people were having similar problems when using virtual serial ports (bluetooth, irda etc):
http://smslib.org/forum/index.php?action=vthread&forum=8&topic=134

A solution is to remove the flush() of the output stream. I have tried it and it solves the problem for me. I have got it working putting the neccesary rxtxSerial.dll and RXTXcomm.jar in the code folder and include Serial.java with the changes in my project.

My question is whether there is any problem in taking out the flush() - I presume it was put there for a reason...

Also, I would like to recompile the serial library without the flush'es, so I can just include it as normal and export to an application as normal. I have followed the instructions in the library howto - writing "javac -d . Serial.java". But I must be doing something really stupid because I keep getting errors on the import statements: "Serial.java:26: package processing.core does not exist" etc. I have included the processing lib folder in the class path but I still get the errors. Any ideas on what I am doing wrong?

/lars
Page Index Toggle Pages: 1