code: private int getStatusCode(@Nullable final byte[] response, final int request)
  			throws UnknownResponseException {
  		if (response == null || response.length != 3 || response[0] != OP_CODE_RESPONSE_CODE_KEY ||
  				response[1] != request || response[2] < 1 || response[2] > 6)
  			throw new UnknownResponseException("Invalid response received", response, OP_CODE_RESPONSE_CODE_KEY, request);
  		return response[2];
  	}
docs: Checks whether the response received is valid and returns the status code.
  
  @param response the response received from the DFU device.
  @param request  the expected Op Code.
  @return The status code.
  @throws UnknownResponseException if response was not valid.