Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #20 from HAW-RN/encoding_requirements
Browse files Browse the repository at this point in the history
Encoding Requirements
  • Loading branch information
AnnsAnns authored Jun 12, 2024
2 parents 846f2c4 + eb8437e commit c1dd280
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion protocol/03_0_encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c1dd280

Please sign in to comment.