2017-10-16 22:00:19 +00:00
|
|
|
PROTOCOL
|
|
|
|
|
2017-10-18 21:59:50 +00:00
|
|
|
all numbers are packed unless stated otherwise
|
2017-10-16 22:00:19 +00:00
|
|
|
packed values are msb
|
|
|
|
|
2017-11-01 22:02:23 +00:00
|
|
|
strings are predefined sizes and are terminated at the
|
|
|
|
first NUL character (0x0). max string length is the region
|
|
|
|
length minus one, for the required NUL.
|
2017-10-25 22:00:19 +00:00
|
|
|
|
2017-10-18 21:59:50 +00:00
|
|
|
byte n is b.n
|
|
|
|
region n is r.n
|
2017-10-16 22:00:19 +00:00
|
|
|
|
|
|
|
---
|
|
|
|
|
2017-10-25 22:00:19 +00:00
|
|
|
byte the zero: 0xDE
|
|
|
|
byte the one: 0xAD
|
|
|
|
byte the two: packet id
|
|
|
|
byte the 3-6: total body length - uint
|
2017-10-16 22:00:19 +00:00
|
|
|
|
2017-10-18 21:59:50 +00:00
|
|
|
byte the bytes after the header octet bytes bytes:
|
2017-10-16 22:00:19 +00:00
|
|
|
raw body data shoved next to each other with no separation
|
|
|
|
|
|
|
|
---
|
2017-10-18 21:59:50 +00:00
|
|
|
|
|
|
|
client -> server
|
|
|
|
id 0: registration attempt
|
2017-11-01 22:02:23 +00:00
|
|
|
r.0 - username - string (max 9b)
|
2017-10-18 21:59:50 +00:00
|
|
|
r.1 - pin - ushort (max 9999)
|
|
|
|
|
|
|
|
id 1: login attempt
|
2017-11-01 22:02:23 +00:00
|
|
|
r.0 - username - string (max 9b)
|
2017-10-18 21:59:50 +00:00
|
|
|
r.1 - pin - ushort (max 9999)
|
|
|
|
|
|
|
|
id 2: ctx change response
|
|
|
|
r.0 - ack - bool
|
|
|
|
r.1 - ctx id - ushort
|
|
|
|
|
|
|
|
---
|
2017-10-16 22:00:19 +00:00
|
|
|
|
|
|
|
server -> client
|
2017-10-18 21:59:50 +00:00
|
|
|
id 0: registration response
|
|
|
|
r.0 - succeeded - bool
|
2017-11-01 22:02:23 +00:00
|
|
|
r.1 - status - string (17b)
|
2017-10-16 22:00:19 +00:00
|
|
|
|
2017-10-18 21:59:50 +00:00
|
|
|
id 1: login response
|
2017-11-01 22:02:23 +00:00
|
|
|
r.0 - succeeded - bool
|
2017-10-26 21:56:07 +00:00
|
|
|
r.1 - user id - ushort
|
2017-11-01 22:02:23 +00:00
|
|
|
r.2 - status - string (17b)
|
2017-10-18 21:59:50 +00:00
|
|
|
|
|
|
|
id 2: ctx change request
|
|
|
|
r.0 - ctx id - ushort
|