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",