NULL,
};
+SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info;
SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info;
+
+static struct sr_dev_driver *di_digitek_dt4000zc = &digitek_dt4000zc_driver_info;
static struct sr_dev_driver *di_tekpower_tp4000zc = &tekpower_tp4000zc_driver_info;
/* After hw_init() this will point to a device-specific entry (see above). */
static struct sr_dev_driver *di = NULL;
SR_PRIV struct dmm_info dmms[] = {
+ {
+ "Digitek", "DT4000ZC",
+ "2400/8n1", 2400,
+ FS9721_PACKET_SIZE,
+ sr_fs9721_packet_valid,
+ sr_fs9721_parse,
+ dmm_details_dt4000zc,
+ },
{
"TekPower", "TP4000ZC",
"2400/8n1", 2400,
return SR_ERR_MALLOC;
}
+ if (dmm == DIGITEK_DT4000ZC)
+ di = di_digitek_dt4000zc;
if (dmm == TEKPOWER_TP4000ZC)
di = di_tekpower_tp4000zc;
sr_dbg("Selected '%s' subdriver.", di->name);
return SR_OK;
}
+static int hw_init_digitek_dt4000zc(void)
+{
+ return hw_init(DIGITEK_DT4000ZC);
+}
+
static int hw_init_tekpower_tp4000zc(void)
{
return hw_init(TEKPOWER_TP4000ZC);
if (!conn)
return NULL;
- if (!strcmp(di->name, "tekpower-tp4000zc"))
+ if (!strcmp(di->name, "digitek-dt4000zc"))
dmm = 0;
+ if (!strcmp(di->name, "tekpower-tp4000zc"))
+ dmm = 1;
if (serialcomm) {
/* Use the provided comm specs. */
meta.num_probes = 1;
sr_session_send(devc->cb_data, &packet);
+ if (!strcmp(di->name, "digitek-dt4000zc"))
+ receive_data = digitek_dt4000zc_receive_data;
if (!strcmp(di->name, "tekpower-tp4000zc"))
receive_data = tekpower_tp4000zc_receive_data;
return SR_OK;
}
+SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info = {
+ .name = "digitek-dt4000zc",
+ .longname = "Digitek DT4000ZC",
+ .api_version = 1,
+ .init = hw_init_digitek_dt4000zc,
+ .cleanup = hw_cleanup,
+ .scan = hw_scan,
+ .dev_list = hw_dev_list,
+ .dev_clear = clear_instances,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
+ .info_get = hw_info_get,
+ .dev_config_set = hw_dev_config_set,
+ .dev_acquisition_start = hw_dev_acquisition_start,
+ .dev_acquisition_stop = hw_dev_acquisition_stop,
+ .priv = NULL,
+};
+
SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info = {
.name = "tekpower-tp4000zc",
.longname = "TekPower TP4000ZC",
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;
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;
#define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args)
enum {
+ DIGITEK_DT4000ZC,
TEKPOWER_TP4000ZC,
};
void (*dmm_details)(struct sr_datafeed_analog *, void *);
};
-SR_PRIV struct dmm_info dmms[1];
+SR_PRIV struct dmm_info dmms[2];
#define DMM_BUFSIZE 256
int buflen;
};
+SR_PRIV int digitek_dt4000zc_receive_data(int fd, int revents, void *cb_data);
SR_PRIV int tekpower_tp4000zc_receive_data(int fd, int revents, void *cb_data);
+
SR_PRIV void dmm_details_tp4000zc(struct sr_datafeed_analog *analog, void *info);
+SR_PRIV void dmm_details_dt4000zc(struct sr_datafeed_analog *analog, void *info);
#endif
extern SR_PRIV struct sr_dev_driver radioshackdmm_driver_info;
#endif
#ifdef HAVE_HW_SERIAL_DMM
+extern SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info;
extern SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info;
#endif
#ifdef HAVE_HW_UNI_T_DMM
&radioshackdmm_driver_info,
#endif
#ifdef HAVE_HW_SERIAL_DMM
+ &digitek_dt4000zc_driver_info,
&tekpower_tp4000zc_driver_info,
#endif
#ifdef HAVE_HW_UNI_T_DMM