0

I am implementing new tool which supports serial communication using RxTx library. My environment here is: Provided user interface to execute commands and display input from serail connection. My Problem here is: when i am reading data from serial port it was printing some specail characters like:

0[m, <-m... which i dont want to print in terminal.

so how to restrict those values from my serial reader.

this is my code to read data from inputstream which is there in serialEvent(SerialPortEvent evt) function.

int length = input.available();
byte[] array = new byte[length];
int numBytes = input.read(array);
  for (int i = 0; i < numBytes; i++) {
    if (array[i] != Constants.NEW_LINE_ASCII) {
    logText = new String(new byte[] {array[i]});
    textArea.append(logText);
  } else {
    textArea.append("\n");
 }
}

Thanks in advance

madhu
  • 37
  • 1
  • 10

1 Answers1

0

You need to set the environment variable TERM to dumb to let your system know that your terminal is a very basic one

morgano
  • 17,210
  • 10
  • 45
  • 56