serial_write() doesn't exist anymore, for example.
static const uint32_t devopts[] = {
SR_CONF_LIMIT_SAMPLES | SR_CONF_SET,
SR_CONF_SAMPLERATE | SR_CONF_GET | SR_CONF_SET | SR_CONF_LIST,
- SR_CONF_TRIGGER_TYPE | SR_CONF_LIST,
SR_CONF_TRIGGER_SLOPE | SR_CONF_SET,
SR_CONF_HORIZ_TRIGGERPOS | SR_CONF_SET,
SR_CONF_CAPTURE_RATIO | SR_CONF_SET,
const char *serialcomm = NULL;
GSList *l;
struct sr_config *src;
- struct udev *udev;
int chtype;
for (l = options; l; l = l->next) {
if (!serialcomm)
serialcomm = SERIALCOMM;
+ /*
udev = udev_new();
if (!udev) {
sr_err("Failed to initialize udev.");
sr_channel_new(sdi, i, chtype, TRUE, channel_names[i]);
}
}
+ */
return std_scan_complete(di, devices);
}
const char *slope;
int trigger_pos;
double pos;
+ int idx;
(void)cg;
case SR_CONF_SAMPLERATE:
*data = std_gvar_samplerates_steps(ARRAY_AND_SIZE(samplerates));
break;
- case SR_CONF_TRIGGER_TYPE:
- *data = g_variant_new_string(TRIGGER_TYPE);
- break;
default:
return SR_ERR_NA;
}
ret = SR_ERR;
- if (serial->fd < 0)
- goto ret;
-
buf = g_malloc(s);
p = buf;
w = 0;
while (w < s) {
- ret = serial_write(serial, buf + w, s - w);
+ ret = serial_write_blocking(serial, buf + w, s - w, 10);
if (ret < 0) {
ret = SR_ERR;
goto free;
ret = SR_OK;
free:
g_free(buf);
-ret:
return ret;
}
return ret;
uint8_t buf = 0;
- if (serial_read(serial, &buf, 1) != 1) /* FIXME: Need timeout */
+ if (serial_read_blocking(serial, &buf, 1, 10) != 1)
ret = SR_ERR;
if (!info)
*info = buf;
if (!devc)
return TRUE;
- s = serial_read(devc->serial, in, sizeof(in));
+ s = serial_read_blocking(devc->serial, in, sizeof(in), 10);
if (s <= 0)
return FALSE;
devc->trigger_chan = 3; //LA combination trigger
devc->use_trigger = FALSE;
+ /*
for (l = sdi->channels; l; l = l->next) {
ch = (struct sr_channel *)l->data;
if (ch->enabled == FALSE)
devc->la_trigger |= channel_bit;
}
}
+ */
return SR_OK;
}
#include <stdint.h>
#include <string.h>
#include <glib.h>
-#include <libudev.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define USB_PRODUCT "f190"
#define NUM_TRIGGER_STAGES 4
-#define TRIGGER_TYPE "01" //the first r/f is used for the whole group
#define SERIALCOMM "460800/8n1/flow=2"
#define SERIALCONN "/dev/ttyUSB0"
#define CLOCK_RATE SR_MHZ(100)