21 #include <sys/types.h>
27 #include "sigrok-internal.h"
29 #define CHUNKSIZE (512 * 1024)
30 #define DEFAULT_NUM_PROBES 8
32 static int format_match(
const char *filename)
47 num_probes = strtoul(in->
param, NULL, 10);
57 for (i = 0; i < num_probes; i++) {
66 static int loadfile(
struct sr_input *in,
const char *filename)
72 int fd, size, num_probes;
74 if ((fd = open(filename, O_RDONLY)) == -1)
80 header.feed_version = 1;
81 header.num_logic_probes = num_probes;
82 header.samplerate = 0;
83 gettimeofday(&header.starttime, NULL);
85 packet.payload = &header;
90 packet.payload = &logic;
91 logic.unitsize = (num_probes + 7) / 8;
93 while ((size = read(fd, buffer,
CHUNKSIZE)) > 0) {
108 .description =
"Raw binary",
#define SR_MAX_PROBENAME_LEN
SR_API int sr_dev_probe_add(struct sr_dev *dev, const char *name)
Add a probe with the specified name to the specified device.
SR_API struct sr_dev * sr_dev_new(const struct sr_dev_driver *driver, int driver_index)
Create a new device.
SR_PRIV int sr_session_send(struct sr_dev *dev, struct sr_datafeed_packet *packet)
Send a packet to whatever is listening on the datafeed bus.