SR_PRIV struct sr_dev_driver norma_dmm_driver_info;
SR_PRIV struct sr_dev_driver siemens_b102x_driver_info;
SR_PRIV struct sr_dev_driver norma_dmm_driver_info;
SR_PRIV struct sr_dev_driver siemens_b102x_driver_info;
-static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
-{
- return std_init(sr_ctx, di, LOG_PREFIX);
-}
-
-static GSList *scan(struct sr_dev_driver* drv, GSList *options)
+static GSList *scan(struct sr_dev_driver *drv, GSList *options)
nmadmm_requests[NMADMM_REQ_IDN].req_str);
g_usleep(150 * 1000); /* Wait a little to allow serial port to settle. */
for (cnt = 0; cnt < 7; cnt++) {
nmadmm_requests[NMADMM_REQ_IDN].req_str);
g_usleep(150 * 1000); /* Wait a little to allow serial port to settle. */
for (cnt = 0; cnt < 7; cnt++) {
- if (serial_write_blocking(serial, req, strlen(req), 0) < 0) {
+ if (serial_write_blocking(serial, req, strlen(req),
+ serial_timeout(serial, strlen(req))) < 0) {
if (g_regex_match_simple("^1834 [^,]*,IF V*", (char *)buf, 0, 0)) {
auxtype = xgittoint(buf[7]);
sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9);
if (g_regex_match_simple("^1834 [^,]*,IF V*", (char *)buf, 0, 0)) {
auxtype = xgittoint(buf[7]);
sr_spew("%s %s DMM %s detected!", get_brandstr(drv), get_typestr(auxtype, drv), buf + 9);
sdi->model = g_strdup(get_typestr(auxtype, drv));
sdi->version = g_strdup(buf + 9);
devc = g_malloc0(sizeof(struct dev_context));
sdi->model = g_strdup(get_typestr(auxtype, drv));
sdi->version = g_strdup(buf + 9);
devc = g_malloc0(sizeof(struct dev_context));
static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
static int config_set(uint32_t key, GVariant *data, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg)
{
- switch (key) {
- case SR_CONF_LIMIT_MSEC:
- devc->limit_msec = g_variant_get_uint64(data);
- break;
- case SR_CONF_LIMIT_SAMPLES:
- devc->limit_samples = g_variant_get_uint64(data);
- break;
- default:
- return SR_ERR_NA;
- }
-
- return SR_OK;
+ return sr_sw_limits_config_set(&devc->limits, key, data);
}
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
}
static int config_list(uint32_t key, GVariant **data, const struct sr_dev_inst *sdi,
- /* Start timer, if required. */
- if (devc->limit_msec)
- g_timer_start(devc->elapsed_msec);
+ sr_sw_limits_acquisition_start(&devc->limits);
+ std_session_send_df_header(sdi, LOG_PREFIX);
- struct dev_context *devc;
-
- /* Stop timer, if required. */
- if (sdi && (devc = sdi->priv) && devc->limit_msec)
- g_timer_stop(devc->elapsed_msec);
-
- return std_serial_dev_acquisition_stop(sdi, cb_data, dev_close,
+ return std_serial_dev_acquisition_stop(sdi, dev_close,