hello all
I'm writing a program to connect via serial port (console) at different routers including Cisco.
The connection works perfectly on the Aethra router, but the communication on Cisco router appears to be one way, ie transmit but not receive anything and I can not understand why.
I use the library that I found on this site Cloudhopper : RXTX
These are the codes..

..for transmission

PHP Code:
public boolean trasmetti(char c) {
        try {
            
FileOutputStream fos = new FileOutputStream(serialPort.getName());
            
BufferedOutputStream buffer = new BufferedOutputStream(fos);
            
            
//buffer.write((""+c).getBytes());
            
buffer.write((bytec);
            
fos.flush();
            
buffer.flush();
            
fos.flush();
            
            
fos.close();
            
            return 
true;
        } catch (
Exception ex) {
            return 
false;
        }
    } 
..for reception

PHP Code:
serialPort.addEventListener(new SerialPortEventListener() {

                    public 
void serialEvent(SerialPortEvent spe) {
                        if(
spe.getEventType() == SerialPortEvent.DATA_AVAILABLE){
                            try {
                                
InputStreamReader isr = new InputStreamReader(serialPort.getInputStream());
                                
BufferedReader buffer = new BufferedReader(isr);

                                while (
isConnected) {
                                    
char[] cbuf = new char[1];
                                    
buffer.read(cbuf);
                                    
                                    if(
ascoltatoreConnessione != null && (byte)cbuf[0] != 0x0)
                                        
ascoltatoreConnessione.eseguiConCarattere(cbuf[0]);
                                }
                                
                                
                            } catch (
Exception ex) {
                                
ex.printStackTrace();
                            }
                            
                        }
                    }
                });