[vz-dev] vz absturz bei defekter SML Message (patch)

Peter Evertz leo2 at pec.homeip.net
Mon Apr 8 11:51:37 CEST 2013


Ich habe einen kleinen Fehler im vzlogger gefunden: 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-dev mailing list