]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/appa-55ii/protocol.c
drivers: Factor out std_*_idx*().
[libsigrok.git] / src / hardware / appa-55ii / protocol.c
index a7cfd48dd62ca71bebb31eef61e0f60725c9aed4..f31b08b806b9199669467d5bec567c9b16c260db 100644 (file)
 #include "protocol.h"
 
 typedef enum {
-    LIVE_DATA    = 0x00,
-    LOG_METADATA = 0x11,
-    LOG_DATA     = 0x14,
-    LOG_START    = 0x18,
-    LOG_END      = 0x19,
+       LIVE_DATA    = 0x00,
+       LOG_METADATA = 0x11,
+       LOG_DATA     = 0x14,
+       LOG_START    = 0x18,
+       LOG_END      = 0x19,
 } packet_type;
 
 static gboolean appa_55ii_checksum(const uint8_t *buf)
@@ -163,7 +163,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]);
 
-               sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+               sr_analog_init(&analog, &encoding, &meaning, &spec, 1);
                analog.num_samples = 1;
                analog.meaning->mq = SR_MQ_TEMPERATURE;
                analog.meaning->unit = SR_UNIT_CELSIUS;
@@ -224,7 +224,7 @@ static void appa_55ii_log_end(struct sr_dev_inst *sdi)
        if (devc->data_source != DATA_SOURCE_MEMORY)
                return;
 
-       sdi->driver->dev_acquisition_stop(sdi);
+       sr_dev_acquisition_stop(sdi);
 }
 
 static const uint8_t *appa_55ii_parse_data(struct sr_dev_inst *sdi,
@@ -309,7 +309,7 @@ SR_PRIV int appa_55ii_receive_data(int fd, int revents, void *cb_data)
        }
 
        if (sr_sw_limits_check(&devc->limits)) {
-               sdi->driver->dev_acquisition_stop(sdi);
+               sr_dev_acquisition_stop(sdi);
                return TRUE;
        }