Because there is now more than one "product name" per device
type, we have a concept of a "generic product name" which
singularly maps onto a device type.
This change comes with a few small breaking changes within
the C++ API:
DeviceType::GetDeviceTypeString has been renamed to
DeviceType::GetGenericProductName to denote that
the returned value is not device specific and
device->getProductName() is preferable.
The member function DeviceType::toString has been renamed
to DeviceType::getGenericProductName for the same reason.
The DeviceType std::ostream& operator<< has been removed
to avoid accidental use of the generic product name.
Shifting a value by more than the size of its type is UB.
This was actually causing mangled serial numbers with
optimization on using Clang 12 on Linux.
This allows for disconnections to be detected quickly
where possible.
It also makes sure other driver errors aren't thrown
in the event of a disconnection.
This code previously was separately maintained in each of the
PCAP driver layers.
While adding complexity for reassembly, I decided it was
time to pull it out into a common implementation.
As of this commit, the old implementations have not been
removed from the PCAP drivers yet.
The device can communicate with the PC over its Ethernet if the
enablePcEthernetComm setting is set within the structure.
This stops the Ethernet port from being used for vehicle data.
On Linux, raw packet capture requires CAP_NET_RAW (or root).
If we can't capture raw packets, we will not be able to find/connect to
devices over ethernet.
When a device is sending any traffic, the device is considered to be connected. If no traffic if being received from the device, a status is requested. If the device fails to report the status back in a timely manner, it is considered to be disconnected.
If the device fails to reply to the status request, it is important to confirm that the device is not applying settings. While the device is applying settings, it will not be sending heartbeats or able to process a status request.