#define VICTOR_VENDOR "Victor"
#define VICTOR_INTERFACE 0
#define VICTOR_ENDPOINT (LIBUSB_ENDPOINT_IN | 1)
-static int dev_acquisition_stop(struct sr_dev_inst *sdi);
static const uint32_t drvopts[] = {
SR_CONF_MULTIMETER,
usb = sdi->conn;
if (!usb->devhdl)
- /* Nothing to do. */
+ /* Nothing to do. */
return SR_OK;
libusb_release_interface(usb->devhdl, VICTOR_INTERFACE);
(void)cg;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
devc = sdi->priv;
return sr_sw_limits_config_set(&devc->limits, key, data);
devc = sdi->priv;
if (transfer->status == LIBUSB_TRANSFER_NO_DEVICE) {
/* USB device was unplugged. */
- dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
} else if (transfer->status == LIBUSB_TRANSFER_COMPLETED) {
sr_dbg("Got %d-byte packet.", transfer->actual_length);
if (transfer->actual_length == DMM_DATA_SIZE) {
victor_dmm_receive_data(sdi, transfer->buffer);
if (sr_sw_limits_check(&devc->limits))
- dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
}
}
/* Anything else is either an error or a timeout, which is fine:
libusb_error_name(ret));
g_free(transfer->buffer);
libusb_free_transfer(transfer);
- dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
}
} else {
/* This was the last transfer we're going to receive, so
drvc = di->context;
if (sr_sw_limits_check(&devc->limits))
- dev_acquisition_stop(sdi);
+ sr_dev_acquisition_stop(sdi);
if (sdi->status == SR_ST_STOPPING) {
usb_source_remove(sdi->session, drvc->sr_ctx);
int ret;
unsigned char *buf;
- if (sdi->status != SR_ST_ACTIVE)
- return SR_ERR_DEV_CLOSED;
-
usb = sdi->conn;
std_session_send_df_header(sdi);
static int dev_acquisition_stop(struct sr_dev_inst *sdi)
{
- if (sdi->status != SR_ST_ACTIVE) {
- sr_err("Device not active, can't stop acquisition.");
- return SR_ERR;
- }
-
sdi->status = SR_ST_STOPPING;
return SR_OK;