code: private void writePacket(final BluetoothGatt gatt, final BluetoothGattCharacteristic characteristic, final byte[] buffer, final int size) {
  		byte[] locBuffer = buffer;
  		if (size <= 0) // This should never happen
  			return;
  		if (buffer.length != size) {
  			locBuffer = new byte[size];
  			System.arraycopy(buffer, 0, locBuffer, 0, size);
  		}
  		characteristic.setWriteType(BluetoothGattCharacteristic.WRITE_TYPE_NO_RESPONSE);
  		characteristic.setValue(locBuffer);
  		gatt.writeCharacteristic(characteristic);
  	}
docs: Writes the buffer to the characteristic. The maximum size of the buffer is dependent on MTU.
  This method is ASYNCHRONOUS and returns immediately after adding the data to TX queue.
  
  @param characteristic the characteristic to write to. Should be the DFU PACKET.
  @param buffer         the buffer with 1-20 bytes.
  @param size           the number of bytes from the buffer to send.