61 lines
3.7 KiB
Markdown
Raw Normal View History

# Message Structure
## Possible Improvements
As for now, we are not having a max abount of bytes the message may have,
so we are relying on the ability of the receiver to dynamically allocate a buffer for the message.
However, we could add a field to tell a PRIORI the length of the whole message.
Probably we would use between 8 B or 24 B to put this info
(This won't be a 2.0 version, as this is not a final document yet)
```
+-+ 64 - bits---+----------------+-------------+----------------+-----------------------+
|0| Version 7 | Message Type 8 | Dev Type 8 | RESERVED 16 | Sign Type 32 |
+-+-------------+----------------+-------------+----------------+-----------------------+
| Timestamp 64 |
+---------------------------------------------------------------------------------------+
| DevID 128 bits |
| |
+---------------------------------------------------------------------------------------+
| Location 192 bits |
| |
| |
+---------------------------------------------------------------------------------------+
\ /
| Fields -----------------------------------------------------------------------------|
/ \
+---------------------------------------------------------------------------------------+
| 0 Padding 64 - n |
+---------------------------------------------------------------------------------------+
| Signature up to-512 bits |
| |
| |
| |
| |
| |
| |
| |
+---------------------------------------------------------------------------------------+
```
# Fields
each field can be at most 8 * 2^32 bits of length:
- 34359738368 bits
- 4294967296 Bytes
## Key
**MUST** be a `String`
## Value
It's up to the Application to decide whether the value is
a string or another type of datum
```
+-- 64 - bits--------------------------+----------------------------------------+
| Key-Length 32 | Value-Length 32 |
+--------------------------------------+----------------------------------------+
\ Key /
|-----------------------------------------------------------------------------|
/ Value \
+-------------------------------------------------------------------------------+
2024-12-05 16:21:52 +01:00
```