]> sigrok.org Git - sigrok-cli.git/blobdiff - decode.c
Implement support for running transform modules.
[sigrok-cli.git] / decode.c
index 7712ea10a2a2580df9e6297446581381f3f9c520..2e831f74ee1985a735e3da027a933ea2d3328bca 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -250,9 +250,13 @@ static void map_pd_inst_channels(void *key, void *value, void *user_data)
 
 void map_pd_channels(struct sr_dev_inst *sdi)
 {
+       GSList *channels;
+
+       channels = sr_dev_inst_channels_get(sdi);
+
        if (pd_channel_maps) {
                g_hash_table_foreach(pd_channel_maps, &map_pd_inst_channels,
-                                    sdi->channels);
+                                    channels);
                g_hash_table_destroy(pd_channel_maps);
                pd_channel_maps = NULL;
        }
@@ -465,7 +469,7 @@ void show_pd_annotations(struct srd_proto_data *pdata, void *cb_data)
        show = FALSE;
        for (l = ann_list; l; l = l->next) {
                if (GPOINTER_TO_INT(l->data) == -1
-                               || GPOINTER_TO_INT(l->data) == pda->ann_format) {
+                               || GPOINTER_TO_INT(l->data) == pda->ann_class) {
                        show = TRUE;
                        break;
                }
@@ -484,7 +488,7 @@ void show_pd_annotations(struct srd_proto_data *pdata, void *cb_data)
                } else {
                        /* Protocol decoder id, annotation class,
                         * all annotation strings. */
-                       ann_descr = g_slist_nth_data(dec->annotations, pda->ann_format);
+                       ann_descr = g_slist_nth_data(dec->annotations, pda->ann_class);
                        printf(" %s: %s:", pdata->pdo->proto_id, ann_descr[0]);
                        for (i = 0; pda->ann_text[i]; i++)
                                printf(" \"%s\"", pda->ann_text[i]);