#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;
*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;
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)))
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;
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;
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;
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);
*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) {
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);
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);