From 7e3523ec42a9e19c0b124407cb5cd6332bf658e1 Mon Sep 17 00:00:00 2001 From: Martin Preuss Date: Thu, 5 Sep 2024 23:04:01 +0200 Subject: [PATCH] avr: improved MESSAGES documentation. --- avr/modules/comproto/MESSAGES | 156 +++++++--------------------------- 1 file changed, 29 insertions(+), 127 deletions(-) diff --git a/avr/modules/comproto/MESSAGES b/avr/modules/comproto/MESSAGES index 64cee6e..776e125 100644 --- a/avr/modules/comproto/MESSAGES +++ b/avr/modules/comproto/MESSAGES @@ -2,9 +2,8 @@ General Message Format ====================== -Currently messages can maximally use 22 bytes for data because: +Currently messages can maximally use 21 bytes for data because: - maximum buffer size if 24 bytes -- the internal buffer needs an additional flags byte - a message contains a checksum byte @@ -12,6 +11,7 @@ Offset Length Meaning --------------------------------------------------------- 0 1 destination address 1 1 remaining message length +--------------------------------------------------------- 2 1 command code 3 1 source address --------------------------------------------------------- @@ -28,8 +28,11 @@ Offset Length Meaning --------------------------------------------------------- 0 1 destination address 1 1 remaining message length +--------------------------------------------------------- 2 1 command code 3 1 source address +--------------------------------------------------------- + 4 1 CRC8 byte @@ -40,8 +43,11 @@ Offset Length Meaning --------------------------------------------------------- 0 1 destination address 1 1 remaining message length +--------------------------------------------------------- 2 1 command code 3 1 source address +--------------------------------------------------------- + 4 1 CRC8 byte @@ -54,11 +60,14 @@ 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 @@ -69,107 +78,18 @@ 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 - - - -FLASH_START Message -=================== - -Offset Length Meaning --------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 2 message number - 6 2 address + 6 1 CRC8 byte -FLASH_ADDR Message -================== - -Offset Length Meaning ---------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 2 message number - 6 2 address - - - -FLASH_DATA Message -================== - -Offset Length Meaning ---------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 2 message number - 6 n up to 8 words to write at given address - - - -FLASH_END Message -================= - -Offset Length Meaning ---------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 2 message number - - - -Flash_Response Message -====================== - -Offset Length Meaning ---------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 2 message number - 6 1 response code (0 if okay, error code otherwise) - - - -VALUE2 Message (deprecated) -============== - -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 value id - 9 1 value type - 10 2 value - 12 2 denom - - - -VALUE3 Message +VALUE Message ============== Offset Length Meaning @@ -185,6 +105,7 @@ Offset Length Meaning 7 1 value type 8 2 value 10 2 denom +--------------------------------------------------------- 12 1 CRC8 byte @@ -209,6 +130,7 @@ Offset Length Meaning 17 1 firmware version: major 18 1 firmware version: minor 19 1 firmware version: patchlevel +--------------------------------------------------------- 20 1 CRC8 byte @@ -228,6 +150,8 @@ Offset Length Meaning 8 2 packets out 10 2 collisions 12 2 line busy errors +--------------------------------------------------------- + 14 1 CRC8 byte @@ -249,6 +173,8 @@ Offset Length Meaning 14 2 no buffer errors 16 2 handled packets 18 2 missed packets +--------------------------------------------------------- + 20 1 CRC8 byte @@ -266,6 +192,8 @@ Offset Length Meaning 3 1 source address --------------------------------------------------------- 4 4 UID +--------------------------------------------------------- + 8 1 CRC8 byte @@ -290,6 +218,8 @@ Offset Length Meaning 18 1 firmware version: minor 19 1 firmware version: patchlevel 20 2 page size in bytes +--------------------------------------------------------- + 22 1 CRC8 byte @@ -306,6 +236,8 @@ Offset Length Meaning --------------------------------------------------------- 4 2 address 6 n data bytes (max 124 bytes) +--------------------------------------------------------- + 6+n 1 CRC8 byte @@ -321,6 +253,8 @@ Offset Length Meaning 3 1 source address --------------------------------------------------------- 4 1 reason (0 if okay, error code to abort) +--------------------------------------------------------- + 5 1 CRC8 byte @@ -336,40 +270,8 @@ Offset Length Meaning 3 1 source address --------------------------------------------------------- 4 1 response code - - - -Config Module Request Message -============================= - -Offset Length Meaning --------------------------------------------------------- - 0 1 destination address - 1 1 remaining message length ---------------------------------------------------------- - 2 1 command code - 3 1 source address ---------------------------------------------------------- - 4 1 module id - 5 1 module command - 6 n command data (depending on module and command) - - - -Config Module Response 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