From eb8437e216f7b1a9069ed401a2a46e1f9c5e97d7 Mon Sep 17 00:00:00 2001 From: andrilys <136389670+andrilys@users.noreply.github.com> Date: Tue, 11 Jun 2024 17:07:20 +0200 Subject: [PATCH] Update 03_0_encoding.md Added more requirements. --- protocol/03_0_encoding.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/protocol/03_0_encoding.md b/protocol/03_0_encoding.md index f8f83c9..1701cfd 100644 --- a/protocol/03_0_encoding.md +++ b/protocol/03_0_encoding.md @@ -3,7 +3,15 @@ ## Requirements - The protocols must use JavaScript Object Notation (JSON). - The JSON string must be UTF-8 encoded. -- ... +- The header must be 53 characters long. +- The header must include length, crc32, and type_id. +- The length field must contain the size of the data in bytes. +- The crc32 field must contain the CRC32 checksum of the data. +- The type_id field must contain the type of the message. +- All values must be encoded as strings fields with leading zeros. +- All values in the fields must be treated as unsigned integers. +- The header must be sent before the data. +- All messeges with unmatching checksum must be ignored. ## Format A message is made up of two JSON strings, one for the header and the other for the data.