From 2920a3a5fd4f0e2b6285eb4171b1f4b81875a790 Mon Sep 17 00:00:00 2001 From: r00t Date: Fri, 2 Apr 2021 05:33:15 +0200 Subject: [PATCH] [MeterChinaDC] crappy chinese hall-effect DC meter with serial output --- include/meter_protocol.hpp | 1 + include/protocols/MeterChinaDC.hpp | 60 +- src/Meter.cpp | 6 + src/Reading.cpp | 3 + src/protocols/CMakeLists.txt | 1 + src/protocols/MeterChinaDC.cpp | 1003 +++------------------------- 6 files changed, 122 insertions(+), 952 deletions(-) diff --git a/include/meter_protocol.hpp b/include/meter_protocol.hpp index 4ccdd6f0..0f80010b 100644 --- a/include/meter_protocol.hpp +++ b/include/meter_protocol.hpp @@ -38,5 +38,6 @@ typedef enum meter_procotol { meter_protocol_ocr, meter_protocol_w1therm, meter_protocol_oms, + meter_protocol_chinadc, } meter_protocol_t; #endif /* _meter_protocol_hpp_ */ diff --git a/include/protocols/MeterChinaDC.hpp b/include/protocols/MeterChinaDC.hpp index 98422ba5..a06a3d4b 100644 --- a/include/protocols/MeterChinaDC.hpp +++ b/include/protocols/MeterChinaDC.hpp @@ -1,13 +1,13 @@ /** - * Plaintext protocol according to DIN EN 62056-21 + * crappy chinese hall-effect DC meter with serial output * - * This protocol uses OBIS to identify the readout data - * And is also sometimes called "D0" + * (code based on MeterD0) * * @package vzlogger - * @copyright Copyright (c) 2011, The volkszaehler.org project + * @copyright Copyright (c) 2021, The volkszaehler.org project * @license http://www.gnu.org/licenses/gpl.txt GNU Public License * @author Steffen Vogel + * @author Thorben T. */ /* * This file is part of volkzaehler.org @@ -25,67 +25,33 @@ * You should have received a copy of the GNU General Public License * along with volkszaehler.org. If not, see . */ -// RW: added ack -#ifndef _D0_H_ -#define _D0_H_ - -#define D0_BUFFER_LENGTH 1024 +#ifndef _CHINADC_H_ +#define _CHINADC_H_ #include #include -class MeterD0 : public vz::protocol::Protocol { +class MeterChinaDC : public vz::protocol::Protocol { public: - MeterD0(std::list