X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=input%2Fbinary.c;h=4d6c42461e64051af849fddf86ecef1a4f513e98;hb=f366e86c68071fa7888259aa3963b213caa81b51;hp=89a6b25bb9cbfb73289df0e53c6b385a2976a007;hpb=ee7489d23449a3f5a81777fbdb3309dfe22bcecd;p=libsigrok.git diff --git a/input/binary.c b/input/binary.c index 89a6b25b..4d6c4246 100644 --- a/input/binary.c +++ b/input/binary.c @@ -67,6 +67,7 @@ static int loadfile(struct sr_input *in, const char *filename) { struct sr_datafeed_header header; struct sr_datafeed_packet packet; + struct sr_datafeed_meta_logic meta; struct sr_datafeed_logic logic; unsigned char buffer[CHUNKSIZE]; int fd, size, num_probes; @@ -78,13 +79,18 @@ static int loadfile(struct sr_input *in, const char *filename) /* send header */ header.feed_version = 1; - header.num_logic_probes = num_probes; - header.samplerate = 0; gettimeofday(&header.starttime, NULL); packet.type = SR_DF_HEADER; packet.payload = &header; sr_session_send(in->vdev, &packet); + /* Send metadata about the SR_DF_LOGIC packets to come. */ + packet.type = SR_DF_META_LOGIC; + packet.payload = &meta; + meta.samplerate = 0; + meta.num_probes = num_probes; + sr_session_send(in->vdev, &packet); + /* chop up the input file into chunks and feed it into the session bus */ packet.type = SR_DF_LOGIC; packet.payload = &logic;