]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/mic-985xx/protocol.c
fluke-dmm: Add support for the Fluke 289.
[libsigrok.git] / src / hardware / mic-985xx / protocol.c
index 9e3d9863b3bbc1aa16392c920e8c6b68a041e448..4ee11b70c8e3ce2e626570487e82db5298db0d9f 100644 (file)
@@ -25,7 +25,8 @@ static int mic_send(struct sr_serial_dev_inst *serial, const char *cmd)
 {
        int ret;
 
-       if ((ret = serial_write_blocking(serial, cmd, strlen(cmd), 0)) < 0) {
+       if ((ret = serial_write_blocking(serial, cmd, strlen(cmd),
+                       serial_timeout(serial, strlen(cmd)))) < 0) {
                sr_err("Error sending '%s' command: %d.", cmd, ret);
                return SR_ERR;
        }
@@ -94,7 +95,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
 {
        float temperature, humidity;
        struct sr_datafeed_packet packet;
-       struct sr_datafeed_analog2 analog;
+       struct sr_datafeed_analog analog;
        struct sr_analog_encoding encoding;
        struct sr_analog_meaning meaning;
        struct sr_analog_spec spec;
@@ -115,7 +116,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx)
        sr_analog_init(&analog, &encoding, &meaning, &spec, 3);
 
        /* Common values for both channels. */
-       packet.type = SR_DF_ANALOG2;
+       packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        analog.num_samples = 1;