From c4ca7fe5468b6a7358a1f8c13aa26d9dfb5cedde Mon Sep 17 00:00:00 2001 From: Eveldee Date: Tue, 19 Mar 2019 20:08:45 +0000 Subject: [PATCH] Update page 'Protocol' --- Protocol.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Protocol.md b/Protocol.md index 353f0f5..cbc3e47 100644 --- a/Protocol.md +++ b/Protocol.md @@ -7,9 +7,9 @@ At the moment, it doesn't use **TLS** but plan to in a near future. A simple packet looks like this: -| Command | Argument 1 | Argument 2 | -| :-----: | :--------: | :--------: | -| PING | Hello | World! | +| Command | Argument 1 | +| :-----: | :----------: | +| PING | Hello World! | - **Command** - Always represent a single **uppercase** word as a command - **Arguments** - Represent a **semicolon-delimited** list of arguments @@ -18,19 +18,19 @@ Since all is a string, it is represented as: ```md PING -Hello;World!\n +Hello World!\n ``` Notice the `\n` at the end, it is used to show the end of the packet. -So, in one line, the packet is: `PING\nHello;World!\n` +So, in one line, the packet is: `PING\nHello World!\n` ## ID Since the broker need to know the destination of a packet, we add an id as an argument: -| Command | Argument 1 | Argument 2 | Argument 3 | -| :-----: | :--------: | :--------: | :--------: | -| PING | ID | Hello | World! | +| Command | Argument 1 | Argument 2 | +| :-----: | :--------: | :----------: | +| PING | ID | Hello World! | - **ID** - a 64 bit unsigned integer @@ -38,7 +38,7 @@ Here is the string representation: ```md PING -ID;Hello;World!\n +ID;Hello World!\n ``` The consequence is that the first argument is **always** used for the **ID** @@ -120,6 +120,7 @@ Here, a client send a 'ping' request to a server and the server reply with a 'po Each command is described in a dedicated page -> Note: ID is always omitted in a command description but present in reality, same for the end `\n` +> Note: ID is always omitted in command descriptions for readability but +> present in reality, same for the end `\n` - [PING](https://eveldee.ddns.net:1342/Eveldee/PlantBox/wiki/Command_Ping) \ No newline at end of file