protected byte[] readNotificationResponse() throws DeviceDisconnectedException, DfuException, UploadAbortedException {
  try {
synchronized (mLock) {
      while ((mReceivedData == null && mConnected && mError == 0 && !mAborted) || mPaused)       mLock.wait();
    }
  }
 catch (  final InterruptedException e) {
    loge("Sleeping interrupted",e);
  }
  if (mAborted)   throw new UploadAbortedException();
  if (mError != 0)   throw new DfuException("Unable to write Op Code",mError);
  if (!mConnected)   throw new DeviceDisconnectedException("Unable to write Op Code: device disconnected");
  return mReceivedData;
}

protected byte [ ] readNotificationResponse ( ) throws DeviceDisconnectedException , DfuException , UploadAbortedException { try { synchronized ( mLock ) { while ( ( mReceivedData == null && mConnected && mError == 0 && ! mAborted ) || mPaused ) mLock . wait ( ) ; } } catch ( final InterruptedException e ) { loge ( "Sleeping interrupted" , e ) ; } if ( mAborted ) throw new UploadAbortedException ( ) ; if ( mError != 0 ) throw new DfuException ( "Unable to write Op Code" , mError ) ; if ( ! mConnected ) throw new DeviceDisconnectedException ( "Unable to write Op Code: device disconnected" ) ; return mReceivedData ; }
waits until the notification will arrive . returns the data returned by the notification . this method will block the thread until response is not ready or the device gets disconnected . if connection state will change , or an error will occur , an exception will be thrown .
