# SOLEC protocol specification ## Data format * Payload can contain multiple numeric types or binary data in a single frame * Numeric types are big endian * See [test payload](#Test) for an example of complex data structure ### Frame structure | Type | Description | |----------|----------------| | `uint8` | Payload type | | `uint16` | Payload length | | `any` | Payload | ### Special types #### Strings and binary Strings and binary data are prefixed wtith 2 bytes denoting their length. Strings are UTF-8 encoded. #### Timestamps Timestamps are stored as `uint64` in [Unix format](https://en.wikipedia.org/wiki/Unix_time). Timezone is always set to UTC. ### Payloads All payload types are described in following files: * [Kaitai Struct](https://git.sr.ht/~rctt/solec/blob/main/solec.ksy) * [SVG graph](https://git.sr.ht/~rctt/solec/blob/main/solec.svg) ### Payload types | Type | Name | |------|--------------| | 0x01 | Handshake | | 0x02 | Ping | | 0x03 | Pong | | 0x04 | Message | | 0xFF | Test |