pb with the serial port
hello
I'm making a programme that deal with the serial port
when i press on the button sennd of my serial device ,I get nothing .
infact i have to press about 4 times to get the output
I will get 4 outputs result at once
I believe that my problem come from
fluxLecture.readLine();
I think that my machine is not sending the end of line
what is strange that the "while" will stop but it wont execute the next line
System.out.println("I'm ouside ");
any idea ?
thank you in advance
try{
fluxLecture =
new BufferedReader(
new InputStreamReader(serialPort.getInputStream()));
}catch (IOException e){
}
then somewere else in my class I use this
publicvoid serialEvent(SerialPortEvent event){
switch (event.getEventType()){
case SerialPortEvent.BI :
case SerialPortEvent.OE :
case SerialPortEvent.FE :
case SerialPortEvent.PE :
case SerialPortEvent.CD :
case SerialPortEvent.CTS :
case SerialPortEvent.DSR :
case SerialPortEvent.RI :
case SerialPortEvent.OUTPUT_BUFFER_EMPTY :
break;
case SerialPortEvent.DATA_AVAILABLE :
try{
while(fluxLecture.ready())
{
result_output = result_output +" "+ (String) fluxLecture.readLine();
System.out.println("I'm inside");
}
System.out.println("I'm outside");
[/code]

