diff --git a/docs/protocol/layers/message.md b/docs/protocol/layers/message.md index e762340b3b63ea9a5c4af1e24c21ee005df97b30..127c453f674a345770d056595b5f70c73477be13 100644 --- a/docs/protocol/layers/message.md +++ b/docs/protocol/layers/message.md @@ -7,8 +7,8 @@ It starts off in `HANDSHAKE` state. ## Handshake State -In this state, messages are encoded/decoded according to the [Handshake](../serialization/handshake.md) -specification. +In this state, messages are encoded/decoded according to the +[Handshake Messages](../serialization/handshake_messages.md) specification. [](../../assets/images/message_init.png) @@ -36,4 +36,5 @@ If the client receives a CoreSetupAck, the client will proceed normally in the i ## Connected State -In this state, \ No newline at end of file +In this state, messages are serialized according to the +[SignalProxy Messages](../serialization/signalproxy_messages.md) specification. \ No newline at end of file diff --git a/docs/protocol/layers/overview.md b/docs/protocol/layers/overview.md new file mode 100644 index 0000000000000000000000000000000000000000..f5d9f4984d0db1e5a3577ab1fa65fddc17477627 --- /dev/null +++ b/docs/protocol/layers/overview.md @@ -0,0 +1,6 @@ +# Layers + +The lowest layer is the [Framing Layer](framing.md), on top of that rests the +[Message Layer](message.md). + +How to interpret those messages is going to be described at a later time. \ No newline at end of file diff --git a/docs/protocol/serialization/features.md b/docs/protocol/serialization/features.md index b6cb9c34c33aa1ba2c18d87d5e43671b67155c8a..20ae33ed88e8426d5dc81ee40789f8b5dc4733a9 100644 --- a/docs/protocol/serialization/features.md +++ b/docs/protocol/serialization/features.md @@ -3,6 +3,9 @@ Legacy features encode the flags of each supported feature, extended features encodes a QStringList of the names of all supported features. +If no flag is given, this feature is not included when legacy features are +encoded. + | Flag | Name | Description | |------------|------------------------|----------------------------------------------------------------------| |`0x00000001`| SynchronizedMarkerLine | -- | diff --git a/docs/protocol/serialization/handshake.md b/docs/protocol/serialization/handshake_messages.md similarity index 97% rename from docs/protocol/serialization/handshake.md rename to docs/protocol/serialization/handshake_messages.md index 8719c10b8b2ca7bc5d4d5614a9cccfae2ae9c732..a31e49dcf586389b439f6b9ec897ac0046415ab2 100644 --- a/docs/protocol/serialization/handshake.md +++ b/docs/protocol/serialization/handshake_messages.md @@ -7,6 +7,8 @@ Handshake Types are (de-)serialized to and from QVariantMaps. An additional key/value pair "MsgType" is added, which contains the name of the complexStruct’s type – for example `ClientInitAck` – as QString. +For en/decoding the specified fields see [Primitive Objects](primitive_objects.md). + ## ClientInit | Field | Type | Description | diff --git a/docs/protocol/serialization/primitive.md b/docs/protocol/serialization/primitive_objects.md similarity index 100% rename from docs/protocol/serialization/primitive.md rename to docs/protocol/serialization/primitive_objects.md diff --git a/docs/protocol/serialization/signalproxy_messages.md b/docs/protocol/serialization/signalproxy_messages.md new file mode 100644 index 0000000000000000000000000000000000000000..ce84e7882709283c9bb6c5f616b5cc8a94ce92a2 --- /dev/null +++ b/docs/protocol/serialization/signalproxy_messages.md @@ -0,0 +1,70 @@ +# Sync Types + +Sync messages are (de-)serialized to and from QVariantLists. They are encoded +as the request type, followed by the parameters of that type. + +For en/decoding the specified fields see [Primitive Objects](primitive_objects.md). + +## Request Type Enum + +| Value | Name | Direction | +|--------------|----------------|---------------| +| `0x00000001` | SyncMessage | bidirectional | +| `0x00000002` | RpcCall | bidirectional | +| `0x00000003` | InitRequest | C->S | +| `0x00000004` | InitData | S->C | +| `0x00000005` | HeartBeat | bidirectional | +| `0x00000006` | HeartBeatReply | bidirectional | + +## SyncMessage + +| Parameter | Type | Description | +|------------|----------------|---------------------------------------------------------------------------------| +| ClassName | `QByteArray` | Encoded as UTF-8 | +| ObjectName | `QByteArray` | Encoded as UTF-8 | +| SlotName | `QByteArray` | Encoded as UTF-8 | +| Params | `QVariantList` | Not an actual parameter, just the remaining elements of the list (may be empty) | + +## RpcCall + +| Parameter | Type | Description | +|-----------|----------------|---------------------------------------------------------------------------------| +| SlotName | `QByteArray` | Encoded as UTF-8 | +| Params | `QVariantList` | Not an actual parameter, just the remaining elements of the list (may be empty) | + +## InitRequest + +| Parameter | Type | Description | +|------------|--------------|------------------| +| ClassName | `QByteArray` | Encoded as UTF-8 | +| ObjectName | `QByteArray` | Encoded as UTF-8 | + +## InitData + +| Parameter | Type | Description | +|------------|---------------|------------------| +| ClassName | `QByteArray` | Encoded as UTF-8 | +| ObjectName | `QByteArray` | Encoded as UTF-8 | +| InitData | `QVariantMap` | See below | + +The InitData field is not an actual parameter, just the remaining elements of +the list (may be empty), grouped into pairs of 2, interpreted as key and value +respectively. + +These are according to the [SignalProxy Objects](signalproxy_objects.md) +specification. + +## HeartBeat + +| Parameter | Name | +|-----------|-------------| +| Timestamp | `QDateTime` | + +In case this is received, the other side expects a corresponding HeartBeatReply +with the same timestamp. + +## HeartBeatReply + +| Parameter | Name | +|-----------|-------------| +| Timestamp | `QDateTime` | diff --git a/docs/protocol/serialization/compound.md b/docs/protocol/serialization/signalproxy_objects.md similarity index 95% rename from docs/protocol/serialization/compound.md rename to docs/protocol/serialization/signalproxy_objects.md index b5480fca53a82b65d3f6255bb7878110c6317de4..cf4d756ac2b68e63342c79cc6c369ce56175cec9 100644 --- a/docs/protocol/serialization/compound.md +++ b/docs/protocol/serialization/signalproxy_objects.md @@ -1,6 +1,6 @@ -# Compound Types +# SignalProxy Objects -This document discusses how complex objects are translated to and from +This document discusses how sync objects are translated to and from QVariantMaps. ## Network::Server @@ -23,14 +23,6 @@ type: | ProxyUser | `QString` | -- | | ProxyPass | `QString` | -- | -## SessionState - -| Field | Type | Description | -|-------------|----------------------------|-------------| -| Identities | `QVariantList<Identity>` | -- | -| BufferInfos | `QVariantList<BufferInfo>` | -- | -| NetworkIds | `QVariantList<NetworkId>` | -- | - ## Identity Warning: This type has, when serialized, QVariantType "Network::Server" (which diff --git a/mkdocs.yml b/mkdocs.yml index 503b9101cd0ede25e57964e4145c6bcfe40d7cbc..62c5ec1eb54fd0c308fc0d45545ab38b2bffb95a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,13 +13,15 @@ nav: - "Upgrade Guide": usage/upgrade_guide.md - "Protocol": - "Layers": + - "Overview": protocol/layers/overview.md - "Framing": protocol/layers/framing.md - "Message": protocol/layers/message.md - "Serialization": - - "Primitive Types": protocol/serialization/primitive.md - - "Compound Types": protocol/serialization/compound.md + - "Handshake Messages": protocol/serialization/handshake_messages.md - "Features": protocol/serialization/features.md - - "Handshake": protocol/serialization/handshake.md + - "SignalProxy Messages": protocol/serialization/signalproxy_messages.md + - "SignalProxy Objects": protocol/serialization/signalproxy_objects.md + - "Primitive Objects": protocol/serialization/primitive_objects.md extra: social: