]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/teleinfo/protocol.c
Build: Include <config.h> first in all source files
[libsigrok.git] / src / hardware / teleinfo / protocol.c
index a610173d1aaaa20421d2716bf44b3e7eaf8f42cd..94af473bbf5a2812fbefcd2e8c0d19b27bfe2f98 100644 (file)
@@ -17,6 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
@@ -81,9 +82,8 @@ static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *channel_nam
        g_slist_free(analog.channels);
 }
 
-static void teleinfo_handle_mesurement(struct sr_dev_inst *sdi,
-                                       const char *label, const char *data,
-                                       char *optarif)
+static void teleinfo_handle_measurement(struct sr_dev_inst *sdi,
+               const char *label, const char *data, char *optarif)
 {
        struct dev_context *devc;
        int v = atoi(data);
@@ -135,7 +135,7 @@ static gboolean teleinfo_parse_group(struct sr_dev_inst *sdi,
                return FALSE;
        if (!teleinfo_control_check(label, data, control))
                return FALSE;
-       teleinfo_handle_mesurement(sdi, label, data, optarif);
+       teleinfo_handle_measurement(sdi, label, data, optarif);
        return TRUE;
 }
 
@@ -196,7 +196,7 @@ SR_PRIV int teleinfo_receive_data(int fd, int revents, void *cb_data)
 
        /* Try to get as much data as the buffer can hold. */
        len = TELEINFO_BUF_SIZE - devc->buf_len;
-       len = serial_read(serial, devc->buf + devc->buf_len, len);
+       len = serial_read_nonblocking(serial, devc->buf + devc->buf_len, len);
        if (len < 1) {
                sr_err("Serial port read error: %d.", len);
                return FALSE;