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 #6 from HAW-RN/encoding
Browse files Browse the repository at this point in the history
Encoding
  • Loading branch information
AnnsAnns authored Jun 2, 2024
2 parents e751161 + e4acb7b commit bd3bcb8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions protocol/03_encoding.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,23 @@
# Encoding

## Requirements
- The protocols must use JavaScript Object Notation (JSON).
- The JSON string must be UTF-8 encoded.
- ...

## Format
### Header
| Type | Name | Description |
|-------|-----------|--------------------------------------------------|
| int_? | Length | Message length (including or excluding?) header. |
| int_? | Checksum | ... |
TODO:
- Define int sizes. The length cannot exceed the uint16 range. However, it may be more convenient to use int32 in languages that do not support unsigned types.
- Select a checksum algorithm.

### Data
| Type | Name | Description |
|---------|------|-----------------------------------------|
| String | Data | JSON message encoded as a UTF-8 string. |

## Example

0 comments on commit bd3bcb8

Please sign in to comment.