1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 07:23:09 +02:00
antorcha/doc/PROTOCOL

82 lines
1.7 KiB
Plaintext

Protocol
========
<Type> <Seq> <MaxSeq>
0 0 X Ping (no further payload)
1 0 0 Pong (maybe return version string in the future)
2 0 0 Reset (64 bytes reset secret)
4 0 N Unlock secret (64 bytes payload)
4 1..N-1 N Firmware binary (64 bytes payload)
4 N N First half of hash
5 n N Firmware ACK
6 0..N-1 N+3 Image binary (64 bytes payload)
6 N N+3 Salt A
6 N+1 N+3 Salt B
6 N+2 N+3 Hash A
6 N+3 N+3 Hash B
7 n 0 Image ACK
8 0 4 Parameter block (64 bytes payload)
8 1 4 Salt A
8 2 4 Salt B
8 3 4 Hash A
8 4 4 Hash B
9 n 0 Parameter ACK
10 0 0 Sample (64 bytes payload)
11 0 0 Sample ACK
13 n 0 Samples
14 0 4 Diagnostic request (64 bytes payload)
14 1 4 Salt A
14 2 4 Salt B
14 3 4 Hash A
14 4 4 Hash B
15 n 0 Diagnostic response (with payload)
Unlock, firmware, image, and parameter packets all have a fixed-size
64 bytes payload. Pings and acknowledgements have no payload. Pongs
may have a variable-size payload.
Even numbered packet types correspond to packets sent from the remote
controller to the device. Odd numbered packet types correspond to
responses. The device never initiates communication.
Image format
============
Two bytes per line. LSB of first byte is LED A1, MSB of last byte is B8.
Unused lines must be set to zero.
Sample format
=============
Each sample packet has the following structure:
Offset Size
0 2 Absolute time of X sample, high 16 bits
2 8*N N samples
Where each sample is
Offset Size
0 2 Absolute time of X sample, lower 16 bits
2 2 X sample (0-1023)
4 2 Absolute time of Y sample, lower 16 bits
6 2 Y sample (0-1023)
Byte order is little-endian.