uni-t-dmm/serial-dmm: Handle Voltcraft VC-840 temperature.

This commit is contained in:
Uwe Hermann 2013-05-01 01:56:30 +02:00
parent ad00a54da6
commit 4853559466
5 changed files with 18 additions and 4 deletions

View 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;
}
}

View 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,
},

View 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;

View 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,
},
};

View 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 -----------------------------------------*/