return SR_OK;
}
+
+SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info)
+{
+ struct fs9922_info *info_local;
+
+ info_local = (struct fs9922_info *)info;
+
+ /* User-defined z1 flag means "diode mode". */
+ if (info_local->is_z1) {
+ analog->mq = SR_MQ_VOLTAGE;
+ analog->unit = SR_UNIT_VOLT;
+ analog->mqflags |= SR_MQFLAG_DIODE;
+ }
+}
receive_data_VOLTCRAFT_VC820_SER,
},
{
+ /*
+ * Note: The VC830 doesn't set the 'volt' and 'diode' bits of
+ * the FS9922 protocol. Instead, it only sets the user-defined
+ * bit "z1" to indicate "diode mode" and "voltage".
+ */
"Voltcraft", "VC-830 (UT-D02 cable)", "2400/8n1/rts=0/dtr=1",
2400, FS9922_PACKET_SIZE, NULL,
sr_fs9922_packet_valid, sr_fs9922_parse,
- NULL,
+ &sr_fs9922_z1_diode,
&voltcraft_vc830_ser_driver_info,
receive_data_VOLTCRAFT_VC830_SER,
},
&voltcraft_vc820_driver_info, receive_data_VOLTCRAFT_VC820,
},
{
+ /*
+ * Note: The VC830 doesn't set the 'volt' and 'diode' bits of
+ * the FS9922 protocol. Instead, it only sets the user-defined
+ * bit "z1" to indicate "diode mode" and "voltage".
+ */
"Voltcraft", "VC-830", 2400,
FS9922_PACKET_SIZE, NULL,
sr_fs9922_packet_valid, sr_fs9922_parse,
- NULL,
+ &sr_fs9922_z1_diode,
&voltcraft_vc830_driver_info, receive_data_VOLTCRAFT_VC830,
},
{
SR_PRIV gboolean sr_fs9922_packet_valid(const uint8_t *buf);
SR_PRIV int sr_fs9922_parse(const uint8_t *buf, float *floatval,
struct sr_datafeed_analog *analog, void *info);
+SR_PRIV void sr_fs9922_z1_diode(struct sr_datafeed_analog *analog, void *info);
/*--- hardware/common/dmm/fs9721.c ------------------------------------------*/