};
static struct sr_samplerates samplerates = {
- SR_HZ(0),
- SR_HZ(0),
- SR_HZ(0),
+ 0,
+ 0,
+ 0,
supported_samplerates,
};
{
struct context *ctx;
unsigned int i;
- int err;
+ int ret;
/* Note: sdi is non-NULL, the caller already checked this. */
return -1;
}
- if ((err = libusb_get_device_descriptor(dev, des))) {
- sr_err("zp: failed to get device descriptor: %d", err);
+ if ((ret = libusb_get_device_descriptor(dev, des))) {
+ sr_err("zp: failed to get device descriptor: %d", ret);
return -1;
}
}
/* Found it. */
- if (!(err = libusb_open(dev, &(ctx->usb->devhdl)))) {
+ if (!(ret = libusb_open(dev, &(ctx->usb->devhdl)))) {
(*sdi)->status = SR_ST_ACTIVE;
sr_info("zp: opened device %d on %d.%d interface %d",
(*sdi)->index, ctx->usb->bus,
ctx->usb->address, USB_INTERFACE);
} else {
- sr_err("zp: failed to open device: %d", err);
+ sr_err("zp: failed to open device: %d", ret);
*sdi = NULL;
}
}
struct sr_dev_inst *sdi;
struct libusb_device_descriptor des;
libusb_device **devlist;
- int err, devcnt, i;
+ int ret, devcnt, i;
struct context *ctx;
/* Avoid compiler warnings. */
libusb_get_device_list(usb_context, &devlist); /* TODO: Errors. */
for (i = 0; devlist[i]; i++) {
- err = libusb_get_device_descriptor(devlist[i], &des);
- if (err != 0) {
- sr_err("zp: failed to get device descriptor: %d", err);
+ ret = libusb_get_device_descriptor(devlist[i], &des);
+ if (ret != 0) {
+ sr_err("zp: failed to get device descriptor: %d", ret);
continue;
}
{
struct sr_dev_inst *sdi;
struct context *ctx;
- int err;
+ int ret;
if (!(sdi = zp_open_dev(dev_index))) {
sr_err("zp: unable to open device");
return SR_ERR_ARG;
}
- err = libusb_set_configuration(ctx->usb->devhdl, USB_CONFIGURATION);
- if (err < 0) {
+ ret = libusb_set_configuration(ctx->usb->devhdl, USB_CONFIGURATION);
+ if (ret < 0) {
sr_err("zp: Unable to set USB configuration %d: %d",
- USB_CONFIGURATION, err);
+ USB_CONFIGURATION, ret);
return SR_ERR;
}
- err = libusb_claim_interface(ctx->usb->devhdl, USB_INTERFACE);
- if (err != 0) {
- sr_err("zp: Unable to claim interface: %d", err);
+ ret = libusb_claim_interface(ctx->usb->devhdl, USB_INTERFACE);
+ if (ret != 0) {
+ sr_err("zp: Unable to claim interface: %d", ret);
return SR_ERR;
}
}
}
-static int hw_dev_acquisition_start(int dev_index, void *session_data)
+static int hw_dev_acquisition_start(int dev_index, void *cb_data)
{
struct sr_dev_inst *sdi;
struct sr_datafeed_packet packet;
gettimeofday(&header.starttime, NULL);
header.samplerate = ctx->cur_samplerate;
header.num_logic_probes = ctx->num_channels;
- sr_session_send(session_data, &packet);
+ sr_session_send(cb_data, &packet);
if (!(buf = g_try_malloc(PACKET_SIZE))) {
sr_err("zp: %s: buf malloc failed", __func__);
logic.length = PACKET_SIZE;
logic.unitsize = 4;
logic.data = buf;
- sr_session_send(session_data, &packet);
+ sr_session_send(cb_data, &packet);
samples_read += res / 4;
}
analyzer_read_stop(ctx->usb->devhdl);
g_free(buf);
packet.type = SR_DF_END;
- sr_session_send(session_data, &packet);
+ sr_session_send(cb_data, &packet);
return SR_OK;
}
-/* This stops acquisition on ALL devices, ignoring dev_index. */
-static int hw_dev_acquisition_stop(int dev_index, void *session_dev_id)
+/* TODO: This stops acquisition on ALL devices, ignoring dev_index. */
+static int hw_dev_acquisition_stop(int dev_index, void *cb_data)
{
struct sr_datafeed_packet packet;
struct sr_dev_inst *sdi;
struct context *ctx;
packet.type = SR_DF_END;
- sr_session_send(session_dev_id, &packet);
+ sr_session_send(cb_data, &packet);
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index))) {
sr_err("zp: %s: sdi was NULL", __func__);