From: Bert Vermeulen Date: Tue, 15 Jan 2013 16:20:57 +0000 (+0100) Subject: Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES. X-Git-Tag: dsupstream~351 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=6b8d6f93bb8df26ea04624009e2715cb6766b4f5;p=libsigrok.git Get rid of obsolete SR_DI_NUM_PROBES and SR_DI_PROBE_NAMES. Frontends should use the probe list in the device's sr_dev_inst to get this information. --- diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index de89422a..31c2fe11 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -41,11 +41,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "Probe", - NULL, -}; - extern const struct agdmm_job agdmm_jobs_u123x[]; extern const struct agdmm_recv agdmm_recvs_u123x[]; extern const struct agdmm_job agdmm_jobs_u125x[]; @@ -265,12 +260,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: return SR_ERR_ARG; } diff --git a/hardware/alsa/api.c b/hardware/alsa/api.c index 42f32104..2f854d6c 100644 --- a/hardware/alsa/api.c +++ b/hardware/alsa/api.c @@ -34,11 +34,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "Channel 0", "Channel 1", - NULL, -}; - SR_PRIV struct sr_dev_driver alsa_driver_info; static struct sr_dev_driver *di = &alsa_driver_info; @@ -157,12 +152,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = &devc->num_probes; - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_CUR_SAMPLERATE: *data = &devc->cur_samplerate; break; diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 8ff2e159..9e8c3c86 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -796,12 +796,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(NUM_PROBES); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_SAMPLERATES: *data = &samplerates; break; diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index c7a5ba83..0df9a7bc 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -297,15 +297,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(NUM_PROBES); - sr_spew("%s: Returning number of probes: %d.", __func__, - NUM_PROBES); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - sr_spew("%s: Returning probenames.", __func__); - break; case SR_DI_SAMPLERATES: fill_supported_samplerates_if_needed(); *data = &samplerates; diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index c4346ba6..62779385 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -44,11 +44,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "P1", - NULL, -}; - SR_PRIV struct sr_dev_driver colead_slm_driver_info; static struct sr_dev_driver *di = &colead_slm_driver_info; @@ -209,12 +204,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: return SR_ERR_ARG; } diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index b02e668c..5d7c006a 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -235,12 +235,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(NUM_PROBES); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_SAMPLERATES: *data = &samplerates; break; diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index 7264de25..93869a48 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -41,11 +41,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "Probe", - NULL, -}; - SR_PRIV struct sr_dev_driver flukedmm_driver_info; static struct sr_dev_driver *di = &flukedmm_driver_info; @@ -299,12 +294,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: return SR_ERR_ARG; } diff --git a/hardware/fx2lafw/fx2lafw.c b/hardware/fx2lafw/fx2lafw.c index 19f079b8..9eae9508 100644 --- a/hardware/fx2lafw/fx2lafw.c +++ b/hardware/fx2lafw/fx2lafw.c @@ -612,18 +612,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - if (sdi) { - devc = sdi->priv; - *data = GINT_TO_POINTER( - (devc->profile->dev_caps & DEV_CAPS_16BIT) ? - 16 : 8); - } else - return SR_ERR; - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_SAMPLERATES: *data = &samplerates; break; diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index 19ddd86e..aec6651f 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -428,12 +428,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(NUM_PROBES); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_BUFFERSIZES: *data = buffersizes; break; diff --git a/hardware/lascar-el-usb/api.c b/hardware/lascar-el-usb/api.c index 3ae8ba53..210480cc 100644 --- a/hardware/lascar-el-usb/api.c +++ b/hardware/lascar-el-usb/api.c @@ -40,11 +40,6 @@ static const int hwcaps[] = { 0 }; -static const char *probe_names[] = { - "P1", - NULL, -}; - /* Properly close and free all devices. */ static int clear_instances(void) { @@ -231,12 +226,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: sr_err("Unknown info_id: %d.", info_id); return SR_ERR_ARG; diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index 0ae1eb63..5dd040a6 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -307,12 +307,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = mso19_probe_names; - break; case SR_DI_SAMPLERATES: *data = &samplerates; break; diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index c9ca8f0a..fbcafda8 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -262,12 +262,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = ols_probe_names; - break; case SR_DI_SAMPLERATES: *data = &samplerates; break; diff --git a/hardware/rigol-ds1xx2/api.c b/hardware/rigol-ds1xx2/api.c index 4023ecca..1590f060 100644 --- a/hardware/rigol-ds1xx2/api.c +++ b/hardware/rigol-ds1xx2/api.c @@ -40,11 +40,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "CH1", "CH2", - NULL, -}; - static const struct sr_rational timebases[] = { /* nanoseconds */ { 2, 1000000000 }, @@ -339,12 +334,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(NUM_PROBES); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; case SR_DI_TIMEBASES: *data = timebases; break; diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index aa86f3b5..eee14891 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -43,11 +43,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "Probe", - NULL, -}; - SR_PRIV struct sr_dev_driver digitek_dt4000zc_driver_info; SR_PRIV struct sr_dev_driver tekpower_tp4000zc_driver_info; SR_PRIV struct sr_dev_driver metex_me31_driver_info; @@ -390,12 +385,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: return SR_ERR_ARG; } diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index 5c72c6a2..28e9bc85 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -39,11 +39,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "P1", - NULL, -}; - SR_PRIV struct sr_dev_driver tondaj_sl_814_driver_info; static struct sr_dev_driver *di = &tondaj_sl_814_driver_info; @@ -144,7 +139,7 @@ static GSList *hw_scan(GSList *options) sdi->priv = devc; sdi->driver = di; - probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, probe_names[0]); + probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"); if (!probe) { sr_err("Failed to create probe."); return NULL; @@ -212,12 +207,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: sr_err("Unknown info_id: %d.", info_id); return SR_ERR_ARG; diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index b4beb504..e0d36661 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -32,11 +32,6 @@ static const int hwcaps[] = { 0, }; -static const char *probe_names[] = { - "Probe", - NULL, -}; - SR_PRIV struct sr_dev_driver uni_t_ut61d_driver_info; SR_PRIV struct sr_dev_driver voltcraft_vc820_driver_info; @@ -178,14 +173,6 @@ static int hw_info_get(int info_id, const void **data, *data = hwcaps; sr_spew("%s: Returning hwcaps.", __func__); break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - sr_spew("%s: Returning number of probes.", __func__); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - sr_spew("%s: Returning probe names.", __func__); - break; case SR_DI_SAMPLERATES: /* TODO: Get rid of this. */ *data = NULL; diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index 63ae5fb7..496b51b7 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -44,11 +44,6 @@ static const int hwcaps[] = { 0 }; -static const char *probe_names[] = { - "P1", - NULL, -}; - /* Properly close and free all devices. */ static int clear_instances(void) { @@ -258,12 +253,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - *data = GINT_TO_POINTER(1); - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - break; default: sr_err("Unknown info_id: %d.", info_id); return SR_ERR_ARG; diff --git a/hardware/zeroplus-logic-cube/zeroplus.c b/hardware/zeroplus-logic-cube/zeroplus.c index 6dd20701..f2fcac63 100644 --- a/hardware/zeroplus-logic-cube/zeroplus.c +++ b/hardware/zeroplus-logic-cube/zeroplus.c @@ -538,19 +538,6 @@ static int hw_info_get(int info_id, const void **data, case SR_DI_HWCAPS: *data = hwcaps; break; - case SR_DI_NUM_PROBES: - if (sdi) { - devc = sdi->priv; - *data = GINT_TO_POINTER(devc->num_channels); - sr_spew("zp: %s: Returning number of channels: %d.", - __func__, devc->num_channels); - } else - return SR_ERR; - break; - case SR_DI_PROBE_NAMES: - *data = probe_names; - sr_spew("zp: %s: Returning probenames.", __func__); - break; case SR_DI_SAMPLERATES: *data = &samplerates; sr_spew("zp: %s: Returning samplerates.", __func__); diff --git a/libsigrok.h b/libsigrok.h index bf0b32e7..c2ad17f7 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -567,10 +567,6 @@ enum { SR_DI_HWOPTS = 10000, /** A list of capabilities supported by the device. */ SR_DI_HWCAPS, - /** The number of probes connected to this device. */ - SR_DI_NUM_PROBES, - /** The probe names on this device. */ - SR_DI_PROBE_NAMES, /** Samplerates supported by this device (struct sr_samplerates). */ SR_DI_SAMPLERATES, /** Types of logic trigger supported, out of "01crf" (char *). */