Rename sr_probe_new() to sr_channel_new().
This fixes parts of bug #259.
This commit is contained in:
parent
ba7dd8bbb8
commit
56d0d24535
2
device.c
2
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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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.");
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue