return;
/*
- * Determine the annotation's layout from the verbosity of the
- * log level:
+ * Determine which fields of the annotation to display. Inspect
+ * user specified options as well as the verbosity of the log level:
* - Optionally show the sample numbers for the annotation's span.
* - Always show the protocol decoder ID.
* - Optionally show the annotation's class description.
* recipients might have to deal with a set of text variants.
*/
show_snum = show_class = show_quotes = show_abbrev = FALSE;
- if (opt_loglevel > SR_LOG_WARN) {
+ if (opt_pd_samplenum || opt_loglevel > SR_LOG_WARN) {
show_snum = TRUE;
}
if (opt_loglevel > SR_LOG_WARN) {
/* Not in the list of PDs whose meta output we're showing. */
return;
- if (opt_loglevel > SR_LOG_WARN)
+ if (opt_pd_samplenum || opt_loglevel > SR_LOG_WARN)
printf("%"PRIu64"-%"PRIu64" ", pdata->start_sample, pdata->end_sample);
printf("%s: ", pdata->pdo->proto_id);
printf("%s: %s", pdata->pdo->meta_name, g_variant_print(pdata->data, FALSE));
gchar *opt_pd_annotations = NULL;
gchar *opt_pd_meta = NULL;
gchar *opt_pd_binary = NULL;
+gboolean opt_pd_samplenum = FALSE;
#endif
gchar *opt_input_format = NULL;
gchar *opt_output_format = NULL;
"Protocol decoder meta output to show", NULL},
{"protocol-decoder-binary", 'B', 0, G_OPTION_ARG_CALLBACK, &check_opt_pd_binary,
"Protocol decoder binary output to show", NULL},
+ {"protocol-decoder-samplenum", 0, 0, G_OPTION_ARG_NONE, &opt_pd_samplenum,
+ "Show sample numbers in protocol decoder output", NULL},
#endif
{"scan", 0, 0, G_OPTION_ARG_NONE, &opt_scan_devs,
"Scan for devices", NULL},
extern gchar *opt_pd_annotations;
extern gchar *opt_pd_meta;
extern gchar *opt_pd_binary;
+extern gboolean opt_pd_samplenum;
#endif
extern gchar *opt_input_format;
extern gchar *opt_output_format;