synchronized protected void timeout(){
  if (bootState == BootState.CRSENT) {
    if (log.isDebugEnabled()) {
      log.debug("timeout in CRSENT - assuming boot mode");
    }
    requestBoot();
  }
 else   if (bootState == BootState.VERREQSENT) {
    log.error("timeout in VERREQSENT!");
    JOptionPane.showMessageDialog(this,"Unable to connect to bootloader","Fatal Error",JOptionPane.ERROR_MESSAGE);
    statusBar.setText("Fatal error - unable to connect");
    bootState=BootState.IDLE;
    tc.setSprogState(SprogState.NORMAL);
  }
 else   if (bootState == BootState.WRITESENT) {
    log.error("timeout in WRITESENT!");
    JOptionPane.showMessageDialog(this,"Timeout during write","Fatal Error",JOptionPane.ERROR_MESSAGE);
    statusBar.setText("Fatal error - unable to write");
    bootState=BootState.IDLE;
    tc.setSprogState(SprogState.NORMAL);
  }
 else   if (bootState == BootState.NULLWRITE) {
    if (hexFile.read() > 0) {
      sendWrite();
    }
 else {
      doneWriting();
    }
  }
}

synchronized protected void timeout ( ) { if ( bootState == BootState . CRSENT ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "timeout in CRSENT - assuming boot mode" ) ; } requestBoot ( ) ; } else if ( bootState == BootState . VERREQSENT ) { log . error ( "timeout in VERREQSENT!" ) ; JOptionPane . showMessageDialog ( this , "Unable to connect to bootloader" , "Fatal Error" , JOptionPane . ERROR_MESSAGE ) ; statusBar . setText ( "Fatal error - unable to connect" ) ; bootState = BootState . IDLE ; tc . setSprogState ( SprogState . NORMAL ) ; } else if ( bootState == BootState . WRITESENT ) { log . error ( "timeout in WRITESENT!" ) ; JOptionPane . showMessageDialog ( this , "Timeout during write" , "Fatal Error" , JOptionPane . ERROR_MESSAGE ) ; statusBar . setText ( "Fatal error - unable to write" ) ; bootState = BootState . IDLE ; tc . setSprogState ( SprogState . NORMAL ) ; } else if ( bootState == BootState . NULLWRITE ) { if ( hexFile . read ( ) > 0 ) { sendWrite ( ) ; } else { doneWriting ( ) ; } } }
internal routine to handle a timeout
