Skip to content

Commit

Permalink
Added parser documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tbnobody committed May 30, 2024
1 parent 5af7e67 commit 3a4f70d
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 3 deletions.
22 changes: 21 additions & 1 deletion lib/Hoymiles/src/parser/AlarmLogParser.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstring>
Expand Down
27 changes: 26 additions & 1 deletion lib/Hoymiles/src/parser/DevInfoParser.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstring>
Expand Down
17 changes: 17 additions & 0 deletions lib/Hoymiles/src/parser/GridProfileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <cstring>
Expand Down
16 changes: 15 additions & 1 deletion lib/Hoymiles/src/parser/SystemConfigParaParser.cpp
Original file line number Diff line number Diff line change
@@ -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 <cstring>
Expand Down

0 comments on commit 3a4f70d

Please sign in to comment.