X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=ab131965d93ab0f7c50204d7f0a121838645bfd1;hp=053591fccee48e9fdd4f6b119fcae5bf4f55cdcd;hb=4359a4da174e7aa3d2f24c4fcdb3816a3ba8e1a9;hpb=1b4b6a7cd517dd1fd672abe1553472bf3e2cb375 diff --git a/sigrok-cli.c b/sigrok-cli.c index 053591f..ab13196 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -65,8 +65,8 @@ static gchar *opt_continuous = NULL; static GOptionEntry optargs[] = { {"version", 'V', 0, G_OPTION_ARG_NONE, &opt_version, "Show version and support list", NULL}, - {"loglevel", 'l', 0, G_OPTION_ARG_INT, &opt_loglevel, "Select libsigrok loglevel", NULL}, - {"list-devices", 'D', 0, G_OPTION_ARG_NONE, &opt_list_devs, "List devices", NULL}, + {"loglevel", 'l', 0, G_OPTION_ARG_INT, &opt_loglevel, "Select libsigrok/libsigrokdecode loglevel", NULL}, + {"list-devices", 'D', 0, G_OPTION_ARG_NONE, &opt_list_devs, "Scan for devices", NULL}, {"device", 'd', 0, G_OPTION_ARG_STRING, &opt_dev, "Use specified device", NULL}, {"input-file", 'i', 0, G_OPTION_ARG_FILENAME, &opt_input_file, "Load input from file", NULL}, {"input-format", 'I', 0, G_OPTION_ARG_STRING, &opt_input_format, "Input format", NULL}, @@ -212,9 +212,9 @@ static void show_dev_detail(void) if (hwo->hwcap == SR_HWCAP_PATTERN_MODE) { printf(" %s", hwo->shortname); - if (sr_dev_info_get(dev, SR_DI_PATTERNMODES, + if (sr_dev_info_get(dev, SR_DI_PATTERNS, (const void **)&stropts) == SR_OK) { - printf(" - supported modes:\n"); + printf(" - supported patterns:\n"); for (i = 0; stropts[i]; i++) printf(" %s\n", stropts[i]); } else { @@ -279,7 +279,7 @@ static void show_pd_detail(void) printf("- %s\n %s\n", ann[0], ann[1]); } } - if ((doc = srd_decoder_doc(dec))) { + if ((doc = srd_decoder_doc_get(dec))) { printf("Documentation:\n%s\n", doc[0] == '\n' ? doc+1 : doc); g_free(doc); } @@ -438,7 +438,7 @@ static void datafeed_in(struct sr_dev *dev, struct sr_datafeed_packet *packet) goto cleanup; if (opt_pds) { - if (srd_session_feed(received_samples, (uint8_t*)filter_out, + if (srd_session_send(received_samples, (uint8_t*)filter_out, filter_out_len) != SRD_OK) sr_session_halt(); } else { @@ -498,7 +498,7 @@ static int register_pds(struct sr_dev *dev, const char *pdstring) * is the probe name as specified in the decoder class, and the * value is the probe number i.e. the order in which the PD's * incoming samples are arranged. */ - if (srd_inst_probes_set(di, pd_opthash) != SRD_OK) + if (srd_inst_probe_set_all(di, pd_opthash) != SRD_OK) goto err_out; g_hash_table_destroy(pd_opthash); pd_opthash = NULL; @@ -1016,7 +1016,7 @@ int main(int argc, char **argv) printf("Failed to register protocol decoders\n"); return 1; } - if (srd_register_callback(SRD_OUTPUT_ANN, + if (srd_pd_output_callback_add(SRD_OUTPUT_ANN, show_pd_annotation, NULL) != SRD_OK) { printf("Failed to register protocol decoder callback\n"); return 1;