From: Uwe Hermann Date: Mon, 24 Mar 2014 15:05:42 +0000 (+0100) Subject: Rename a few more API calls with 'probe' in their name. X-Git-Tag: libsigrok-0.3.0~105 X-Git-Url: http://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=f3ca73edd29a48f8cc19755df629ab2bc9478eea Rename a few more API calls with 'probe' in their name. This fixes parts of bug #259. --- diff --git a/device.c b/device.c index 4cdae580..d437b72d 100644 --- a/device.c +++ b/device.c @@ -83,7 +83,7 @@ SR_PRIV struct sr_channel *sr_channel_new(int index, int type, * * @since 0.2.0 */ -SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi, +SR_API int sr_dev_channel_name_set(const struct sr_dev_inst *sdi, int channelnum, const char *name) { GSList *l; @@ -122,7 +122,7 @@ SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi, * * @since 0.2.0 */ -SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int channelnum, +SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int channelnum, gboolean state) { GSList *l; @@ -141,8 +141,8 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int channelnum, ch->enabled = state; ret = SR_OK; if (!state != !was_enabled && sdi->driver - && sdi->driver->config_probe_set) { - ret = sdi->driver->config_probe_set( + && sdi->driver->config_channel_set) { + ret = sdi->driver->config_channel_set( sdi, ch, SR_CHANNEL_SET_ENABLED); /* Roll back change if it wasn't applicable. */ if (ret == SR_ERR_ARG) @@ -193,8 +193,8 @@ SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int channelnum, /* Set new trigger if it has changed. */ ch->trigger = g_strdup(trigger); - if (sdi->driver && sdi->driver->config_probe_set) { - ret = sdi->driver->config_probe_set( + if (sdi->driver && sdi->driver->config_channel_set) { + ret = sdi->driver->config_channel_set( sdi, ch, SR_CHANNEL_SET_TRIGGER); /* Roll back change if it wasn't applicable. */ if (ret == SR_ERR_ARG) { diff --git a/filter.c b/filter.c index eaf69e5c..46467543 100644 --- a/filter.c +++ b/filter.c @@ -91,7 +91,7 @@ * * @since 0.2.0 */ -SR_API int sr_filter_probes(unsigned int in_unitsize, unsigned int out_unitsize, +SR_API int sr_filter_channels(unsigned int in_unitsize, unsigned int out_unitsize, const GArray *probe_array, const uint8_t *data_in, uint64_t length_in, uint8_t **data_out, uint64_t *length_out) diff --git a/hardware/sysclk-lwla/api.c b/hardware/sysclk-lwla/api.c index de5929fe..12a1e086 100644 --- a/hardware/sysclk-lwla/api.c +++ b/hardware/sysclk-lwla/api.c @@ -401,7 +401,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi, return SR_OK; } -static int config_probe_set(const struct sr_dev_inst *sdi, +static int config_channel_set(const struct sr_dev_inst *sdi, struct sr_channel *ch, unsigned int changes) { uint64_t channel_bit; @@ -601,7 +601,7 @@ SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info = { .dev_clear = dev_clear, .config_get = config_get, .config_set = config_set, - .config_probe_set = config_probe_set, + .config_channel_set = config_channel_set, .config_commit = config_commit, .config_list = config_list, .dev_open = dev_open, diff --git a/libsigrok-internal.h b/libsigrok-internal.h index 4d508c5b..60c35b83 100644 --- a/libsigrok-internal.h +++ b/libsigrok-internal.h @@ -224,7 +224,7 @@ SR_PRIV int sr_err(const char *format, ...); /*--- device.c --------------------------------------------------------------*/ -/** Values for the changes argument of sr_dev_driver.config_probe_set. */ +/** Values for the changes argument of sr_dev_driver.config_channel_set. */ enum { /** The enabled state of the probe has been changed. */ SR_CHANNEL_SET_ENABLED = 1 << 0, diff --git a/libsigrok.h b/libsigrok.h index bd2202ed..8df2f396 100644 --- a/libsigrok.h +++ b/libsigrok.h @@ -993,8 +993,8 @@ struct sr_dev_driver { const struct sr_dev_inst *sdi, const struct sr_channel_group *cg); /** Probe status change. - * @see sr_dev_probe_enable(), sr_dev_trigger_set(). */ - int (*config_probe_set) (const struct sr_dev_inst *sdi, + * @see sr_dev_channel_enable(), sr_dev_trigger_set(). */ + int (*config_channel_set) (const struct sr_dev_inst *sdi, struct sr_channel *ch, unsigned int changes); /** Apply configuration settings to the device hardware. * @see sr_config_commit().*/ diff --git a/proto.h b/proto.h index 3d860e4b..2b5dd6ed 100644 --- a/proto.h +++ b/proto.h @@ -45,9 +45,9 @@ SR_API char *sr_log_logdomain_get(void); /*--- device.c --------------------------------------------------------------*/ -SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi, +SR_API int sr_dev_channel_name_set(const struct sr_dev_inst *sdi, int probenum, const char *name); -SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int probenum, +SR_API int sr_dev_channel_enable(const struct sr_dev_inst *sdi, int probenum, gboolean state); SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum, const char *trigger); @@ -59,7 +59,7 @@ SR_API int sr_dev_close(struct sr_dev_inst *sdi); /*--- filter.c --------------------------------------------------------------*/ -SR_API int sr_filter_probes(unsigned int in_unitsize, unsigned int out_unitsize, +SR_API int sr_filter_channels(unsigned int in_unitsize, unsigned int out_unitsize, const GArray *probe_array, const uint8_t *data_in, uint64_t length_in, uint8_t **data_out, uint64_t *length_out); diff --git a/session_file.c b/session_file.c index 8ff74cbd..3ace85b6 100644 --- a/session_file.c +++ b/session_file.c @@ -197,7 +197,7 @@ SR_API int sr_session_load(const char *filename) enabled_channels++; tmp_u64 = strtoul(keys[j]+5, NULL, 10); /* sr_session_save() */ - sr_dev_probe_name_set(sdi, tmp_u64 - 1, val); + sr_dev_channel_name_set(sdi, tmp_u64 - 1, val); } else if (!strncmp(keys[j], "trigger", 7)) { channelnum = strtoul(keys[j]+7, NULL, 10); sr_dev_trigger_set(sdi, channelnum, val); @@ -207,7 +207,7 @@ SR_API int sr_session_load(const char *filename) /* Disable channels not specifically listed. */ if (total_channels) for (p = enabled_channels; p < total_channels; p++) - sr_dev_probe_enable(sdi, p, FALSE); + sr_dev_channel_enable(sdi, p, FALSE); } devcnt++; }