]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/fluke-dmm/fluke.c
dmm: Convert to SR_DF_ANALOG.
[libsigrok.git] / src / hardware / fluke-dmm / fluke.c
index c6ab4b01a35802a3357125c1958bfbdf809bf179..3261390deb405d664ece57cfea210e73c0839990 100644 (file)
@@ -399,9 +399,9 @@ static void handle_qm_19x_data(const struct sr_dev_inst *sdi, char **tokens)
        analog.mqflags = 0;
        packet.type = SR_DF_ANALOG_OLD;
        packet.payload = &analog;
-       sr_session_send(devc->cb_data, &packet);
-       devc->num_samples++;
+       sr_session_send(sdi, &packet);
 
+       sr_sw_limits_update_samples_read(&devc->limits, 1);
 }
 
 static void handle_line(const struct sr_dev_inst *sdi)
@@ -433,7 +433,7 @@ static void handle_line(const struct sr_dev_inst *sdi)
                if (devc->profile->model == FLUKE_187 || devc->profile->model == FLUKE_189) {
                        devc->expect_response = FALSE;
                        analog = handle_qm_18x(sdi, tokens);
-               } else if (devc->profile->model == FLUKE_287) {
+               } else if (devc->profile->model == FLUKE_287 || devc->profile->model == FLUKE_289) {
                        devc->expect_response = FALSE;
                        analog = handle_qm_28x(sdi, tokens);
                } else if (devc->profile->model == FLUKE_190) {
@@ -467,8 +467,8 @@ static void handle_line(const struct sr_dev_inst *sdi)
                /* Got a measurement. */
                packet.type = SR_DF_ANALOG_OLD;
                packet.payload = analog;
-               sr_session_send(devc->cb_data, &packet);
-               devc->num_samples++;
+               sr_session_send(sdi, &packet);
+               sr_sw_limits_update_samples_read(&devc->limits, 1);
                g_free(analog->data);
                g_free(analog);
        }
@@ -508,8 +508,8 @@ SR_PRIV int fluke_receive_data(int fd, int revents, void *cb_data)
                }
        }
 
-       if (devc->limit_samples && devc->num_samples >= devc->limit_samples) {
-               sdi->driver->dev_acquisition_stop(sdi, cb_data);
+       if (sr_sw_limits_check(&devc->limits)) {
+               sdi->driver->dev_acquisition_stop(sdi);
                return TRUE;
        }