]> sigrok.org Git - libsigrok.git/blobdiff - hardware/brymen-dmm/protocol.c
build: Portability fixes.
[libsigrok.git] / hardware / brymen-dmm / protocol.c
index 230b60d38cce655c872d0a97c772ed01052f4bf9..dff7b985bfe071a8c6f90af6e14719c8aff81fbe 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. */
@@ -177,7 +174,7 @@ SR_PRIV int brymen_dmm_receive_data(int fd, int revents, void *cb_data)
 SR_PRIV int brymen_stream_detect(struct sr_serial_dev_inst *serial,
                                uint8_t *buf, size_t *buflen,
                                packet_length_t get_packet_size,
-                               packet_valid_t is_valid,
+                               packet_valid_callback is_valid,
                                uint64_t timeout_ms, int baudrate)
 {
        int64_t start, time, byte_delay_us;