kdeconnect-kde/README
Albert Vaca e86897cfe3 Fixed file transfer, added file size to protocol (optional)
Increased protocol version to 5
Updated README
2013-09-20 16:03:17 +02:00

66 lines
2.1 KiB
Text

Class diagram
==============
Backend_1 ... Backend_N
\ | /
Daemon
/ | \
Device_1 ... Device_N
/ \
|-Plugin_1 |-DeviceLink_1
|-Plugin_2 |-DeviceLink_2
|- ... |-...
|-Plugin_N |-DeviceLink_N
Daemon instantiates Backends
Backends manage to create DeviceLinks with the devices they can reach, and Q_EMIT them to the Daemon.
When the Daemon receives a DeviceLink from a backend:
- If it already knows the Device, adds the new DeviceLink to the existing Device, as a new way to reach it.
- If not, it creates a new untrusted (yet to be paired) Device.
Devices contain a list of DeviceLinks, plus a list of Plugins (instantiated automatically)
Information for and from Plugins is encapsulated in NetworkPackages.
When a DeviceLink receives a NetworkPackage from the device in the other end, Device will notify all the plugins.
When a Plugin wants to send a NetworkPackage, it does so using the pointer to Device
The NetworkPackage format
=========================
NetworkPackages are independent and self-contained pieces of information that
are sent from one device to another (via a DeviceLink) serialized in json.
The basic structure of a NetworkPackage is the following:
{
"id": 123456789,
"type": "org.kde.whatever",
"body": {
},
"version": 5
}
Each type of package defines what it should contain inside its "body", so only
the emisor Plugin and receiver Plugin of this type of package need agree about
its content.
If the package has a payload attached, it will also contain two more fields:
"payloadSize": The size of the file, or -1 if it is a stream without known end
"payloadTransferInfo": Another JSON Object containing the information that the
backend wants to send to the peer backend, to actually
transfer the payload.
Encrypted network packages have the following format:
//TODO
//TODO: Document the possible contents written for each plugin in the body part