From: Uwe Hermann Date: Tue, 30 Apr 2013 23:56:30 +0000 (+0200) Subject: uni-t-dmm/serial-dmm: Handle Voltcraft VC-840 temperature. X-Git-Tag: dsupstream~17 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=48535594664cc5d55db428cd8ca5ffba328be05a;p=libsigrok.git uni-t-dmm/serial-dmm: Handle Voltcraft VC-840 temperature. --- diff --git a/hardware/common/dmm/fs9721.c b/hardware/common/dmm/fs9721.c index 6a55c716..a914add8 100644 --- a/hardware/common/dmm/fs9721.c +++ b/hardware/common/dmm/fs9721.c @@ -368,3 +368,16 @@ SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, return SR_OK; } + +SR_PRIV void sr_fs9721_details_c2c1_00_temp_celsius(struct sr_datafeed_analog *analog, void *info) +{ + struct fs9721_info *info_local; + + info_local = (struct fs9721_info *)info; + + /* User-defined FS9721_LP3 flag 'c2c1_00' means temperature (C). */ + if (info_local->is_c2c1_00) { + analog->mq = SR_MQ_TEMPERATURE; + analog->unit = SR_UNIT_CELSIUS; + } +} diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 89ea0dc8..c0eeba04 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -155,7 +155,7 @@ SR_PRIV struct dmm_info dmms[] = { "Voltcraft", "VC-840 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1", 2400, FS9721_PACKET_SIZE, NULL, sr_fs9721_packet_valid, sr_fs9721_parse, - NULL, + sr_fs9721_details_c2c1_00_temp_celsius, &voltcraft_vc840_ser_driver_info, receive_data_VOLTCRAFT_VC840_SER, }, diff --git a/hardware/serial-dmm/protocol.c b/hardware/serial-dmm/protocol.c index 04d0dc69..6e697586 100644 --- a/hardware/serial-dmm/protocol.c +++ b/hardware/serial-dmm/protocol.c @@ -46,7 +46,7 @@ SR_PRIV void dmm_details_tp4000zc(struct sr_datafeed_analog *analog, void *info) info_local = (struct fs9721_info *)info; - /* User-defined FS9721_LP3 flag 'c2c1_10' means temperature. */ + /* User-defined FS9721_LP3 flag 'c2c1_10' means temperature (C). */ if (info_local->is_c2c1_10) { analog->mq = SR_MQ_TEMPERATURE; analog->unit = SR_UNIT_CELSIUS; @@ -59,7 +59,7 @@ SR_PRIV void dmm_details_va18b(struct sr_datafeed_analog *analog, void *info) info_local = (struct fs9721_info *)info; - /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature. */ + /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature (C). */ if (info_local->is_c2c1_01) { analog->mq = SR_MQ_TEMPERATURE; analog->unit = SR_UNIT_CELSIUS; diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index e2a15d98..1e8a621c 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -68,7 +68,7 @@ SR_PRIV struct dmm_info udmms[] = { "Voltcraft", "VC-840", 2400, FS9721_PACKET_SIZE, NULL, sr_fs9721_packet_valid, sr_fs9721_parse, - NULL, + sr_fs9721_details_c2c1_00_temp_celsius, &voltcraft_vc840_driver_info, receive_data_VOLTCRAFT_VC840, }, }; diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 6e1cac2d..4396cc15 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -228,6 +228,7 @@ struct fs9721_info { SR_PRIV gboolean sr_fs9721_packet_valid(const uint8_t *buf); SR_PRIV int sr_fs9721_parse(const uint8_t *buf, float *floatval, struct sr_datafeed_analog *analog, void *info); +SR_PRIV void sr_fs9721_details_c2c1_00_temp_celsius(struct sr_datafeed_analog *analog, void *info); /*--- hardware/common/dmm/metex14.c -----------------------------------------*/