[vz-users] Kleiner Bug im VZlogger
Peter Evertz
leo2 at pec.homeip.net
Sun Apr 7 22:36:24 CEST 2013
Manchmal sind die SML Messages kaputt und sml_transport_read liefert 0.
--- a/src/protocols/MeterSML.cpp
+++ b/src/protocols/MeterSML.cpp
@@ -152,6 +152,7 @@ ssize_t MeterSML::read(std::vector<Reading> &rds,
size_t n)
/* wait until a we receive a new datagram from the meter
(blocking read)
bytes = sml_transport_read(_fd, buffer, SML_BUFFER_LEN);
+ if(bytes == 0 ) return 0;
/* parse SML file & stripping escape sequences */
file = sml_file_parse(buffer + 8, bytes - 16);
More information about the volkszaehler-users
mailing list