diff --git a/etc/vzlogger_generic.schema.json b/etc/vzlogger_generic.schema.json index e0bdbabf..86e1bd4a 100644 --- a/etc/vzlogger_generic.schema.json +++ b/etc/vzlogger_generic.schema.json @@ -517,6 +517,11 @@ "type": "boolean", "default": false, "description": "use the local time for reading timestamp?" + }, + "dzg_fix_negative_values": { + "type": "boolean", + "default": false, + "description": "work around wrongly encoded negative values on some DZG meters" } }, "required": ["protocol", "device", "baudrate", "parity"] @@ -559,6 +564,11 @@ "type": "boolean", "default": false, "description": "use the local time for reading timestamp?" + }, + "dzg_fix_negative_values": { + "type": "boolean", + "default": false, + "description": "work around wrongly encoded negative values on some DZG meters" } }, "required": ["protocol", "host", "baudrate", "parity"] diff --git a/include/protocols/MeterSML.hpp b/include/protocols/MeterSML.hpp index fe305652..a5f61236 100644 --- a/include/protocols/MeterSML.hpp +++ b/include/protocols/MeterSML.hpp @@ -65,6 +65,7 @@ class MeterSML : public vz::protocol::Protocol { parity_type_t _parity; std::string _pull; bool _use_local_time; + sml_workarounds _sml_workarounds; int _fd; /* file descriptor of port */ struct termios _old_tio; /* required to reset port */ diff --git a/src/protocols/MeterSML.cpp b/src/protocols/MeterSML.cpp index 5bdaf33e..42aa2bb7 100644 --- a/src/protocols/MeterSML.cpp +++ b/src/protocols/MeterSML.cpp @@ -57,7 +57,7 @@ #define SML_BUFFER_LEN 8096 MeterSML::MeterSML(std::list