#include "protocol.h"
SR_PRIV struct sr_dev_driver yokogawa_dlm_driver_info;
-static struct sr_dev_driver *di = &yokogawa_dlm_driver_info;
static char *MANUFACTURER_ID = "YOKOGAWA";
static char *MANUFACTURER_NAME = "Yokogawa";
CG_DIGITAL,
};
-static int init(struct sr_context *sr_ctx)
+static int init(struct sr_dev_driver *di, struct sr_context *sr_ctx)
{
return std_init(sr_ctx, di, LOG_PREFIX);
}
if (dlm_model_get(hw_info->model, &model_name, &model_index) != SR_OK)
goto fail;
- sdi = sr_dev_inst_new();
+ sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_ACTIVE;
sdi->vendor = g_strdup(MANUFACTURER_NAME);
sdi->model = g_strdup(model_name);
devc = g_malloc0(sizeof(struct dev_context));
- sdi->driver = di;
+ sdi->driver = &yokogawa_dlm_driver_info;
sdi->priv = devc;
sdi->inst_type = SR_INST_SCPI;
sdi->conn = scpi;
return NULL;
}
-static GSList *scan(GSList *options)
+static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
return sr_scpi_scan(di->priv, options, probe_usbtmc_device);
}
-static GSList *dev_list(void)
+static GSList *dev_list(const struct sr_dev_driver *di)
{
return ((struct drv_context *)(di->priv))->instances;
}
g_free(devc);
}
-static int dev_clear(void)
+static int dev_clear(const struct sr_dev_driver *di)
{
return std_dev_clear(di, clear_helper);
}
return SR_OK;
}
-static int cleanup(void)
+static int cleanup(const struct sr_dev_driver *di)
{
- dev_clear();
+ dev_clear(di);
return SR_OK;
}
state = devc->model_state;
switch (key) {
- case SR_CONF_NUM_TIMEBASE:
+ case SR_CONF_NUM_HDIV:
*data = g_variant_new_int32(model->num_xdivs);
ret = SR_OK;
break;