X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fscpi%2Fscpi_libgpib.c;h=7632f74c9dc2ecf530986011ae02b08dd402f8cc;hb=98654c99daf85bd2a81a9c87f517e800c31e34f2;hp=5df90413ff4dd1197e9475419a4f03537721bc31;hpb=7343ad1ec72860b5d11ca8f35c4d014a1fa5b643;p=libsigrok.git
diff --git a/src/scpi/scpi_libgpib.c b/src/scpi/scpi_libgpib.c
index 5df90413..7632f74c 100644
--- a/src/scpi/scpi_libgpib.c
+++ b/src/scpi/scpi_libgpib.c
@@ -17,11 +17,12 @@
* along with this program. If not, see .
*/
-#include "libsigrok.h"
-#include "libsigrok-internal.h"
-
+#include
#include
#include
+#include
+#include "libsigrok-internal.h"
+#include "scpi.h"
#define LOG_PREFIX "scpi_gpib"
@@ -48,9 +49,9 @@ static int scpi_gpib_dev_inst_new(void *priv, struct drv_context *drvc,
return SR_OK;
}
-static int scpi_gpib_open(void *priv)
+static int scpi_gpib_open(struct sr_scpi_dev_inst *scpi)
{
- struct scpi_gpib *gscpi = priv;
+ struct scpi_gpib *gscpi = scpi->priv;
if ((gscpi->descriptor = ibfind(gscpi->name)) < 0)
return SR_ERR;
@@ -91,7 +92,7 @@ static int scpi_gpib_send(void *priv, const char *command)
if (ibcnt < len)
{
sr_err("Failed to send all of SCPI command: '%s': "
- "len = %d, ibcnt = .", command, len, ibcnt);
+ "len = %d, ibcnt = %d.", command, len, ibcnt);
return SR_ERR;
}
@@ -133,9 +134,9 @@ static int scpi_gpib_read_complete(void *priv)
return gscpi->read_started && (ibsta & END);
}
-static int scpi_gpib_close(void *priv)
+static int scpi_gpib_close(struct sr_scpi_dev_inst *scpi)
{
- struct scpi_gpib *gscpi = priv;
+ struct scpi_gpib *gscpi = scpi->priv;
ibonl(gscpi->descriptor, 0);