/*
- * This file is part of the sigrok project.
+ * This file is part of the libsigrok project.
*
* Copyright (C) 2013 Bert Vermeulen <bert@biot.com>
*
devc->probe_mask = 0xffffffff;
devc->flag_reg = 0;
- devc->serial = NULL;
-
return devc;
}
SR_PRIV void abort_acquisition(const struct sr_dev_inst *sdi)
{
struct sr_datafeed_packet packet;
- struct dev_context *devc;
+ struct sr_serial_dev_inst *serial;
- devc = sdi->priv;
- sr_source_remove(devc->serial->fd);
+ serial = sdi->conn;
+ sr_source_remove(serial->fd);
/* Terminate session */
packet.type = SR_DF_END;
SR_PRIV int ols_receive_data(int fd, int revents, void *cb_data)
{
+ struct drv_context *drvc;
+ struct dev_context *devc;
+ struct sr_serial_dev_inst *serial;
struct sr_datafeed_packet packet;
struct sr_datafeed_logic logic;
struct sr_dev_inst *sdi;
- struct drv_context *drvc;
- struct dev_context *devc;
GSList *l;
uint32_t sample;
int num_channels, offset, i, j;
for (l = drvc->instances; l; l = l->next) {
sdi = l->data;
devc = sdi->priv;
- if (devc->serial->fd == fd)
+ serial = sdi->conn;
+ if (serial->fd == fd)
break;
devc = NULL;
}
}
if (revents == G_IO_IN) {
- if (serial_read(devc->serial, &byte, 1) != 1)
+ if (serial_read(serial, &byte, 1) != 1)
return FALSE;
/* Ignore it if we've read enough. */
}
g_free(devc->raw_sample_buf);
- serial_flush(devc->serial);
+ serial_flush(serial);
abort_acquisition(sdi);
- serial_close(devc->serial);
}
return TRUE;