]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-dmm/api.c
rigol-dg: Add device/firmware specific quirks support.
[libsigrok.git] / src / hardware / scpi-dmm / api.c
index 18fd6045f6d369e1aeeba0f3a132cdf6d40a3c64..7867ebc2acd48b336e47a6efd9c591a7ec607550 100644 (file)
@@ -33,6 +33,7 @@ static const uint32_t drvopts[] = {
 
 static const uint32_t devopts_generic[] = {
        SR_CONF_CONTINUOUS,
+       SR_CONF_CONN | SR_CONF_GET,
        SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET,
        SR_CONF_LIMIT_MSEC | SR_CONF_GET | SR_CONF_SET,
        SR_CONF_MEASURED_QUANTITY | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
@@ -86,7 +87,6 @@ static const struct scpi_command cmdset_gwinstek[] = {
        { DMM_CMD_SETUP_FUNC, "CONF:%s", },
        { DMM_CMD_QUERY_FUNC, "CONF:STAT:FUNC?", },
        { DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
-       { DMM_CMD_STOP_ACQ, "SYST:LOC", },
        { DMM_CMD_QUERY_VALUE, "VAL1?", },
        { DMM_CMD_QUERY_PREC, "SENS:DET:RATE?", },
        ALL_ZERO,
@@ -97,8 +97,8 @@ static const struct scpi_command cmdset_gwinstek_906x[] = {
        { DMM_CMD_SETUP_LOCAL, "SYST:LOC", },
        { DMM_CMD_SETUP_FUNC, "CONF:%s", },
        { DMM_CMD_QUERY_FUNC, "CONF?", },
-       { DMM_CMD_START_ACQ, "*CLS;SYST:REM", },
-       { DMM_CMD_STOP_ACQ, "SYST:LOC", },
+       { DMM_CMD_START_ACQ, "INIT", },
+       { DMM_CMD_STOP_ACQ, "ABORT", },
        { DMM_CMD_QUERY_VALUE, "VAL1?", },
        { DMM_CMD_QUERY_PREC, "SENS:DET:RATE?", },
        ALL_ZERO,
@@ -274,6 +274,11 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
        sdi->conn = scpi;
        sdi->driver = &scpi_dmm_driver_info;
        sdi->inst_type = SR_INST_SCPI;
+       ret = sr_scpi_connection_id(scpi, &sdi->connection_id);
+       if (ret != SR_OK) {
+               g_free(sdi->connection_id);
+               sdi->connection_id = NULL;
+       }
        sr_scpi_hw_info_free(hw_info);
        if (model->read_timeout_us)  /* non-default read timeout */
                scpi->read_timeout_us = model->read_timeout_us;
@@ -363,6 +368,11 @@ static int config_get(uint32_t key, GVariant **data,
        devc = sdi->priv;
 
        switch (key) {
+       case SR_CONF_CONN:
+               if (!sdi || !sdi->connection_id)
+                       return SR_ERR_NA;
+               *data = g_variant_new_string(sdi->connection_id);
+               return SR_OK;
        case SR_CONF_LIMIT_SAMPLES:
        case SR_CONF_LIMIT_MSEC:
                return sr_sw_limits_config_get(&devc->limits, key, data);