From 3a4f70dc75b25ddf08342542e819858bed423471 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Thu, 30 May 2024 23:27:29 +0200 Subject: [PATCH] Added parser documentation --- lib/Hoymiles/src/parser/AlarmLogParser.cpp | 22 ++++++++++++++- lib/Hoymiles/src/parser/DevInfoParser.cpp | 27 ++++++++++++++++++- lib/Hoymiles/src/parser/GridProfileParser.cpp | 17 ++++++++++++ .../src/parser/SystemConfigParaParser.cpp | 16 ++++++++++- 4 files changed, 79 insertions(+), 3 deletions(-) diff --git a/lib/Hoymiles/src/parser/AlarmLogParser.cpp b/lib/Hoymiles/src/parser/AlarmLogParser.cpp index 652159002..e08baf052 100644 --- a/lib/Hoymiles/src/parser/AlarmLogParser.cpp +++ b/lib/Hoymiles/src/parser/AlarmLogParser.cpp @@ -1,7 +1,27 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2022-2023 Thomas Basler and others + * Copyright (C) 2022-2024 Thomas Basler and others */ + +/* +This parser is used to parse the response of 'AlarmDataCommand'. + +Data structure: +* wcode: + * right 8 bit: Event ID + * bit 13: Start time = PM (12h has to be added to start time) + * bit 12: End time = PM (12h has to be added to start time) +* Start: 12h based start time of the event (PM indicator in wcode) +* End: 12h based start time of the event (PM indicator in wcode) + +00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 00 01 02 03 04 05 06 07 08 09 10 11 + |<-------------- First log entry -------------->| |<->| +----------------------------------------------------------------------------------------------------------------------------- +95 80 14 82 66 80 14 33 28 01 00 01 80 01 00 01 91 EA 91 EA 00 00 00 00 00 8F 65 -- -- -- -- -- +^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ ^^ ^^ ^^ ^^^^^ ^^ +ID Source Addr Target Addr Idx ? wcode ? Start End ? ? ? ? wcode CRC8 +*/ #include "AlarmLogParser.h" #include "../Hoymiles.h" #include diff --git a/lib/Hoymiles/src/parser/DevInfoParser.cpp b/lib/Hoymiles/src/parser/DevInfoParser.cpp index 26e3c9d4f..c34ecb3f0 100644 --- a/lib/Hoymiles/src/parser/DevInfoParser.cpp +++ b/lib/Hoymiles/src/parser/DevInfoParser.cpp @@ -1,7 +1,32 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2022 - 2023 Thomas Basler and others + * Copyright (C) 2022 - 2024 Thomas Basler and others */ + +/* +This parser is used to parse the response of 'DevInfoAllCommand' and 'DevInfoSimpleCommand'. +It contains version information of the hardware and firmware. It can also be used to determine +the exact inverter type. + +Data structure (DevInfoAllCommand): + +00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 00 01 02 03 04 05 06 07 08 09 10 11 12 13 +------------------------------------------------------------------------------------------------------------------------------------------------- +95 80 14 82 66 80 14 33 28 81 27 1C 07 E5 04 01 07 2D 00 01 00 00 00 00 DF DD 1E -- -- -- -- -- +^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ +ID Source Addr Target Addr Idx FW Version FW Year FW Month/Date FW Hour/Minute Bootloader ? ? CRC16 CRC8 + + +Data structure (DevInfoSimpleCommand): + +00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 00 01 02 03 04 05 06 07 08 09 10 11 12 13 +------------------------------------------------------------------------------------------------------------------------------------------------- +95 80 14 82 66 80 14 33 28 81 27 1C 10 12 71 01 01 00 0A 00 20 01 00 00 E5 F8 95 +^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^^^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ +ID Source Addr Target Addr Idx FW Version HW Part No. HW Version ? ? ? CRC16 CRC8 +*/ #include "DevInfoParser.h" #include "../Hoymiles.h" #include diff --git a/lib/Hoymiles/src/parser/GridProfileParser.cpp b/lib/Hoymiles/src/parser/GridProfileParser.cpp index 7c08d51b0..74fcf6531 100644 --- a/lib/Hoymiles/src/parser/GridProfileParser.cpp +++ b/lib/Hoymiles/src/parser/GridProfileParser.cpp @@ -2,6 +2,23 @@ /* * Copyright (C) 2023 - 2024 Thomas Basler and others */ + +/* +This parser is used to parse the response of 'GridOnProFilePara'. +It contains the whole grid profile of the inverter. + +Data structure: + +00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 00 01 02 03 04 05 06 07 08 09 10 11 12 13 + |<---------- Returns till the end of the payload ---------->| +--------------------------------------------------------------------------------------------------------------------------------------------------------------- +95 80 14 82 66 80 14 33 28 01 0A 00 20 01 00 0C 08 FC 07 A3 00 0F 09 E2 00 1E E6 -- -- -- -- -- +^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ ^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ +ID Source Addr Target Addr Idx Profile ID Profile Version Section ID Section Version Value Value Value Value CRC16 CRC8 + +The number of values depends on the respective section and its version. After the last value of a section follows the next section id. +*/ #include "GridProfileParser.h" #include "../Hoymiles.h" #include diff --git a/lib/Hoymiles/src/parser/SystemConfigParaParser.cpp b/lib/Hoymiles/src/parser/SystemConfigParaParser.cpp index e866e8749..346b5d468 100644 --- a/lib/Hoymiles/src/parser/SystemConfigParaParser.cpp +++ b/lib/Hoymiles/src/parser/SystemConfigParaParser.cpp @@ -1,7 +1,21 @@ // SPDX-License-Identifier: GPL-2.0-or-later /* - * Copyright (C) 2022 - 2023 Thomas Basler and others + * Copyright (C) 2022 - 2024 Thomas Basler and others */ + +/* +This parser is used to parse the response of 'SystemConfigParaCommand'. +It contains the set inverter limit. + +Data structure: + +00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 + 00 01 02 03 04 05 06 07 08 09 10 11 12 13 +--------------------------------------------------------------------------------------------------------------------------------- +95 80 14 82 66 80 14 33 28 81 00 01 03 E8 00 00 03 E8 00 00 00 00 00 00 3C F8 2E -- -- -- -- -- +^^ ^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^^^^ ^^ +ID Source Addr Target Addr Idx ? Limit percent ? ? ? ? ? CRC16 CRC8 +*/ #include "SystemConfigParaParser.h" #include "../Hoymiles.h" #include