X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fscpi-pps%2Fapi.c;h=8fa49b66a2b409211f34975eb8645f23d6eaebcf;hb=8f3c77db26dece82109b386ad5ba7ea344b1ec8f;hp=98ef0b9d7b01932fb902e77bdd21d13a9704c882;hpb=f083ae63c7355b9b1d99775785b99b6fa91cd48a;p=libsigrok.git diff --git a/src/hardware/scpi-pps/api.c b/src/hardware/scpi-pps/api.c index 98ef0b9d..8fa49b66 100644 --- a/src/hardware/scpi-pps/api.c +++ b/src/hardware/scpi-pps/api.c @@ -153,7 +153,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi, ch = l->data; pch = ch->priv; /* Add mqflags from channel_group_spec only to voltage - * and current channels + * and current channels. */ if (pch->mq == SR_MQ_VOLTAGE || pch->mq == SR_MQ_CURRENT) pch->mqflags = cgs->mqflags; @@ -173,7 +173,10 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi, sr_scpi_hw_info_free(hw_info); hw_info = NULL; - sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL); + /* Don't send SCPI_CMD_LOCAL for HP 66xxB using SCPI over GPIB. */ + if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB && + scpi->transport == SCPI_TRANSPORT_LIBGPIB)) + sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL); return sdi; } @@ -265,7 +268,12 @@ static int dev_open(struct sr_dev_inst *sdi) return SR_ERR; devc = sdi->priv; - sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_REMOTE); + + /* Don't send SCPI_CMD_REMOTE for HP 66xxB using SCPI over GPIB. */ + if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB && + scpi->transport == SCPI_TRANSPORT_LIBGPIB)) + sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_REMOTE); + devc->beeper_was_set = FALSE; if (sr_scpi_cmd_resp(sdi, devc->device->commands, 0, NULL, &beeper, G_VARIANT_TYPE_BOOLEAN, SCPI_CMD_BEEPER) == SR_OK) { @@ -294,7 +302,11 @@ static int dev_close(struct sr_dev_inst *sdi) if (devc->beeper_was_set) sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_BEEPER_ENABLE); - sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL); + + /* Don't send SCPI_CMD_LOCAL for HP 66xxB using SCPI over GPIB. */ + if (!(devc->device->dialect == SCPI_DIALECT_HP_66XXB && + scpi->transport == SCPI_TRANSPORT_LIBGPIB)) + sr_scpi_cmd(sdi, devc->device->commands, 0, NULL, SCPI_CMD_LOCAL); return sr_scpi_close(scpi); } @@ -662,6 +674,7 @@ static int config_list(uint32_t key, GVariant **data, { struct dev_context *devc; struct sr_channel *ch; + struct pps_channel *pch; const struct channel_spec *ch_spec; int i; const char *s[16]; @@ -709,9 +722,10 @@ static int config_list(uint32_t key, GVariant **data, * specification for use in series or parallel mode. */ ch = cg->channels->data; + pch = ch->priv; if (!devc || !devc->device) return SR_ERR_ARG; - ch_spec = &(devc->device->channels[ch->index]); + ch_spec = &(devc->device->channels[pch->hw_output_idx]); switch (key) { case SR_CONF_DEVICE_OPTIONS: @@ -752,9 +766,9 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) /* Prime the pipe with the first channel. */ devc->cur_acquisition_channel = sr_next_enabled_channel(sdi, NULL); - /* Device specific initialization before aquisition starts. */ - if (devc->device->init_aquisition) - devc->device->init_aquisition(sdi); + /* Device specific initialization before acquisition starts. */ + if (devc->device->init_acquisition) + devc->device->init_acquisition(sdi); if ((ret = sr_scpi_source_add(sdi->session, scpi, G_IO_IN, 10, scpi_pps_receive_data, (void *)sdi)) != SR_OK)