now again use three messages to transmit stats (much more efficient than sending single values, also more acurate).
318 lines
8.7 KiB
Plaintext
318 lines
8.7 KiB
Plaintext
|
|
General Message Format
|
|
======================
|
|
|
|
Currently messages can maximally use 21 bytes for data because:
|
|
- maximum buffer size if 24 bytes
|
|
- a message contains a checksum byte
|
|
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 n payload data (depending on command code)
|
|
---------------------------------------------------------
|
|
4+n 1 CRC8 byte
|
|
|
|
|
|
|
|
PING Message
|
|
============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 CRC8 byte
|
|
|
|
|
|
|
|
PONG Message
|
|
============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 CRC8 byte
|
|
|
|
|
|
|
|
RESULT Message
|
|
==============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 2 ref msg id
|
|
6 1 result code
|
|
---------------------------------------------------------
|
|
7 1 CRC8 byte
|
|
|
|
|
|
|
|
Address Messages
|
|
================
|
|
|
|
This includes HAVE_ADDRESS, CLAIM_ADDRESS and DENY_ADDRESS.
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 UID of the sending node
|
|
8 1 bus address
|
|
---------------------------------------------------------
|
|
9 1 CRC8 byte
|
|
|
|
|
|
|
|
RANGE Message
|
|
=============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 first available address
|
|
5 1 last available address
|
|
---------------------------------------------------------
|
|
6 1 CRC8 byte
|
|
|
|
|
|
|
|
VALUE Message
|
|
==============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code (REPORT_VALUE, REQ_SET_VALUE, RSP_SET_VALUE)
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 UID of the sending node
|
|
8 2 msg id/ref msg id
|
|
10 1 value id
|
|
11 1 value type
|
|
12 2 value
|
|
14 2 denom
|
|
---------------------------------------------------------
|
|
16 1 CRC8 byte
|
|
|
|
|
|
|
|
DEVICE Message
|
|
==============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 UID of the sending node
|
|
8 4 manufacturer
|
|
12 2 device type
|
|
14 1 device hw version
|
|
15 1 device hw revision
|
|
16 1 firmware variant (depends on hardware type)
|
|
17 1 firmware version: major
|
|
18 1 firmware version: minor
|
|
19 1 firmware version: patchlevel
|
|
---------------------------------------------------------
|
|
20 1 CRC8 byte
|
|
|
|
|
|
|
|
SENDSTATS Message
|
|
=================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 Interface number
|
|
5 4 UID of the sending node
|
|
9 2 packets out
|
|
11 2 collisions
|
|
13 2 line busy errors
|
|
---------------------------------------------------------
|
|
14 1 CRC8 byte
|
|
|
|
|
|
|
|
RECVSTATS Message
|
|
=================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 Interface number
|
|
5 4 UID of the sending node
|
|
9 2 packets in
|
|
11 2 content errors (invalid msg length, CRC errors)
|
|
13 2 io errors
|
|
15 2 no buffer errors
|
|
17 2 handled packets
|
|
19 2 missed packets
|
|
---------------------------------------------------------
|
|
21 1 CRC8 byte
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FLASHSTART Message
|
|
==================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 UID
|
|
---------------------------------------------------------
|
|
8 1 CRC8 byte
|
|
|
|
|
|
|
|
FLASHREADY Message
|
|
==================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 UID
|
|
8 4 manufacturer
|
|
12 2 device type
|
|
14 1 device hw version
|
|
15 1 device hw revision
|
|
16 1 firmware variant (depends on hardware type)
|
|
17 1 firmware version: major
|
|
18 1 firmware version: minor
|
|
19 1 firmware version: patchlevel
|
|
20 2 page size in bytes
|
|
---------------------------------------------------------
|
|
22 1 CRC8 byte
|
|
|
|
|
|
|
|
FLASHDATA Message
|
|
=================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 2 address
|
|
6 n data bytes (max 124 bytes)
|
|
---------------------------------------------------------
|
|
6+n 1 CRC8 byte
|
|
|
|
|
|
|
|
FLASHEND Message
|
|
================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 reason (0 if okay, error code to abort)
|
|
---------------------------------------------------------
|
|
5 1 CRC8 byte
|
|
|
|
|
|
|
|
FLASHRESPONSE Message
|
|
=====================
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 1 response code
|
|
---------------------------------------------------------
|
|
5 1 CRC8 byte
|
|
|
|
|
|
|
|
|
|
DATA Message
|
|
============
|
|
|
|
Offset Length Meaning
|
|
---------------------------------------------------------
|
|
0 1 destination address
|
|
1 1 remaining message length
|
|
---------------------------------------------------------
|
|
2 1 command code
|
|
3 1 source address
|
|
---------------------------------------------------------
|
|
4 4 ROM address
|
|
8 n data bytes
|
|
---------------------------------------------------------
|
|
8+n 1 CRC8 byte
|
|
|
|
|
|
|