return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
return SR_OK;
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(int idx)
{
return dev_clear(idx);
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
- sdi->conn, LOG_PREFIX);
+ return std_dev_acquisition_stop_serial(sdi, cb_data,
+ std_serial_dev_close, sdi->conn, LOG_PREFIX);
}
/* Driver-specific API function wrappers */
.config_set = config_set, \
.config_list = config_list, \
.dev_open = dev_open, \
- .dev_close = dev_close, \
+ .dev_close = std_serial_dev_close, \
.dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
.dev_acquisition_stop = dev_acquisition_stop, \
.priv = NULL, \
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
static int dev_close(struct sr_dev_inst *sdi)
{
- struct sr_serial_dev_inst *serial;
struct dev_context *devc;
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
+ std_serial_dev_close(sdi);
sdi->status = SR_ST_INACTIVE;
SR_PRIV struct sr_dev_driver link_mso19_driver_info;
static struct sr_dev_driver *di = &link_mso19_driver_info;
-static int dev_close(struct sr_dev_inst *sdi);
-
/* TODO: Use sr_dev_inst to store connection handle & use std_dev_clear(). */
static int dev_clear(void)
{
ret = SR_ERR_BUG;
continue;
}
- dev_close(sdi);
+ std_serial_dev_close(sdi);
sr_serial_dev_inst_free(devc->serial);
sr_dev_inst_free(sdi);
}
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct dev_context *devc;
-
- devc = sdi->priv;
-
- if (devc->serial && devc->serial->fd != -1) {
- serial_close(devc->serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(int idx)
{
return dev_clear(idx);
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set, \
.config_list = config_list, \
.dev_open = dev_open, \
- .dev_close = dev_close, \
+ .dev_close = std_serial_dev_close, \
.dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
.dev_acquisition_stop = dev_acquisition_stop, \
.priv = NULL, \
static int dev_close(struct sr_dev_inst *sdi)
{
- struct sr_serial_dev_inst *serial;
struct dev_context *devc;
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
+ std_serial_dev_close(sdi);
/* Free dynamically allocated resources. */
if ((devc = sdi->priv) && devc->version) {
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(int dmm)
{
return dev_clear(dmm);
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set, \
.config_list = config_list, \
.dev_open = dev_open, \
- .dev_close = dev_close, \
+ .dev_close = std_serial_dev_close, \
.dev_acquisition_start = dev_acquisition_start_##ID_UPPER, \
.dev_acquisition_stop = dev_acquisition_stop, \
.priv = NULL, \
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial = sdi->conn;
-
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
};
return SR_OK;
}
-static int dev_close(struct sr_dev_inst *sdi)
-{
- struct sr_serial_dev_inst *serial;
-
- serial = sdi->conn;
- if (serial && serial->fd != -1) {
- serial_close(serial);
- sdi->status = SR_ST_INACTIVE;
- }
-
- return SR_OK;
-}
-
static int cleanup(void)
{
return dev_clear();
static int dev_acquisition_stop(struct sr_dev_inst *sdi, void *cb_data)
{
- return std_dev_acquisition_stop_serial(sdi, cb_data, dev_close,
+ return std_dev_acquisition_stop_serial(sdi, cb_data, std_serial_dev_close,
sdi->conn, LOG_PREFIX);
}
.config_set = config_set,
.config_list = config_list,
.dev_open = dev_open,
- .dev_close = dev_close,
+ .dev_close = std_serial_dev_close,
.dev_acquisition_start = dev_acquisition_start,
.dev_acquisition_stop = dev_acquisition_stop,
.priv = NULL,
return ret;
}
-SR_PRIV int std_serial_close(struct sr_dev_inst *sdi)
+SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi)
{
struct sr_serial_dev_inst *serial;