From: Alexandru Gagniuc Date: Thu, 13 Dec 2012 18:35:06 +0000 (-0600) Subject: serial-dmm: Use dummy info struct for rs9lcd parser X-Git-Tag: dsupstream~458 X-Git-Url: https://sigrok.org/gitweb/?a=commitdiff_plain;h=e7ed87a469cb3c997ec2e98bc2c39d4284d86252;p=libsigrok.git serial-dmm: Use dummy info struct for rs9lcd parser The rs9lcd parser, which is used for the RadioShack 22-812 does not use its *info parameter, and therefore did not have a rs9lcd_info struct declared. With recent re-factoring of the receive data callbacks, it became necessary to pass a struct pointer. This made the RECV_DATA macro look like: - RECV_DATA(RADIOSHACK_22_812, metex14) giving the wrong impression that the RadioShack 22-182 uses the metex14 protocol, which is not the case. Create a dummy rs9lcd_info struct, and correctly identify the parser as rs9lcd in the RECV_DATA macro: + RECV_DATA(RADIOSHACK_22_812, rs9lcd) Signed-off-by: Alexandru Gagniuc --- diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 156f88dd..f22e7b7a 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -201,4 +201,4 @@ RECV_DATA(METEX_M3640D, metex14) RECV_DATA(PEAKTECH_4370, metex14) RECV_DATA(PCE_PCE_DM32, fs9721) RECV_DATA(RADIOSHACK_22_168, metex14) -RECV_DATA(RADIOSHACK_22_812, metex14) +RECV_DATA(RADIOSHACK_22_812, rs9lcd) diff --git a/libsigrok-internal.h b/libsigrok-internal.h index d9f2bcd8..0dfbbe8a 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -210,6 +210,9 @@ SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval, #define RS9LCD_PACKET_SIZE 9 +/* Dummy info struct. The parser does not use it. */ +struct rs9lcd_info {}; + SR_PRIV gboolean sr_rs9lcd_packet_valid(const uint8_t *buf); SR_PRIV int sr_rs9lcd_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info);