X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi_libgpib.c;h=2f3256be948e2eae404d02cda0e38b4391bab465;hb=366ccb8ab75f7291a11e677034085c702a1c5361;hp=7632f74c9dc2ecf530986011ae02b08dd402f8cc;hpb=04229f7bfc750f2b67e8dd54ac82ae6bb7eae1e4;p=libsigrok.git diff --git a/src/scpi/scpi_libgpib.c b/src/scpi/scpi_libgpib.c index 7632f74c..2f3256be 100644 --- a/src/scpi/scpi_libgpib.c +++ b/src/scpi/scpi_libgpib.c @@ -84,8 +84,8 @@ static int scpi_gpib_send(void *priv, const char *command) if (ibsta & ERR) { - sr_err("Error while sending SCPI command: '%s': iberr = %d.", - command, iberr); + sr_err("Error while sending SCPI command: '%s': iberr = %s.", + command, gpib_error_string(iberr)); return SR_ERR; } @@ -118,7 +118,9 @@ static int scpi_gpib_read_data(void *priv, char *buf, int maxlen) if (ibsta & ERR) { - sr_err("Error while reading SCPI response: iberr = %d.", iberr); + sr_err("Error while reading SCPI response: " + "iberr = %s, ibsta = %d.", + gpib_error_string(iberr), ibsta); return SR_ERR; } @@ -138,6 +140,9 @@ static int scpi_gpib_close(struct sr_scpi_dev_inst *scpi) { struct scpi_gpib *gscpi = scpi->priv; + /* Put device in back local mode to prevent lock-out of front panel. */ + ibloc(gscpi->descriptor); + /* Now it's safe to close the handle. */ ibonl(gscpi->descriptor, 0); return SR_OK;