X-Git-Url: https://sigrok.org/gitweb/?p=sigrok-cli.git;a=blobdiff_plain;f=sigrok-cli.c;h=8c92d9fff3b70826eb3a7cafd435ce252522703a;hp=505f10e4f2ebd461a50fea41ec1d16f1639a92ee;hb=fa7827c587a00a6aebc736bee34380abc7efc525;hpb=15d920a97c10e6f04147094b48936468fac910b0;ds=sidebyside diff --git a/sigrok-cli.c b/sigrok-cli.c index 505f10e..8c92d9f 100644 --- a/sigrok-cli.c +++ b/sigrok-cli.c @@ -95,7 +95,7 @@ static void show_version(void) printf("sigrok-cli %s\n\n", VERSION); printf("Supported hardware drivers:\n"); - plugins = sr_hwplugins_list(); + plugins = sr_hw_list(); for (p = plugins; p; p = p->next) { plugin = p->data; printf(" %-20s %s\n", plugin->name, plugin->longname); @@ -116,8 +116,8 @@ static void show_version(void) if (srd_init(NULL) == SRD_OK) { printf("Supported protocol decoders:\n"); - srd_load_all_decoders(); - for (l = srd_list_decoders(); l; l = l->next) { + srd_decoders_load_all(); + for (l = srd_decoders_list(); l; l = l->next) { dec = l->data; printf(" %-20s %s\n", dec->id, dec->longname); } @@ -203,7 +203,7 @@ static void show_device_detail(void) title = "Supported options:\n"; capabilities = device->plugin->get_capabilities(); for (cap = 0; capabilities[cap]; cap++) { - if (!(hwo = sr_hwplugins_hwcap_get(capabilities[cap]))) + if (!(hwo = sr_hw_hwcap_get(capabilities[cap]))) continue; if (title) { @@ -266,7 +266,7 @@ static void show_pd_detail(void) pdtokens = g_strsplit(opt_pds, ",", -1); for (pdtok = pdtokens; *pdtok; pdtok++) { - if (!(dec = srd_get_decoder_by_id(*pdtok))) { + if (!(dec = srd_decoder_get_by_id(*pdtok))) { printf("Protocol decoder %s not found.", *pdtok); return; } @@ -485,7 +485,7 @@ static int register_pds(struct sr_device *device, const char *pdstring) pd_name = g_strdup(g_hash_table_lookup(pd_opthash, "sigrok_key")); g_hash_table_remove(pd_opthash, "sigrok_key"); - if (srd_load_decoder(pd_name) != SRD_OK) { + if (srd_decoder_load(pd_name) != SRD_OK) { fprintf(stderr, "Failed to load protocol decoder %s\n", pd_name); goto err_out; } @@ -499,7 +499,7 @@ static int register_pds(struct sr_device *device, 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_set_probes(di, pd_opthash) != SRD_OK) + if (srd_inst_probes_set(di, pd_opthash) != SRD_OK) goto err_out; g_hash_table_destroy(pd_opthash); pd_opthash = NULL; @@ -837,7 +837,7 @@ static void run_session(void) return; if (opt_continuous) { - if (!sr_hwplugin_has_hwcap(device->plugin, SR_HWCAP_CONTINUOUS)) { + if (!sr_hw_has_hwcap(device->plugin, SR_HWCAP_CONTINUOUS)) { printf("This device does not support continuous sampling."); sr_session_destroy(); return; @@ -869,7 +869,7 @@ static void run_session(void) return; } - if (sr_hwplugin_has_hwcap(device->plugin, SR_HWCAP_LIMIT_MSEC)) { + if (sr_hw_has_hwcap(device->plugin, SR_HWCAP_LIMIT_MSEC)) { if (device->plugin->set_configuration(device->plugin_index, SR_HWCAP_LIMIT_MSEC, &time_msec) != SR_OK) { printf("Failed to configure time limit.\n");