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]

[2458 byte] By [linuxchilda] at [2007-11-26 19:55:26]
# 1
} catch (IOException e) {}Eeeeeeeeeeh, wrong. Try again.
CeciNEstPasUnProgrammeura at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...
# 2
By the way, did you ever hear about StringBuilder or StringBuffer?
CeciNEstPasUnProgrammeura at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...
# 3
> By the way, did you ever hear about StringBuilder or> StringBuffer?no I will read about it ,but what is the relation with my pb ?for the catch I know it
linuxchilda at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...
# 4
And maybe you want to end the loop when readLine returns null.
CeciNEstPasUnProgrammeura at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...
# 5
Are you using package RXTX or javax.comm?
Jamwaa at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...
# 6
sorry for being late but as I have alot of work ,so ......> Are you using package RXTX or javax.comm?javax.comm I tried to chek if the readline is null ,the answer is no so my while stop but does not execute the next line strange ?
linuxchilda at 2007-7-9 22:48:36 > top of Java-index,Java Essentials,Java Programming...