]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/appa-55ii/protocol.c
Make memset() invocations consistent across all files.
[libsigrok.git] / src / hardware / appa-55ii / protocol.c
index 708262bd779403fd1cfd65f7c20afd7a3a89a8fa..a439a148d223dda736b3ebf4e9cf8a26bcf2c0c7 100644 (file)
@@ -102,7 +102,7 @@ static void appa_55ii_live_data(struct sr_dev_inst *sdi, const uint8_t *buf)
                return;
 
        val_ptr = values;
-       memset(&analog, 0, sizeof(analog));
+       memset(&analog, 0, sizeof(struct sr_datafeed_analog));
        analog.num_samples = 1;
        analog.mq = SR_MQ_TEMPERATURE;
        analog.unit = SR_UNIT_CELSIUS;
@@ -154,7 +154,7 @@ static void appa_55ii_log_data_parse(struct sr_dev_inst *sdi)
                /* FIXME: Timestamp should be sent in the packet. */
                sr_dbg("Timestamp: %02d:%02d:%02d", buf[2], buf[3], buf[4]);
 
-               memset(&analog, 0, sizeof(analog));
+               memset(&analog, 0, sizeof(struct sr_datafeed_analog));
                analog.num_samples = 1;
                analog.mq = SR_MQ_TEMPERATURE;
                analog.unit = SR_UNIT_CELSIUS;
@@ -277,7 +277,7 @@ SR_PRIV int appa_55ii_receive_data(int fd, int revents, void *cb_data)
 
        /* Try to get as much data as the buffer can hold. */
        len = sizeof(devc->buf) - 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;