private void handleStatus(Status status){
  Log.d(TAG,"Handling Bean status: " + status);
  BeanState beanState=status.beanState();
  if (beanState == BeanState.READY) {
    resetSketchStateTimeout();
    if (sketchUploadState == SketchUploadState.SENDING_START_COMMAND) {
      sketchUploadState=SketchUploadState.SENDING_BLOCKS;
      stopSketchStateTimeout();
      sendNextSketchBlock();
    }
  }
 else   if (beanState == BeanState.PROGRAMMING) {
    resetSketchStateTimeout();
  }
 else   if (beanState == BeanState.COMPLETE) {
    if (onSketchUploadComplete != null)     onSketchUploadComplete.run();
    resetSketchUploadState();
  }
 else   if (beanState == BeanState.ERROR) {
    returnUploadError(BeanError.UNKNOWN);
    resetSketchUploadState();
  }
}

private void handleStatus ( Status status ) { Log . d ( TAG , "Handling Bean status: " + status ) ; BeanState beanState = status . beanState ( ) ; if ( beanState == BeanState . READY ) { resetSketchStateTimeout ( ) ; if ( sketchUploadState == SketchUploadState . SENDING_START_COMMAND ) { sketchUploadState = SketchUploadState . SENDING_BLOCKS ; stopSketchStateTimeout ( ) ; sendNextSketchBlock ( ) ; } } else if ( beanState == BeanState . PROGRAMMING ) { resetSketchStateTimeout ( ) ; } else if ( beanState == BeanState . COMPLETE ) { if ( onSketchUploadComplete != null ) onSketchUploadComplete . run ( ) ; resetSketchUploadState ( ) ; } else if ( beanState == BeanState . ERROR ) { returnUploadError ( BeanError . UNKNOWN ) ; resetSketchUploadState ( ) ; } }
fired when the bean sends a status message . updates the client ' s internal state machine , used for uploading sketches and firmware to the bean .
