struct sr_dev_inst *sdi;
libusb_device **devlist;
struct libusb_device_descriptor des;
- int err, i;
+ int i;
if (!(sdi = sr_dev_inst_get(dev_insts, dev_index)))
return NULL;
libusb_get_device_list(usb_context, &devlist);
for (i = 0; devlist[i]; i++) {
/* TODO: Error handling. */
- err = opendev4(&sdi, devlist[i], &des);
+ opendev4(&sdi, devlist[i], &des);
}
} else {
/* Status must be SR_ST_ACTIVE, i.e. already in use... */
for (i = 0; i < NUM_PACKETS; i++) {
/* TODO: Handle errors, handle incomplete reads. */
size = read(fd, buf, PACKET_SIZE);
- logic.length = PACKET_SIZE;
+ logic.length = size;
sr_session_bus(in->vdev, &packet);
}
close(fd); /* FIXME */
struct context *ctx;
struct sr_probe *probe;
GSList *l;
- int num_probes;
uint64_t samplerate;
if (!o) {
o->internal = ctx;
- /* Get the number of probes, their names, and the unitsize. */
+ /* Get the probe names and the unitsize. */
/* TODO: Error handling. */
for (l = o->dev->probes; l; l = l->next) {
probe = l->data;
ctx->probelist[ctx->num_enabled_probes] = 0;
ctx->unitsize = (ctx->num_enabled_probes + 7) / 8;
- num_probes = g_slist_length(o->dev->probes);
-
if (sr_dev_has_hwcap(o->dev, SR_HWCAP_SAMPLERATE)) {
samplerate = *((uint64_t *) o->dev->plugin->dev_info_get(
o->dev->plugin_index, SR_DI_CUR_SAMPLERATE));
static int event(struct sr_output *o, int event_type, char **data_out,
uint64_t *length_out)
{
- struct context *ctx;
-
if (!o) {
sr_err("gnuplot out: %s: o was NULL", __func__);
return SR_ERR_ARG;
return SR_ERR_ARG;
}
- ctx = o->internal;
-
switch (event_type) {
case SR_DF_TRIGGER:
/* TODO: Can a trigger mark be in a gnuplot data file? */
static int event(struct sr_output *o, int event_type, char **data_out,
uint64_t *length_out)
{
- struct context *ctx;
char *outbuf;
- ctx = o->internal;
switch (event_type) {
case SR_DF_END:
outbuf = g_strdup("$dumpoff\n$end\n");
struct zip *archive;
struct zip_file *zf;
struct zip_stat zs;
- struct sr_session *session;
struct sr_dev *dev;
struct sr_probe *probe;
int ret, err, probenum, devcnt, i, j;
return SR_ERR;
}
- session = sr_session_new();
+ sr_session_new();
devcnt = 0;
capturefiles = g_ptr_array_new_with_free_func(g_free);