Code

ted plugin: Don't expect a minimum length.
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 14 Mar 2009 17:49:52 +0000 (18:49 +0100)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Sat, 14 Mar 2009 17:49:52 +0000 (18:49 +0100)
The serial interface apparently can only deliver 255 bytes at once, so
checking if we received ``enough'' (i. e. 278+x) bytes will never work.

src/ted.c

index 57c888985fede9da56bbfa655b46fb4921af15f4..d2a73a538fb4580b66e4f178fca19ad459b77256 100644 (file)
--- a/src/ted.c
+++ b/src/ted.c
@@ -154,13 +154,6 @@ static int ted_read_value(double *ret_power, double *ret_voltage)
                     receive_buffer_length);
             return (-1);
         }
-        else if (receive_buffer_length < EXPECTED_PACKAGE_LENGTH)
-        {
-            WARNING ("ted plugin: read(2) returned %zi bytes, "
-                    "but at least %i are necessary for a valid packet.",
-                    receive_buffer_length, EXPECTED_PACKAGE_LENGTH);
-            return (-1);
-        }
 
         /*
          * packet filter loop