- if ((samplerate_s = sigrok_samplerate_string(samplerate)) == NULL)
- return -1; // FIXME
- snprintf(ctx->header + strlen(ctx->header), 512, "%s\n", samplerate_s);
- free(samplerate_s);
+ snprintf(ctx->header, 511, "%s\n", PACKAGE_STRING);
+ num_probes = g_slist_length(o->device->probes);
+ if (o->device->plugin) {
+ samplerate = *((uint64_t *) o->device->plugin->get_device_info(
+ o->device->plugin_index, DI_CUR_SAMPLERATE));
+ if (!(samplerate_s = sigrok_samplerate_string(samplerate))) {
+ free(ctx->header);
+ free(ctx);
+ return SIGROK_ERR;
+ }
+ snprintf(ctx->header + strlen(ctx->header),
+ 511 - strlen(ctx->header),
+ "Acquisition with %d/%d probes at %s\n",
+ ctx->num_enabled_probes, num_probes, samplerate_s);
+ free(samplerate_s);
+ }