Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Problem with rxtx end paraller port under linux

Reply
Thread Tools

Problem with rxtx end paraller port under linux

 
 
Brzezi
Guest
Posts: n/a
 
      06-27-2004
Hi.

I am trying make paraller port to work under linux using rxtx library for
java, but i have problems:

port is recognized and opened correctly, but i cant read from it :/

It is my simple code:

#v+
<code>
import gnu.io.*;
[...]

CommPortIdentifier portId = null;
try{
portId = CommPortIdentifier.getPortIdentifier("/dev/lp0");
}
catch(NoSuchPortException e){
System.out.println(e);
}

CommPort port = null;

try{
port = portId.open("Tester", 1000);
}
catch(PortInUseException e){
System.out.println(e);
}

InputStream in = null;

try{
in = port.getInputStream();
}
catch(IOException e){
System.out.println(e);
}

try{
System.out.println("Wczytano: " + in.read()); // here is
// thrown exception
}catch(IOException e){
System.out.println(e.getMessage());
}

port.close();
}
</code>
#v-

When I run this code, I get Exception: "Input/output error in readByte"
this exception is thrown in line which I marked...

What is the problem? do you have any solution? or mayby there is any other
library for paraller/serial port?


PS. serial port works fine, when I change "/dev/lp0" to "/dev/ttyS0"
program waits for data to read, doesent throw any exception

Pozdrawiam
Brzezi
--
[ E-mail: http://www.velocityreviews.com/forums/(E-Mail Removed) ][ MP3Blaster is playing now: ]
[ Ekg: #3781111 ][ Title: Thats_All_I_Need_To_Know ]
[ LinuxUser: #249916 ][ Artist: Track 07 ]
[ Album: ]
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rxtx problem, please help! joshua Java 0 07-01-2007 09:06 PM
porting RXTX linux code to windows Arash Nikkar Java 5 04-15-2006 11:16 AM
URGENT RXTX SERIAL PORT Nanou Java 11 06-02-2005 01:17 PM
URGENT RXTX SERIAL PORT Nanou Java 0 05-31-2005 09:48 AM
Java rxtx libs Alex Bitkiller Java 2 02-18-2004 11:12 AM



Advertisments