docs: void uploadFirmwareImage(final BluetoothGattCharacteristic packetCharacteristic)
  			throws DeviceDisconnectedException, DfuException, UploadAbortedException {
  		if (mAborted)
  			throw new UploadAbortedException();
  		mReceivedData = null;
  		mError = 0;
  		mFirmwareUploadInProgress = true;
  		mPacketsSentSinceNotification = 0;
  
  		final byte[] buffer = mBuffer;
  		try {
  			final int size = mFirmwareStream.read(buffer);
  			mService.sendLogBroadcast(DfuBaseService.LOG_LEVEL_VERBOSE,
                      "Sending firmware to characteristic " + packetCharacteristic.getUuid() + "...");
  			writePacket(mGatt, packetCharacteristic, buffer, size);
  		} catch (final HexFileValidationException e) {
  			throw new DfuException("HEX file not valid", DfuBaseService.ERROR_FILE_INVALID);
  		} catch (final IOException e) {
  			throw new DfuException("Error while reading file", DfuBaseService.ERROR_FILE_IO_EXCEPTION);
  		}
  
  		try {
  			synchronized (mLock) {
  				while ((mFirmwareUploadInProgress && mReceivedData == null && mConnected && mError == 0) || mPaused)
  					mLock.wait();
  			}
  		} catch (final InterruptedException e) {
  			loge("Sleeping interrupted", e);
  		}
  
  		if (!mConnected)
  			throw new DeviceDisconnectedException("Uploading Firmware Image failed: device disconnected");
  		if (mError != 0)
  			throw new DfuException("Uploading Firmware Image failed", mError);
  	}