]> sigrok.org Git - libsigrok.git/blobdiff - hardware/brymen-dmm/protocol.c
Replace 'probe' with 'channel' in most places.
[libsigrok.git] / hardware / brymen-dmm / protocol.c
index 4456568a110df68184eac7c37030c242c56d44ca..664258aa72f53fb3cc06799176d51b5eb12e24a6 100644 (file)
 
 #include "protocol.h"
 
-/* parser.c */
-SR_PRIV int sr_brymen_parse(const uint8_t *buf, float *floatval,
-                           struct sr_datafeed_analog *analog, void *info);
-
 static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi)
 {
        float floatval;
@@ -35,10 +31,11 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi)
        analog.num_samples = 1;
        analog.mq = -1;
 
-       sr_brymen_parse(buf, &floatval, &analog, NULL);
+       if (brymen_parse(buf, &floatval, &analog, NULL) != SR_OK)
+               return;
        analog.data = &floatval;
 
-       analog.probes = sdi->probes;
+       analog.channels = sdi->channels;
 
        if (analog.mq != -1) {
                /* Got a measurement. */
@@ -186,8 +183,8 @@ SR_PRIV int brymen_stream_detect(struct sr_serial_dev_inst *serial,
 
        maxlen = *buflen;
 
-       sr_dbg("Detecting packets on FD %d (timeout = %" PRIu64
-              "ms, baudrate = %d).", serial->fd, timeout_ms, baudrate);
+       sr_dbg("Detecting packets on %s (timeout = %" PRIu64
+              "ms, baudrate = %d).", serial->port, timeout_ms, baudrate);
 
        /* Assume 8n1 transmission. That is 10 bits for every byte. */
        byte_delay_us = 10 * (1000000 / baudrate);