]> sigrok.org Git - libsigrok.git/blobdiff - hardware/agilent-dmm/api.c
uni-t-dmm: Add missing SR_CONF_LIMIT_MSEC support.
[libsigrok.git] / hardware / agilent-dmm / api.c
index 3f54481c5e44a58df5f24b4948cb06dbca03eb49..76349d8b157e460210bb498b55a7d705f45ec361 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
  *
  * Copyright (C) 2012 Bert Vermeulen <bert@biot.com>
  *
@@ -91,7 +91,7 @@ static int clear_instances(void)
 
 static int hw_init(struct sr_context *sr_ctx)
 {
-       return std_hw_init(sr_ctx, di, DRIVER_LOG_DOMAIN);
+       return std_hw_init(sr_ctx, di, LOG_PREFIX);
 }
 
 static GSList *hw_scan(GSList *options)
@@ -231,7 +231,7 @@ static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
        struct dev_context *devc;
 
        if (sdi->status != SR_ST_ACTIVE)
-               return SR_ERR;
+               return SR_ERR_DEV_CLOSED;
 
        if (!(devc = sdi->priv)) {
                sr_err("sdi->priv was NULL.");
@@ -287,6 +287,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data
        struct dev_context *devc;
        struct sr_serial_dev_inst *serial;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR_DEV_CLOSED;
+
        if (!(devc = sdi->priv)) {
                sr_err("sdi->priv was NULL.");
                return SR_ERR_BUG;
@@ -295,7 +298,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data
        devc->cb_data = cb_data;
 
        /* Send header packet to the session bus. */
-       std_session_send_df_header(cb_data, DRIVER_LOG_DOMAIN);
+       std_session_send_df_header(cb_data, LOG_PREFIX);
 
        /* Poll every 100ms, or whenever some data comes in. */
        serial = sdi->conn;
@@ -307,7 +310,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data
 static int hw_dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
 {
        return std_hw_dev_acquisition_stop_serial(sdi, cb_data, hw_dev_close,
-                       sdi->conn, DRIVER_LOG_DOMAIN);
+                       sdi->conn, LOG_PREFIX);
 }
 
 SR_PRIV struct sr_dev_driver agdmm_driver_info = {