Add DeviceInfo class
DeviceInfo
contains all the properties we need to instantiate a Device
:
id, name, type, cert, capabilities and protocol version. Before, we had a mix
of passing those around as arguments or passing identity packets (ie: json).
This simplifies the Device
class quite a bit.
Now, BaseLink
subclasses need to implement the getDeviceInfo()
interface
that returns a DeviceInfo
, which is what we will pass around and eventually
use to instantiate a Device
.
This means that identity packets are an implementation detail of the
LanLinkProvider
and that other implementations could get the DeviceInfo
in a different way.
In a future, we can add a mechanism for links to notify when their DeviceInfo
changed.
This will allow us to better support device renames (which now are implemented by
reconnecting to the device and don't always work) or sending the capabilities fields
later in the case of MacOS/iOS where we can't send them in a UDP packet due to the
size limit of 1500 bytes.