]> sigrok.org Git - libsigrok.git/commitdiff
uni-t-dmm/serial-dmm: Handle Voltcraft VC-840 temperature.
authorUwe Hermann <redacted>
Tue, 30 Apr 2013 23:56:30 +0000 (01:56 +0200)
committerUwe Hermann <redacted>
Tue, 30 Apr 2013 23:58:42 +0000 (01:58 +0200)
hardware/common/dmm/fs9721.c
hardware/serial-dmm/api.c
hardware/serial-dmm/protocol.c
hardware/uni-t-dmm/api.c
libsigrok-internal.h

index 6a55c716da69cecd0c7c04554f4f57fcf7b8b4b3..a914add8f414a26db59e90adb38d031d9519fd96 100644 (file)
@@ -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;
+       }
+}
index 89ea0dc82d95f5b120000551c1a28ffc160ee02a..c0eeba04cc9b5e6c7123ecac0ac52c25b42d7293 100644 (file)
@@ -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,
        },
index 04d0dc69caeb0ca19da433c83edd7e91f987303f..6e69758667922cf17129f376571988348f8b940b 100644 (file)
@@ -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;
index e2a15d98722308188bcb1f66e13496185650eb6e..1e8a621ccc59cf6b9ce51d909196ee15334c497b 100644 (file)
@@ -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,
        },
 };
index 6e1cac2d969ee9739d0b1e76b6dc62be20c6942e..4396cc1590be97d25afa7469ab97cca06e145300 100644 (file)
@@ -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 -----------------------------------------*/