From: Uwe Hermann Date: Mon, 24 Mar 2014 20:36:04 +0000 (+0100) Subject: Rename sr_probe_new() to sr_channel_new(). X-Git-Tag: libsigrok-0.3.0~107 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=56d0d24535700fb53e47a25ad5c73d34697695fa;p=libsigrok.git Rename sr_probe_new() to sr_channel_new(). This fixes parts of bug #259. --- diff --git a/device.c b/device.c index b539ecee..04adcccf 100644 --- a/device.c +++ b/device.c @@ -48,7 +48,7 @@ * * @return NULL (failure) or new struct sr_channel*. */ -SR_PRIV struct sr_channel *sr_probe_new(int index, int type, +SR_PRIV struct sr_channel *sr_channel_new(int index, int type, gboolean enabled, const char *name) { struct sr_channel *ch; diff --git a/hardware/agilent-dmm/api.c b/hardware/agilent-dmm/api.c index c358640d..bbe4c71f 100644 --- a/hardware/agilent-dmm/api.c +++ b/hardware/agilent-dmm/api.c @@ -141,7 +141,7 @@ static GSList *scan(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/alsa/protocol.c b/hardware/alsa/protocol.c index d06a10ef..987e7a7e 100644 --- a/hardware/alsa/protocol.c +++ b/hardware/alsa/protocol.c @@ -159,7 +159,7 @@ static void alsa_scan_handle_dev(GSList **devices, for (i = 0; i < devc->num_channels; i++) { snprintf(p_name, sizeof(p_name), "Ch_%d", i); - if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, p_name))) + if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, p_name))) goto scan_error_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } diff --git a/hardware/appa-55ii/api.c b/hardware/appa-55ii/api.c index 667b1c97..8bbe45a0 100644 --- a/hardware/appa-55ii/api.c +++ b/hardware/appa-55ii/api.c @@ -111,10 +111,10 @@ static GSList *scan(GSList *options) sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "T1"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "T2"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "T2"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/asix-sigma/asix-sigma.c b/hardware/asix-sigma/asix-sigma.c index 932de635..d32e9128 100644 --- a/hardware/asix-sigma/asix-sigma.c +++ b/hardware/asix-sigma/asix-sigma.c @@ -464,7 +464,7 @@ static GSList *scan(GSList *options) sdi->driver = di; for (i = 0; channel_names[i]; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_names[i]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/atten-pps3xxx/api.c b/hardware/atten-pps3xxx/api.c index 6dc62511..e74c40de 100644 --- a/hardware/atten-pps3xxx/api.c +++ b/hardware/atten-pps3xxx/api.c @@ -167,7 +167,7 @@ static GSList *scan(GSList *options, int modelid) sdi->conn = serial; for (i = 0; i < MAX_CHANNELS; i++) { snprintf(channel, 10, "CH%d", i + 1); - ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel); + ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel); sdi->channels = g_slist_append(sdi->channels, ch); cg = g_malloc(sizeof(struct sr_channel_group)); cg->name = g_strdup(channel); diff --git a/hardware/brymen-bm86x/api.c b/hardware/brymen-bm86x/api.c index 22a4862a..1c7aaa2f 100644 --- a/hardware/brymen-bm86x/api.c +++ b/hardware/brymen-bm86x/api.c @@ -86,10 +86,10 @@ static GSList *scan(GSList *options) sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P2"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P2"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/brymen-dmm/api.c b/hardware/brymen-dmm/api.c index fced9654..52b49a18 100644 --- a/hardware/brymen-dmm/api.c +++ b/hardware/brymen-dmm/api.c @@ -89,7 +89,7 @@ static GSList *brymen_scan(const char *conn, const char *serialcomm) sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/cem-dt-885x/api.c b/hardware/cem-dt-885x/api.c index 6a5b3275..7170c6f7 100644 --- a/hardware/cem-dt-885x/api.c +++ b/hardware/cem-dt-885x/api.c @@ -126,7 +126,7 @@ static GSList *scan(GSList *options) sdi->inst_type = SR_INST_SERIAL; sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "SPL"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/center-3xx/api.c b/hardware/center-3xx/api.c index e2b99004..68fa1d55 100644 --- a/hardware/center-3xx/api.c +++ b/hardware/center-3xx/api.c @@ -103,7 +103,7 @@ static GSList *center_scan(const char *conn, const char *serialcomm, int idx) sdi->driver = center_devs[idx].di; for (i = 0; i < center_devs[idx].num_channels; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, + if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel_names[i]))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/chronovu-la8/api.c b/hardware/chronovu-la8/api.c index 9d079559..75757c24 100644 --- a/hardware/chronovu-la8/api.c +++ b/hardware/chronovu-la8/api.c @@ -154,7 +154,7 @@ static GSList *scan(GSList *options) sdi->priv = devc; for (i = 0; chronovu_la8_channel_names[i]; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, chronovu_la8_channel_names[i]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/colead-slm/api.c b/hardware/colead-slm/api.c index a73fe299..cd3b8ce8 100644 --- a/hardware/colead-slm/api.c +++ b/hardware/colead-slm/api.c @@ -97,7 +97,7 @@ static GSList *scan(GSList *options) sdi->inst_type = SR_INST_SERIAL; sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/conrad-digi-35-cpu/api.c b/hardware/conrad-digi-35-cpu/api.c index 9d5f9d0d..7a21fb77 100644 --- a/hardware/conrad-digi-35-cpu/api.c +++ b/hardware/conrad-digi-35-cpu/api.c @@ -101,7 +101,7 @@ static GSList *scan(GSList *options) sdi->conn = serial; sdi->priv = NULL; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CH1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "CH1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 3c6585dd..3573d50e 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -309,7 +309,7 @@ static GSList *scan(GSList *options) cg->priv = NULL; for (i = 0; i < num_logic_channels; i++) { sprintf(channel_name, "D%d", i); - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name))) + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); cg->channels = g_slist_append(cg->channels, ch); @@ -321,7 +321,7 @@ static GSList *scan(GSList *options) pattern = 0; for (i = 0; i < num_analog_channels; i++) { sprintf(channel_name, "A%d", i); - if (!(ch = sr_probe_new(i + num_logic_channels, + if (!(ch = sr_channel_new(i + num_logic_channels, SR_PROBE_ANALOG, TRUE, channel_name))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/fluke-dmm/api.c b/hardware/fluke-dmm/api.c index 83aaad4c..f2453aa2 100644 --- a/hardware/fluke-dmm/api.c +++ b/hardware/fluke-dmm/api.c @@ -135,7 +135,7 @@ static GSList *fluke_scan(const char *conn, const char *serialcomm) sdi->conn = serial; sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/fx2lafw/api.c b/hardware/fx2lafw/api.c index b11a2e1a..eabf6bd7 100644 --- a/hardware/fx2lafw/api.c +++ b/hardware/fx2lafw/api.c @@ -197,7 +197,7 @@ static GSList *scan(GSList *options) /* Fill in channellist according to this device's profile. */ num_logic_channels = prof->dev_caps & DEV_CAPS_16BIT ? 16 : 8; for (j = 0; j < num_logic_channels; j++) { - if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(j, SR_PROBE_LOGIC, TRUE, channel_names[j]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/gmc-mh-1x-2x/api.c b/hardware/gmc-mh-1x-2x/api.c index 98d200e7..2f05993e 100644 --- a/hardware/gmc-mh-1x-2x/api.c +++ b/hardware/gmc-mh-1x-2x/api.c @@ -240,7 +240,7 @@ static GSList *scan_1x_2x_rs232(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = &gmc_mh_1x_2x_rs232_driver_info; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); @@ -343,7 +343,7 @@ static GSList *scan_2x_bd232(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = &gmc_mh_2x_bd232_driver_info; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) goto exit_err; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/hameg-hmo/protocol.c b/hardware/hameg-hmo/protocol.c index eedaf797..6348da18 100644 --- a/hardware/hameg-hmo/protocol.c +++ b/hardware/hameg-hmo/protocol.c @@ -614,7 +614,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) /* Add analog channels. */ for (i = 0; i < scope_models[model_index].analog_channels; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, (*scope_models[model_index].analog_names)[i]))) return SR_ERR_MALLOC; sdi->channels = g_slist_append(sdi->channels, ch); @@ -637,7 +637,7 @@ SR_PRIV int hmo_init_device(struct sr_dev_inst *sdi) /* Add digital channels. */ for (i = 0; i < scope_models[model_index].digital_channels; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, (*scope_models[model_index].digital_names)[i]))) return SR_ERR_MALLOC; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/hantek-dso/api.c b/hardware/hantek-dso/api.c index c4c1464a..92451605 100644 --- a/hardware/hantek-dso/api.c +++ b/hardware/hantek-dso/api.c @@ -176,7 +176,7 @@ static struct sr_dev_inst *dso_dev_new(int index, const struct dso_profile *prof * a trigger source internal to the device. */ for (i = 0; channel_names[i]; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel_names[i]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/ikalogic-scanalogic2/api.c b/hardware/ikalogic-scanalogic2/api.c index 0443bc9f..9ff4a285 100644 --- a/hardware/ikalogic-scanalogic2/api.c +++ b/hardware/ikalogic-scanalogic2/api.c @@ -137,7 +137,7 @@ static GSList *scan(GSList *options) sdi->conn = usb; for (i = 0; channel_names[i]; i++) { - ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_names[i]); sdi->channels = g_slist_append(sdi->channels, ch); devc->channels[i] = ch; diff --git a/hardware/ikalogic-scanaplus/api.c b/hardware/ikalogic-scanaplus/api.c index 07ef3df3..369aed47 100644 --- a/hardware/ikalogic-scanaplus/api.c +++ b/hardware/ikalogic-scanaplus/api.c @@ -133,7 +133,7 @@ static GSList *scan(GSList *options) sdi->priv = devc; for (i = 0; channel_names[i]; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_names[i]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/kecheng-kc-330b/api.c b/hardware/kecheng-kc-330b/api.c index fcb54381..21d202f5 100644 --- a/hardware/kecheng-kc-330b/api.c +++ b/hardware/kecheng-kc-330b/api.c @@ -135,7 +135,7 @@ static GSList *scan(GSList *options) sdi->driver = di; sdi->inst_type = SR_INST_USB; sdi->conn = l->data; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "SPL"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "SPL"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/lascar-el-usb/protocol.c b/hardware/lascar-el-usb/protocol.c index eeb22199..5347e1eb 100644 --- a/hardware/lascar-el-usb/protocol.c +++ b/hardware/lascar-el-usb/protocol.c @@ -330,18 +330,18 @@ static struct sr_dev_inst *lascar_identify(unsigned char *config) if (profile->logformat == LOG_TEMP_RH) { /* Model this as two channels: temperature and humidity. */ - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temp"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Temp"))) return NULL; sdi->channels = g_slist_append(NULL, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Hum"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Hum"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); } else if (profile->logformat == LOG_CO) { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "CO"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "CO"))) return NULL; sdi->channels = g_slist_append(NULL, ch); } else { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(NULL, ch); } diff --git a/hardware/link-mso19/api.c b/hardware/link-mso19/api.c index f1b28e93..9e0273ae 100644 --- a/hardware/link-mso19/api.c +++ b/hardware/link-mso19/api.c @@ -219,7 +219,7 @@ static GSList *scan(GSList *options) for (i = 0; i < NUM_PROBES; i++) { struct sr_channel *ch; ptype = (i == 0) ? SR_PROBE_ANALOG : SR_PROBE_LOGIC; - if (!(ch = sr_probe_new(i, ptype, TRUE, + if (!(ch = sr_channel_new(i, ptype, TRUE, mso19_channel_names[i]))) return 0; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/mic-985xx/api.c b/hardware/mic-985xx/api.c index 257d0d18..09cd7d60 100644 --- a/hardware/mic-985xx/api.c +++ b/hardware/mic-985xx/api.c @@ -101,12 +101,12 @@ static GSList *mic_scan(const char *conn, const char *serialcomm, int idx) sdi->priv = devc; sdi->driver = mic_devs[idx].di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "Temperature"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "Temperature"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); if (mic_devs[idx].has_humidity) { - if (!(ch = sr_probe_new(1, SR_PROBE_ANALOG, TRUE, "Humidity"))) + if (!(ch = sr_channel_new(1, SR_PROBE_ANALOG, TRUE, "Humidity"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } diff --git a/hardware/norma-dmm/api.c b/hardware/norma-dmm/api.c index 652e7bef..7a98f958 100644 --- a/hardware/norma-dmm/api.c +++ b/hardware/norma-dmm/api.c @@ -128,7 +128,7 @@ static GSList *scan(GSList *options) sdi->conn = serial; sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/openbench-logic-sniffer/api.c b/hardware/openbench-logic-sniffer/api.c index 25889711..8284db15 100644 --- a/hardware/openbench-logic-sniffer/api.c +++ b/hardware/openbench-logic-sniffer/api.c @@ -177,7 +177,7 @@ static GSList *scan(GSList *options) "Sump", "Logic Analyzer", "v1.0"); sdi->driver = di; for (i = 0; i < 32; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, ols_channel_names[i]))) return 0; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/openbench-logic-sniffer/protocol.c b/hardware/openbench-logic-sniffer/protocol.c index 28b1353e..89f68429 100644 --- a/hardware/openbench-logic-sniffer/protocol.c +++ b/hardware/openbench-logic-sniffer/protocol.c @@ -203,7 +203,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) case 0x00: /* Number of usable channels */ for (ui = 0; ui < tmp_int; ui++) { - if (!(ch = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(ui, SR_PROBE_LOGIC, TRUE, ols_channel_names[ui]))) return 0; sdi->channels = g_slist_append(sdi->channels, ch); @@ -241,7 +241,7 @@ SR_PRIV struct sr_dev_inst *get_metadata(struct sr_serial_dev_inst *serial) case 0x00: /* Number of usable channels */ for (ui = 0; ui < tmp_c; ui++) { - if (!(ch = sr_probe_new(ui, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(ui, SR_PROBE_LOGIC, TRUE, ols_channel_names[ui]))) return 0; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/rigol-ds/api.c b/hardware/rigol-ds/api.c index ce78840b..0ed76e52 100644 --- a/hardware/rigol-ds/api.c +++ b/hardware/rigol-ds/api.c @@ -335,7 +335,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) for (i = 0; i < model->analog_channels; i++) { if (!(channel_name = g_strdup_printf("CH%d", i + 1))) return NULL; - ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, channel_name); + ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channel_name); sdi->channels = g_slist_append(sdi->channels, ch); devc->analog_groups[i].name = channel_name; devc->analog_groups[i].channels = g_slist_append(NULL, ch); @@ -347,7 +347,7 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) for (i = 0; i < 16; i++) { if (!(channel_name = g_strdup_printf("D%d", i))) return NULL; - ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name); + ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name); g_free(channel_name); if (!ch) return NULL; diff --git a/hardware/saleae-logic16/api.c b/hardware/saleae-logic16/api.c index 438d91a4..3759b825 100644 --- a/hardware/saleae-logic16/api.c +++ b/hardware/saleae-logic16/api.c @@ -195,7 +195,7 @@ static GSList *scan(GSList *options) sdi->driver = di; for (j = 0; channel_names[j]; j++) { - if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(j, SR_PROBE_LOGIC, TRUE, channel_names[j]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/serial-dmm/api.c b/hardware/serial-dmm/api.c index 09e0ffbc..f69fe4be 100644 --- a/hardware/serial-dmm/api.c +++ b/hardware/serial-dmm/api.c @@ -405,7 +405,7 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) sdi->priv = devc; sdi->driver = dmms[dmm].di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); drvc->instances = g_slist_append(drvc->instances, sdi); diff --git a/hardware/sysclk-lwla/api.c b/hardware/sysclk-lwla/api.c index 3cff652a..ac1932a4 100644 --- a/hardware/sysclk-lwla/api.c +++ b/hardware/sysclk-lwla/api.c @@ -85,7 +85,7 @@ static GSList *gen_channel_list(int num_channels) /* The LWLA series simply number channels from CH1 to CHxx. */ g_snprintf(name, sizeof(name), "CH%d", i); - ch = sr_probe_new(i - 1, SR_PROBE_LOGIC, TRUE, name); + ch = sr_channel_new(i - 1, SR_PROBE_LOGIC, TRUE, name); list = g_slist_prepend(list, ch); } diff --git a/hardware/teleinfo/api.c b/hardware/teleinfo/api.c index 9ba99129..a81af6e9 100644 --- a/hardware/teleinfo/api.c +++ b/hardware/teleinfo/api.c @@ -107,54 +107,54 @@ static GSList *scan(GSList *options) sdi->priv = devc; sdi->driver = di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); if (devc->optarif == OPTARIF_BASE) { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "BASE"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "BASE"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } else if (devc->optarif == OPTARIF_HC) { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HP"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HP"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HC"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HC"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } else if (devc->optarif == OPTARIF_EJP) { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HN"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HN"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPM"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPM"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } else if (devc->optarif == OPTARIF_BBR) { - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJB"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJB"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJW"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJW"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HPJR"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HPJR"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJB"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJB"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJW"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJW"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "HCJR"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "HCJR"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); } - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "IINST"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "IINST"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "PAPP"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "PAPP"))) goto scan_cleanup; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/tondaj-sl-814/api.c b/hardware/tondaj-sl-814/api.c index abe88ba4..d2f6cceb 100644 --- a/hardware/tondaj-sl-814/api.c +++ b/hardware/tondaj-sl-814/api.c @@ -106,7 +106,7 @@ static GSList *scan(GSList *options) sdi->priv = devc; sdi->driver = di; - ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"); + ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"); if (!ch) { sr_err("Failed to create channel."); return NULL; diff --git a/hardware/uni-t-dmm/api.c b/hardware/uni-t-dmm/api.c index be6c5e2a..7aed4e13 100644 --- a/hardware/uni-t-dmm/api.c +++ b/hardware/uni-t-dmm/api.c @@ -221,7 +221,7 @@ static GSList *scan(GSList *options, int dmm) } sdi->priv = devc; sdi->driver = udmms[dmm].di; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/hardware/uni-t-ut32x/api.c b/hardware/uni-t-ut32x/api.c index 352853d8..cc09a4bc 100644 --- a/hardware/uni-t-ut32x/api.c +++ b/hardware/uni-t-ut32x/api.c @@ -86,7 +86,7 @@ static GSList *scan(GSList *options) sdi->inst_type = SR_INST_USB; sdi->conn = l->data; for (i = 0; i < 3; i++) { - if (!(ch = sr_probe_new(i, SR_PROBE_ANALOG, TRUE, + if (!(ch = sr_channel_new(i, SR_PROBE_ANALOG, TRUE, channels[i]))) { sr_dbg("Channel malloc failed."); return NULL; diff --git a/hardware/victor-dmm/api.c b/hardware/victor-dmm/api.c index 6da326f6..55c074d9 100644 --- a/hardware/victor-dmm/api.c +++ b/hardware/victor-dmm/api.c @@ -88,7 +88,7 @@ static GSList *scan(GSList *options) return NULL; sdi->priv = devc; - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, "P1"))) return NULL; sdi->channels = g_slist_append(NULL, ch); diff --git a/hardware/zeroplus-logic-cube/api.c b/hardware/zeroplus-logic-cube/api.c index 69e14411..4bc25a97 100644 --- a/hardware/zeroplus-logic-cube/api.c +++ b/hardware/zeroplus-logic-cube/api.c @@ -316,7 +316,7 @@ static GSList *scan(GSList *options) /* Fill in channellist according to this device's profile. */ for (j = 0; j < devc->num_channels; j++) { - if (!(ch = sr_probe_new(j, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(j, SR_PROBE_LOGIC, TRUE, channel_names[j]))) return NULL; sdi->channels = g_slist_append(sdi->channels, ch); diff --git a/input/binary.c b/input/binary.c index 3f3f288a..50d1f958 100644 --- a/input/binary.c +++ b/input/binary.c @@ -83,7 +83,7 @@ static int init(struct sr_input *in, const char *filename) for (i = 0; i < num_channels; i++) { snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i); /* TODO: Check return value. */ - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name))) return SR_ERR; in->sdi->channels = g_slist_append(in->sdi->channels, ch); } diff --git a/input/chronovu_la8.c b/input/chronovu_la8.c index 43004401..d340ece8 100644 --- a/input/chronovu_la8.c +++ b/input/chronovu_la8.c @@ -122,7 +122,7 @@ static int init(struct sr_input *in, const char *filename) for (i = 0; i < num_channels; i++) { snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i); /* TODO: Check return value. */ - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name))) return SR_ERR; in->sdi->channels = g_slist_append(in->sdi->channels, ch); } diff --git a/input/csv.c b/input/csv.c index a7eee4b2..2af4eeb1 100644 --- a/input/csv.c +++ b/input/csv.c @@ -682,7 +682,7 @@ static int init(struct sr_input *in, const char *filename) else snprintf(channel_name, sizeof(channel_name), "%zu", i); - ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, channel_name); + ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, channel_name); if (!ch) { sr_err("Channel creation failed."); diff --git a/input/vcd.c b/input/vcd.c index 88bc2ff6..2b68fc50 100644 --- a/input/vcd.c +++ b/input/vcd.c @@ -344,7 +344,7 @@ static int init(struct sr_input *in, const char *filename) for (i = 0; i < num_channels; i++) { snprintf(name, SR_MAX_PROBENAME_LEN, "%d", i); - if (!(ch = sr_probe_new(i, SR_PROBE_LOGIC, TRUE, name))) { + if (!(ch = sr_channel_new(i, SR_PROBE_LOGIC, TRUE, name))) { release_context(ctx); return SR_ERR; } diff --git a/input/wav.c b/input/wav.c index 4987fc4a..7f5f97bf 100644 --- a/input/wav.c +++ b/input/wav.c @@ -114,7 +114,7 @@ static int init(struct sr_input *in, const char *filename) for (i = 0; i < ctx->num_channels; i++) { snprintf(channelname, 8, "CH%d", i + 1); - if (!(ch = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, channelname))) + if (!(ch = sr_channel_new(0, SR_PROBE_ANALOG, TRUE, channelname))) return SR_ERR; in->sdi->channels = g_slist_append(in->sdi->channels, ch); } diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 687e0327..123a23f7 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -232,7 +232,7 @@ enum { SR_PROBE_SET_TRIGGER = 1 << 1, }; -SR_PRIV struct sr_channel *sr_probe_new(int index, int type, +SR_PRIV struct sr_channel *sr_channel_new(int index, int type, gboolean enabled, const char *name); /* Generic device instances */ diff --git a/session_file.c b/session_file.c index da11321c..8413d509 100644 --- a/session_file.c +++ b/session_file.c @@ -186,7 +186,7 @@ SR_API int sr_session_load(const char *filename) g_variant_new_uint64(total_channels), sdi, NULL); for (p = 0; p < total_channels; p++) { snprintf(channelname, SR_MAX_PROBENAME_LEN, "%" PRIu64, p); - if (!(ch = sr_probe_new(p, SR_PROBE_LOGIC, TRUE, + if (!(ch = sr_channel_new(p, SR_PROBE_LOGIC, TRUE, channelname))) return SR_ERR; sdi->channels = g_slist_append(sdi->channels, ch);