I would like to get some help with this:
I want to communicate with a serial device with Java and I have started to play a little bit with java.comm
package. My device should be responding to my messages and I don't know how to achieve this. After first message it doesn't work any more. InputStream
becomes unavailable.
While debugging I came down to this simple case:
//question no. 1
outputStream.write(first_question);
outputStream.flush();
while (inputStream.available() > 0) {
line = inputStream.read();
System.out.println(line);
}
//question no. 2
outputStream.write(second_question);
outputStream.flush();
while (inputStream.available() > 0) {
line = this.in.read();
System.out.println(line);
}
` Thanks for your help and suggestions!