X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fasix-sigma%2Fasix-sigma.c;h=39e2dbed79cb8ef364557173c0a6b7a96abb436b;hb=f366e86c68071fa7888259aa3963b213caa81b51;hp=3c2f269a0938cf56546d9b30ddd3a27b5d2afb52;hpb=ee7489d23449a3f5a81777fbdb3309dfe22bcecd;p=libsigrok.git diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 3c2f269a..39e2dbed 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -1265,6 +1265,7 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data) struct context *ctx; struct sr_datafeed_packet *packet; struct sr_datafeed_header *header; + struct sr_datafeed_meta_logic meta; struct clockselect_50 clockselect; int frac, triggerpin, ret; uint8_t triggerselect; @@ -1366,17 +1367,23 @@ static int hw_dev_acquisition_start(int dev_index, void *cb_data) return SR_ERR_MALLOC; } - /* Add capture source. */ - sr_source_add(0, G_IO_IN, 10, receive_data, sdi); - /* Send header packet to the session bus. */ packet->type = SR_DF_HEADER; packet->payload = header; header->feed_version = 1; gettimeofday(&header->starttime, NULL); - header->samplerate = ctx->cur_samplerate; - header->num_logic_probes = ctx->num_probes; sr_session_send(ctx->session_dev_id, packet); + + /* Send metadata about the SR_DF_LOGIC packets to come. */ + packet->type = SR_DF_META_LOGIC; + packet->payload = &meta; + meta.samplerate = ctx->cur_samplerate; + meta.num_probes = ctx->num_probes; + sr_session_send(ctx->session_dev_id, packet); + + /* Add capture source. */ + sr_source_add(0, G_IO_IN, 10, receive_data, sdi); + g_free(header); g_free(packet);