Serial ports (java)

0

I am reading a serial port with the javax comm library and I read the data received with ( readByte ) and this comes to me: [B@6606af90 and when I read it as String ( readString ) I get some symbols (a few squares) ).

My question is if what I do is wrong and how to convert this into the real information that is a string of numbers. I'm working with Netbeans 8.2 64 bits, I tried RXTX, Gyiovinet and none worked for me.

This is the method where I receive the port data:

public void serialEvent(SerialPortEvent spe) {
   if(spe.isRXCHAR()){
       try {
           String buffer = puerto.readString();
           System.out.println("RECIBÍ: "+buffer);
       } catch (Exception e) {
           System.out.println("PROBLEMAS: "+e);
       }
   }

}

When I read with readString() I get this:

    
asked by Mauricio Molina 06.04.2018 в 04:16
source

0 answers