X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Fols.c;h=78a41bb0b4645032eb342ef1796246d165b6da6b;hb=43cd4637285833706f8a404ca027bcf0ee75b9ae;hp=9f9cc957bdb743566e01a96570b46bafb8f6b8d2;hpb=3699a8a1ff68a2f5f781c6ae74946adc8bc82673;p=libsigrok.git diff --git a/output/ols.c b/output/ols.c index 9f9cc957..78a41bb0 100644 --- a/output/ols.c +++ b/output/ols.c @@ -56,11 +56,11 @@ static int init(struct sr_output *o) static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx) { - struct sr_probe *probe; + struct sr_channel *ch; GSList *l; GString *s; GVariant *gvar; - int num_enabled_probes; + int num_enabled_channels; if (!ctx->samplerate && sr_config_get(sdi->driver, sdi, NULL, SR_CONF_SAMPLERATE, &gvar) == SR_OK) { @@ -68,19 +68,19 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx) g_variant_unref(gvar); } - num_enabled_probes = 0; - for (l = sdi->probes; l; l = l->next) { - probe = l->data; - if (probe->type != SR_PROBE_LOGIC) + num_enabled_channels = 0; + for (l = sdi->channels; l; l = l->next) { + ch = l->data; + if (ch->type != SR_CHANNEL_LOGIC) continue; - if (!probe->enabled) + if (!ch->enabled) continue; - num_enabled_probes++; + num_enabled_channels++; } s = g_string_sized_new(512); g_string_append_printf(s, ";Rate: %"PRIu64"\n", ctx->samplerate); - g_string_append_printf(s, ";Channels: %d\n", num_enabled_probes); + g_string_append_printf(s, ";Channels: %d\n", num_enabled_channels); g_string_append_printf(s, ";EnabledChannels: -1\n"); g_string_append_printf(s, ";Compressed: true\n"); g_string_append_printf(s, ";CursorEnabled: false\n"); @@ -88,8 +88,8 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx) return s; } -static int receive(struct sr_output *o, const struct sr_dev_inst *sdi, - const struct sr_datafeed_packet *packet, GString **out) +static int receive(struct sr_output *o, const struct sr_datafeed_packet *packet, + GString **out) { struct context *ctx; const struct sr_datafeed_meta *meta; @@ -117,7 +117,7 @@ static int receive(struct sr_output *o, const struct sr_dev_inst *sdi, logic = packet->payload; if (ctx->num_samples == 0) { /* First logic packet in the feed. */ - *out = gen_header(sdi, ctx); + *out = gen_header(o->sdi, ctx); } else *out = g_string_sized_new(512); for (i = 0; i <= logic->length - logic->unitsize; i += logic->unitsize) { @@ -151,7 +151,6 @@ static int cleanup(struct sr_output *o) SR_PRIV struct sr_output_format output_ols = { .id = "ols", .description = "OpenBench Logic Sniffer", - .df_type = SR_DF_LOGIC, .init = init, .receive = receive, .cleanup = cleanup