buf[7], buf[8], buf[9], buf[10], buf[11], buf[12], buf[13]);
}
+SR_PRIV void dmm_details_dt4000zc(struct sr_datafeed_analog *analog, void *info)
+{
+ dmm_details_tp4000zc(analog, info); /* Same as TP4000ZC. */
+}
+
SR_PRIV void dmm_details_tp4000zc(struct sr_datafeed_analog *analog, void *info)
{
struct fs9721_info *info_local;
/* User-defined FS9721_LP3 flag 'c2c1_10' means temperature. */
if (info_local->is_c2c1_10) {
analog->mq = SR_MQ_TEMPERATURE;
- /* No Kelvin or Fahrenheit from the device, just Celsius. */
+ analog->unit = SR_UNIT_CELSIUS;
+ }
+}
+
+SR_PRIV void dmm_details_va18b(struct sr_datafeed_analog *analog, void *info)
+{
+ struct fs9721_info *info_local;
+
+ info_local = (struct fs9721_info *)info;
+
+ /* User-defined FS9721_LP3 flag 'c2c1_01' means temperature. */
+ if (info_local->is_c2c1_01) {
+ analog->mq = SR_MQ_TEMPERATURE;
analog->unit = SR_UNIT_CELSIUS;
}
}
dmms[dmm].packet_parse(buf, &floatval, analog, info);
analog->data = &floatval;
- dmms[dmm].dmm_details(analog, info);
+ if (dmms[dmm].dmm_details)
+ dmms[dmm].dmm_details(analog, info);
if (analog->mq != -1) {
/* Got a measurement. */
{
struct sr_dev_inst *sdi;
struct dev_context *devc;
+ int ret;
(void)fd;
if (revents == G_IO_IN) {
/* Serial data arrived. */
handle_new_data(devc, dmm, info);
+ } else {
+ /* Timeout, send another packet request (if DMM needs it). */
+ if (dmms[dmm].packet_request) {
+ ret = dmms[dmm].packet_request(devc->serial);
+ if (ret < 0) {
+ sr_err("Failed to request packet: %d.", ret);
+ return FALSE;
+ }
+ }
}
if (devc->num_samples >= devc->limit_samples) {
return TRUE;
}
+SR_PRIV int digitek_dt4000zc_receive_data(int fd, int revents, void *cb_data)
+{
+ struct fs9721_info info;
+
+ return receive_data(fd, revents, DIGITEK_DT4000ZC, &info, cb_data);
+}
+
SR_PRIV int tekpower_tp4000zc_receive_data(int fd, int revents, void *cb_data)
{
struct fs9721_info info;
return receive_data(fd, revents, TEKPOWER_TP4000ZC, &info, cb_data);
}
+
+SR_PRIV int metex_me31_receive_data(int fd, int revents, void *cb_data)
+{
+ struct metex14_info info;
+
+ return receive_data(fd, revents, METEX_ME31, &info, cb_data);
+}
+
+SR_PRIV int peaktech_3410_receive_data(int fd, int revents, void *cb_data)
+{
+ struct metex14_info info;
+
+ return receive_data(fd, revents, PEAKTECH_3410, &info, cb_data);
+}
+
+SR_PRIV int mastech_mas345_receive_data(int fd, int revents, void *cb_data)
+{
+ struct metex14_info info;
+
+ return receive_data(fd, revents, MASTECH_MAS345, &info, cb_data);
+}
+
+SR_PRIV int va_va18b_receive_data(int fd, int revents, void *cb_data)
+{
+ struct fs9721_info info;
+
+ return receive_data(fd, revents, VA_VA18B, &info, cb_data);
+}