Bump minimum cmake version to 3.5

Just to silence warning about imminent deprecation.
heimdall: FlashAction: skip size check in tflash mode

If we are flashing to sdcard we do not have to care about size
limitations as given by PIT.
heimdall: FlashAction: Use camelCase for skipSizeCheck variable

To be consistent with the rest of the code.
fix overflow in total bytes packet on 32 bit platforms

Updated TotalBytesPacket logic to use uint64_t values rather than
unsigned long for consistent width regardless of platform.

* Fix segfault when file to flash does not exist

* Rename some fields in the flashing protocol, MMC4096 seem to be UFS,
  and what I thought was the protocol number seem to be the number of
  logical units in the storage
FlashAction: fix FileOpen check

Check needs to be right after it is opened, before we try to seek in
it.  Before this fix, heimdall segfaults if file does not exist.

Fixes commit 60ab9bbaffe3 ("FlashAction: Make sure file fit partition
before flashing")
libpit: MMC4096 is really UFS

Change name to better describe the hardware.
libpit: last number in PIT header is the "LUN count"

Where LUN probably stands for Logical Unit Number.  Previous
assumption that it was the odin protocol version was wrong, so let's
fix this.
Revert "PIT: unknown version in PIT header has to be protocol version"

This assumption was wrong.  The number is really the number of logical
units in the storage, which tends to increase over time as the storage
space is increased I suppose.

This reverts commit e916c679ed04f5ba44cc5a9cbf340c8bf96b92fb.

Except for general cleanup we have these functional changes:

* Change printed pit header: last unknown number seem to be the Odin
  protocol version.

* Only run libusb_reset_device on ubuntu: on some distros/devices
  resetting the device causes the handshake to fail (observered for
BridgeManager: only libusb_reset_device on ubuntu

It seems that only ubuntu needs libusb_reset_device for successful
handshake. On most distros and device it works with or without, but
for some devices (like degaswifi/SM-T230 with a Marvell PXA 1088 SOC)
it causes handshake to fail.

Probably libusb_reset_device causes issues only for some devices, but
there seem to be no way to distinguish which ones from Heimdall (not
based on Odin protocol version or SOC at least).

Fixes commit 07a14d4aa8ad ("InitialiseProtocol: reset device before
BridgeManager: break another long line
BridgeManager: use SetUsbLogLevel for setting usb log level
README: point to samsung-loki/samsung-docs for more docs
PIT: unknown version in PIT header has to be protocol version

And in that case there now exists a fifth version of the Odin
protocol, seen on Galaxy S9 and newer.

In total we have seen these versions (as of January 2022):

* 0, on devices from around 2014 or older
* 3, on devices from around 2015
* 4, on devices from around 2016 - 2017
* 5, on devices from around 2018 or newer
BridgeManager: fix return value by libusb_get_device_list

And remove unnecessary spaces and break a long line.
BridgeManager: fix missing newline in error messages
c939ab18 — Antony Cherepanov 7 years ago
Fix comparison between signed and unsigned integers

Warning was seen when compiling with -Wall.
1385b183 — Antony Cherepanov 7 years ago
Packet destructor should be virtual

Fixes warning seen when compiling with -Wall.
heimdall-frontend: set version to 2.0.0 here as well

Will not make a new release for just this though.