---
hardware/common/scpi.c | 6 +++---
hardware/common/scpi_serial.c | 5 +++--
hardware/common/scpi_tcp.c | 5 +++--
hardware/common/scpi_usbtmc.c | 5 +++--
hardware/common/scpi_vxi.c | 5 +++--
hardware/hameg-hmo/api.c | 2 +-
hardware/rigol-ds/api.c | 2 +-
libsigrok-internal.h | 8 ++++----
8 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/hardware/common/scpi.c b/hardware/common/scpi.c
index fc61855..2307a8b 100644
--- a/hardware/common/scpi.c
+++ b/hardware/common/scpi.c
@@ -87,8 +87,8 @@ static const struct sr_scpi_dev_inst *scpi_devs[] = {
#endif
};
-SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(const char *resource,
- const char *serialcomm)
+SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(struct drv_context *drvc,
+ const char *resource, const char *serialcomm)
{
struct sr_scpi_dev_inst *scpi = NULL;
const struct sr_scpi_dev_inst *scpi_dev;
@@ -103,7 +103,7 @@ SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(const
char *resource,
*scpi = *scpi_dev;
scpi->priv = g_malloc0(scpi->priv_size);
params = g_strsplit(resource, "/", 0);
- if (scpi->dev_inst_new(scpi->priv, resource,
+ if (scpi->dev_inst_new(scpi->priv, drvc, resource,
params, serialcomm) != SR_OK) {
sr_scpi_free(scpi);
scpi = NULL;
diff --git a/hardware/common/scpi_serial.c b/hardware/common/scpi_serial.c
index cf962af..6e73c89 100644
--- a/hardware/common/scpi_serial.c
+++ b/hardware/common/scpi_serial.c
@@ -35,11 +35,12 @@ struct scpi_serial {
size_t read;
};
-static int scpi_serial_dev_inst_new(void *priv, const char *resource,
- char **params, const char *serialcomm)
+static int scpi_serial_dev_inst_new(void *priv, struct drv_context *drvc,
+ const char *resource, char **params, const char *serialcomm)
{
struct scpi_serial *sscpi = priv;
+ (void)drvc;
(void)params;
if (!(sscpi->serial = sr_serial_dev_inst_new(resource, serialcomm)))
diff --git a/hardware/common/scpi_tcp.c b/hardware/common/scpi_tcp.c
index 796ea9a..21235f3 100644
--- a/hardware/common/scpi_tcp.c
+++ b/hardware/common/scpi_tcp.c
@@ -51,11 +51,12 @@ struct scpi_tcp {
int response_bytes_read;
};
-static int scpi_tcp_dev_inst_new(void *priv, const char *resource,
- char **params, const char *serialcomm)
+static int scpi_tcp_dev_inst_new(void *priv, struct drv_context *drvc,
+ const char *resource, char **params, const char *serialcomm)
{
struct scpi_tcp *tcp = priv;
+ (void)drvc;
(void)resource;
(void)serialcomm;
diff --git a/hardware/common/scpi_usbtmc.c b/hardware/common/scpi_usbtmc.c
index 75fcf3a..6cd7964 100644
--- a/hardware/common/scpi_usbtmc.c
+++ b/hardware/common/scpi_usbtmc.c
@@ -37,11 +37,12 @@ struct usbtmc_scpi {
int response_bytes_read;
};
-static int scpi_usbtmc_dev_inst_new(void *priv, const char *resource,
- char **params, const char *serialcomm)
+static int scpi_usbtmc_dev_inst_new(void *priv, struct drv_context *drvc,
+ const char *resource, char **params, const char *serialcomm)
{
struct usbtmc_scpi *uscpi = priv;
+ (void)drvc;
(void)params;
(void)serialcomm;
diff --git a/hardware/common/scpi_vxi.c b/hardware/common/scpi_vxi.c
index 0377d52..4bdb6ab 100644
--- a/hardware/common/scpi_vxi.c
+++ b/hardware/common/scpi_vxi.c
@@ -37,11 +37,12 @@ struct scpi_vxi {
unsigned int read_complete;
};
-static int scpi_vxi_dev_inst_new(void *priv, const char *resource,
- char **params, const char *serialcomm)
+static int scpi_vxi_dev_inst_new(void *priv, struct drv_context *drvc,
+ const char *resource, char **params, const char *serialcomm)
{
struct scpi_vxi *vxi = priv;
+ (void)drvc;
(void)resource;
(void)serialcomm;
diff --git a/hardware/hameg-hmo/api.c b/hardware/hameg-hmo/api.c
index b63ee51..5abd8c5 100644
--- a/hardware/hameg-hmo/api.c
+++ b/hardware/hameg-hmo/api.c
@@ -220,7 +220,7 @@ static struct sr_dev_inst *hmo_probe_serial_device(const
char *serial_device,
scpi = NULL;
hw_info = NULL;
- if (!(scpi = scpi_dev_inst_new(serial_device, serial_options)))
+ if (!(scpi = scpi_dev_inst_new(di->priv, serial_device,
serial_options)))
goto fail;
sr_info("Probing %s.", serial_device);
diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c
index 706391f..0f319cb 100644
--- a/hardware/rigol-ds/api.c
+++ b/hardware/rigol-ds/api.c
@@ -269,7 +269,7 @@ static int probe_port(const char *resource, const char
*serialcomm, GSList **dev
*devices = NULL;
- if (!(scpi = scpi_dev_inst_new(resource, serialcomm)))
+ if (!(scpi = scpi_dev_inst_new(di->priv, resource, serialcomm)))
return SR_ERR;
if (sr_scpi_open(scpi) != SR_OK) {
diff --git a/libsigrok-internal.h b/libsigrok-internal.h
index 6e665c5..951d91d 100644
--- a/libsigrok-internal.h
+++ b/libsigrok-internal.h
@@ -438,8 +438,8 @@ struct sr_scpi_dev_inst {
const char *name;
const char *prefix;
int priv_size;
- int (*dev_inst_new)(void *priv, const char *resource, char **params,
- const char *serialcomm);
+ int (*dev_inst_new)(void *priv, struct drv_context *drvc,
+ const char *resource, char **params, const char *serialcomm);
int (*open)(void *priv);
int (*source_add)(void *priv, int events,
int timeout, sr_receive_data_callback_t cb, void *cb_data);
@@ -453,8 +453,8 @@ struct sr_scpi_dev_inst {
void *priv;
};
-SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(const char *resource,
- const char *serialcomm);
+SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(struct drv_context *drvc,
+ const char *resource, const char *serialcomm);
SR_PRIV int sr_scpi_open(struct sr_scpi_dev_inst *scpi);
SR_PRIV int sr_scpi_source_add(struct sr_scpi_dev_inst *scpi, int events,
int timeout, sr_receive_data_callback_t cb, void *cb_data);
--
1.9.rc1
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel