]> sigrok.org Git - libsigrok.git/blobdiff - hardware/chronovu-la8/api.c
Drop link-mso19/nexus-osciprime in preparation for release.
[libsigrok.git] / hardware / chronovu-la8 / api.c
index 08e06c32afe717823493a3b5e2b309f8a5b7de9f..ff08236ac2ea6f302dcc267941d5779451f3cfd8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
  *
  * Copyright (C) 2011-2012 Uwe Hermann <uwe@hermann-uwe.de>
  *
@@ -86,7 +86,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)
@@ -308,6 +308,9 @@ 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_DEV_CLOSED;
+
        if (!(devc = sdi->priv)) {
                sr_err("%s: sdi->priv was NULL.", __func__);
                return SR_ERR_BUG;
@@ -433,6 +436,9 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        uint8_t buf[4];
        int bytes_written;
 
+       if (sdi->status != SR_ST_ACTIVE)
+               return SR_ERR_DEV_CLOSED;
+
        if (!(devc = sdi->priv)) {
                sr_err("%s: sdi->priv was NULL.", __func__);
                return SR_ERR_BUG;
@@ -476,7 +482,7 @@ static int hw_dev_acquisition_start(const struct sr_dev_inst *sdi,
        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);
 
        /* Time when we should be done (for detecting trigger timeouts). */
        devc->done = (devc->divcount + 1) * 0.08388608 + time(NULL)