As i am new to java(Linux),I had done write byte data to serial port but i din't get read data from SerialPort..i did the connection well,i did the send the byte data like (Hex code-0x02,0x00,0x01,0xFE) but read data give me wrong output like 123a245d...i expect out like decimal..please help to solve my issue..
public SerialReader ( InputStream in )
this.in = in;
public void run ()
byte buffer = new byte;
int len = -1;
while ( ( len = this.in.read(buffer)) > -1 )
//System.out.println("Received a signal.");
catch ( IOException e )
public SerialWriter ( OutputStream out )
this.out = out;
What library do you use?
I believe RXTX is the most popular one for communicating with serial port in both ways.
Joined: Dec 12, 2013
I am using rxtx-2.1.7.jar.
Actually i m using simplepoll command to send data to serial port i send the hex values but i didn't get response from Serial Port( Simplepoll command-Coin Acceptor).
Kimd;y send me the code for Simple poll command.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com