From 9d12555fba786b0e820a530efbfb574b5ad13245 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Wed, 24 May 2017 19:04:17 +0200 Subject: [PATCH] serial-dmm: Use a custom dummy struct for m2110. This DMM/parser is not related to metex14, don't use that struct. --- src/hardware/serial-dmm/api.c | 6 ++++-- src/libsigrok-internal.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index a54fe03f..e39480e9 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -426,14 +426,16 @@ SR_REGISTER_DEV_DRIVER_LIST(serial_dmm_drivers, &sr_fs9922_z1_diode ), /* }}} */ - /* metex14 based meters {{{ */ + /* m2110 based meters {{{ */ DMM( - "bbcgm-2010", metex14, + "bbcgm-2010", m2110, "BBC Goertz Metrawatt", "M2110", "1200/7n2", 1200, BBCGM_M2110_PACKET_SIZE, 0, 0, NULL, sr_m2110_packet_valid, sr_m2110_parse, NULL ), + /* }}} */ + /* metex14 based meters {{{ */ DMM( "mastech-mas345", metex14, "MASTECH", "MAS345", "600/7n2/rts=0/dtr=1", 600, diff --git a/src/libsigrok-internal.h b/src/libsigrok-internal.h index fa4432fb..2e041a26 100644 --- a/src/libsigrok-internal.h +++ b/src/libsigrok-internal.h @@ -1210,6 +1210,9 @@ SR_PRIV int sr_dtm0660_parse(const uint8_t *buf, float *floatval, #define BBCGM_M2110_PACKET_SIZE 9 +/* Dummy info struct. The parser does not use it. */ +struct m2110_info { int dummy; }; + SR_PRIV gboolean sr_m2110_packet_valid(const uint8_t *buf); SR_PRIV int sr_m2110_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info);