0.0.3 • Published 5 years ago
@abckey/proto v0.0.3
abckey-proto
ABCKEY Protocol Buffers.
Install
npm i @abckey/proto
Usage
npm run build
Protocol
Messages are sent in packets of 64 bytes.
First packet has the following structure:
offset | length | type | contents |
---|---|---|---|
0 | 3 | char3 | '$##' magic constant |
3 | 2 | BE uint16_t | numerical types |
5 | 4 | BE uint32_t | message size |
9 | 55 | uint8_t55 | first 55 bytes of message encoded in Protocol Buffers (padded with zeroes if shorter) |
Following packets has the following structure:
offset | length | type | contents |
---|---|---|---|
0 | 1 | char1 | '$' magic constant |
1 | 63 | uint8_t63 | following bytes of message encoded in Protocol Buffers (padded with zeroes if shorter) |