};
static const uint32_t devopts[] = {
+ SR_CONF_CONN | SR_CONF_GET,
SR_CONF_LIMIT_SAMPLES | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
SR_CONF_TRIGGER_MATCH | SR_CONF_LIST,
DEFAULT_SAMPLERATE);
sdi->inst_type = SR_INST_SERIAL;
sdi->conn = serial;
+ sdi->connection_id = g_strdup(serial->port);
serial_close(serial);
devc = sdi->priv;
switch (key) {
+ case SR_CONF_CONN:
+ if (!sdi->conn || !sdi->connection_id)
+ return SR_ERR_NA;
+ *data = g_variant_new_string(sdi->connection_id);
+ break;
case SR_CONF_SAMPLERATE:
*data = g_variant_new_uint64(devc->cur_samplerate);
break;
/* If the device stops sending for longer than it takes to send a byte,
* that means it's finished. But wait at least 100 ms to be safe.
*/
- serial_source_add(sdi->session, serial, G_IO_IN, 100, ols_receive_data,
- (struct sr_dev_inst *)sdi);
-
- return SR_OK;
+ return serial_source_add(sdi->session, serial, G_IO_IN, 100,
+ ols_receive_data, (struct sr_dev_inst *)sdi);
}
static int dev_acquisition_stop(struct sr_dev_inst *sdi)