]> sigrok.org Git - libsigrok.git/blobdiff - src/scpi/scpi_libgpib.c
scpi/libgpib: Print error string instead of number on errors
[libsigrok.git] / src / scpi / scpi_libgpib.c
index 7632f74c9dc2ecf530986011ae02b08dd402f8cc..ed499cca5bad7bacd0e1e1fa07b70fc4ab7041a9 100644 (file)
@@ -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,8 @@ 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.",
+                       gpib_error_string(iberr));
                return SR_ERR;
        }