return 0;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
struct alsa *alsa;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
struct alsa *alsa;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
/* Avoid compiler warnings. */
dev_index = dev_index;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
return SR_OK;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
struct sigma *sigma;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
struct sigma *sigma;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
return 0;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
int ret;
struct sr_dev_inst *sdi;
sr_err("la8: %s: ftdi_usb_purge_buffers: (%d) %s",
__func__, ret, ftdi_get_error_string(la8->ftdic));
(void) la8_close_usb_reset_sequencer(la8); /* Ignore errors. */
- goto err_opendev_close_ftdic;
+ goto err_dev_open_close_ftdic;
}
sr_dbg("la8: FTDI buffers purged successfully");
sr_err("la8: %s: ftdi_setflowcontrol: (%d) %s",
__func__, ret, ftdi_get_error_string(la8->ftdic));
(void) la8_close_usb_reset_sequencer(la8); /* Ignore errors. */
- goto err_opendev_close_ftdic;
+ goto err_dev_open_close_ftdic;
}
sr_dbg("la8: FTDI flow control enabled successfully");
return SR_OK;
-err_opendev_close_ftdic:
+err_dev_open_close_ftdic:
(void) la8_close(la8); /* Log, but ignore errors. */
return SR_ERR;
}
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
struct la8 *la8;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
0xbe, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
-/* List of struct sr_dev_inst, maintained by opendev()/closedev(). */
+/* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
static GSList *dev_insts = NULL;
static uint64_t cur_samplerate = SR_KHZ(200);
static uint64_t limit_samples = 0;
return 1;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
/* Avoid compiler warnings. */
(void)dev_index;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
/* Avoid compiler warnings. */
(void)dev_index;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
/* Avoid compiler warnings. */
(void)dev_index;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
return ret;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
struct mso *mso;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
return final_devcnt;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
struct ols_dev *ols;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
struct ols_dev *ols;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
supported_samplerates,
};
-/* List of struct sr_dev_inst, maintained by opendev()/closedev(). */
+/* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
static GSList *dev_insts = NULL;
static libusb_context *usb_context = NULL;
return devcnt;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
GTimeVal cur_time;
struct sr_dev_inst *sdi;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
NULL,
};
-/* List of struct sr_dev_inst, maintained by opendev()/closedev(). */
+/* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
static GSList *dev_insts = NULL;
static libusb_context *usb_context = NULL;
return devcnt;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
struct zp *zp;
return SR_OK;
}
-static int hw_closedev(int dev_index)
+static int hw_dev_close(int dev_index)
{
struct sr_dev_inst *sdi;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
struct sr_dev_inst *sdi;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = hw_closedev,
+ .dev_open = hw_dev_open,
+ .dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
* Add a device to the current session.
*
* @param dev The device to add to the current session. Must not be NULL.
- * Also, dev->plugin and dev->plugin->opendev must not be NULL.
+ * Also, dev->plugin and dev->plugin->dev_open must not be NULL.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
*/
return SR_ERR_ARG;
}
- if (!dev->plugin->opendev) {
- sr_err("session: %s: dev->plugin->opendev was NULL",
+ if (!dev->plugin->dev_open) {
+ sr_err("session: %s: dev->plugin->dev_open was NULL",
__func__);
return SR_ERR_ARG;
}
return SR_ERR; /* TODO: SR_ERR_BUG? */
}
- if ((ret = dev->plugin->opendev(dev->plugin_index)) != SR_OK) {
- sr_err("session: %s: opendev failed (%d)", __func__, ret);
+ if ((ret = dev->plugin->dev_open(dev->plugin_index)) != SR_OK) {
+ sr_err("session: %s: dev_open failed (%d)", __func__, ret);
return ret;
}
return SR_OK;
}
-static int hw_opendev(int dev_index)
+static int hw_dev_open(int dev_index)
{
struct sr_dev_inst *sdi;
return info;
}
-static int hw_get_status(int dev_index)
+static int hw_dev_status_get(int dev_index)
{
/* Avoid compiler warnings. */
(void)dev_index;
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
- .opendev = hw_opendev,
- .closedev = NULL,
+ .dev_open = hw_dev_open,
+ .dev_close = NULL,
.dev_info_get = hw_dev_info_get,
- .get_status = hw_get_status,
+ .dev_status_get = hw_dev_status_get,
.hwcap_get_all = hw_hwcap_get_all,
.config_set = hw_config_set,
.acquisition_start = hw_acquisition_start,
int (*cleanup) (void);
/* Device-specific */
- int (*opendev) (int dev_index);
- int (*closedev) (int dev_index);
+ int (*dev_open) (int dev_index);
+ int (*dev_close) (int dev_index);
void *(*dev_info_get) (int dev_index, int dev_info_id);
- int (*get_status) (int dev_index);
+ int (*dev_status_get) (int dev_index);
int *(*hwcap_get_all) (void);
int (*config_set) (int dev_index, int hwcap, void *value);
int (*acquisition_start) (int dev_index, gpointer session_dev_id);