if (data == NULL)
return SR_ERR_ARG;
- *data = dev->plugin->get_dev_info(dev->plugin_index, id);
+ *data = dev->plugin->dev_info_get(dev->plugin_index, id);
if (*data == NULL)
return SR_ERR;
return SR_OK;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct alsa *alsa;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return ret;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct sigma *sigma;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
uint8_t divcount;
};
-/* This will be initialized via hw_get_dev_info()/SR_DI_SAMPLERATES. */
+/* This will be initialized via hw_dev_info_get()/SR_DI_SAMPLERATES. */
static uint64_t supported_samplerates[255 + 1] = { 0 };
/*
return ret;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct la8 *la8;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return SR_OK;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
void *info = NULL;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return SR_OK;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct mso *mso;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return ret;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct ols_dev *ols;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return ret;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct fx2_dev *fx2;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
return SR_OK;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct sr_dev_inst *sdi;
struct zp *zp;
.cleanup = hw_cleanup,
.opendev = hw_opendev,
.closedev = hw_closedev,
- .get_dev_info = hw_get_dev_info,
+ .dev_info_get = hw_dev_info_get,
.get_status = hw_get_status,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
num_devs = plugin->init(NULL);
for (i = 0; i < num_devs; i++) {
num_probes = GPOINTER_TO_INT(
- plugin->get_dev_info(i, SR_DI_NUM_PROBES));
- probe_names = (char **)plugin->get_dev_info(i,
+ plugin->dev_info_get(i, SR_DI_NUM_PROBES));
+ probe_names = (char **)plugin->dev_info_get(i,
SR_DI_PROBE_NAMES);
if (!probe_names) {
snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->dev->probes);
if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
g_free(ctx->header);
num_probes = g_slist_length(o->dev->probes);
if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
/* TODO: Error checks. */
} else {
num_probes = g_slist_length(o->dev->probes);
if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
/* TODO: Error checks. */
} else {
num_probes = g_slist_length(o->dev->probes);
comment[0] = '\0';
if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(frequency_s = sr_samplerate_string(samplerate))) {
sr_err("gnuplot out: %s: sr_samplerate_string failed",
num_probes = g_slist_length(o->dev->probes);
comment[0] = '\0';
if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(frequency_s = sr_samplerate_string(samplerate))) {
g_free(ctx->header);
ctx->unitsize = (num_enabled_probes + 7) / 8;
if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE))
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
else
samplerate = 0;
snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
num_probes = g_slist_length(o->dev->probes);
if (o->dev->plugin || sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!(samplerate_s = sr_samplerate_string(samplerate))) {
g_free(ctx->header);
PACKAGE, PACKAGE_VERSION);
if (o->dev->plugin && sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
- ctx->samplerate = *((uint64_t *) o->dev->plugin->get_dev_info(
+ ctx->samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
if (!((samplerate_s = sr_samplerate_string(ctx->samplerate)))) {
g_string_free(ctx->header, TRUE);
return SR_OK;
}
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
{
struct session_vdev *vdev;
void *info;
}
SR_PRIV struct sr_dev_plugin session_driver = {
- "session",
- "Session-emulating driver",
- 1,
- hw_init,
- hw_cleanup,
- hw_opendev,
- NULL,
- hw_get_dev_info,
- hw_get_status,
- hw_hwcap_get_all,
- hw_config_set,
- hw_start_acquisition,
- NULL,
+ .name = "session",
+ .longname = "Session-emulating driver",
+ .api_version = 1,
+ .init = hw_init,
+ .cleanup = hw_cleanup,
+ .opendev = hw_opendev,
+ .closedev = NULL,
+ .dev_info_get = hw_dev_info_get,
+ .get_status = hw_get_status,
+ .hwcap_get_all = hw_hwcap_get_all,
+ .config_set = hw_config_set,
+ .start_acquisition = hw_start_acquisition,
+ .stop_acquisition = NULL,
};
fprintf(meta, "unitsize = %d\n", ds->ds_unitsize);
fprintf(meta, "total probes = %d\n", g_slist_length(dev->probes));
if (sr_dev_has_hwcap(dev, SR_HWCAP_SAMPLERATE)) {
- samplerate = *((uint64_t *) dev->plugin->get_dev_info(
+ samplerate = *((uint64_t *) dev->plugin->dev_info_get(
dev->plugin_index, SR_DI_CUR_SAMPLERATE));
s = sr_samplerate_string(samplerate);
fprintf(meta, "samplerate = %s\n", s);
/* Device-specific */
int (*opendev) (int dev_index);
int (*closedev) (int dev_index);
- void *(*get_dev_info) (int dev_index, int dev_info_id);
+ void *(*dev_info_get) (int dev_index, int dev_info_id);
int (*get_status) (int dev_index);
int *(*hwcap_get_all) (void);
int (*config_set) (int dev_index, int hwcap, void *value);
}
tokens = g_strsplit(triggerstring, ",", max_probes);
- trigger_types = dev->plugin->get_dev_info(0, SR_DI_TRIGGER_TYPES);
+ trigger_types = dev->plugin->dev_info_get(0, SR_DI_TRIGGER_TYPES);
if (trigger_types == NULL)
return NULL;