Rename a few more API calls with 'probe' in their name.

This fixes parts of bug #259.
This commit is contained in:
Uwe Hermann 2014-03-24 16:05:42 +01:00
parent 3f239f0803
commit f3ca73edd2
7 changed files with 17 additions and 17 deletions

View File

@ -83,7 +83,7 @@ SR_PRIV struct sr_channel *sr_channel_new(int index, int type,
* *
* @since 0.2.0 * @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) int channelnum, const char *name)
{ {
GSList *l; GSList *l;
@ -122,7 +122,7 @@ SR_API int sr_dev_probe_name_set(const struct sr_dev_inst *sdi,
* *
* @since 0.2.0 * @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) gboolean state)
{ {
GSList *l; GSList *l;
@ -141,8 +141,8 @@ SR_API int sr_dev_probe_enable(const struct sr_dev_inst *sdi, int channelnum,
ch->enabled = state; ch->enabled = state;
ret = SR_OK; ret = SR_OK;
if (!state != !was_enabled && sdi->driver if (!state != !was_enabled && sdi->driver
&& sdi->driver->config_probe_set) { && sdi->driver->config_channel_set) {
ret = sdi->driver->config_probe_set( ret = sdi->driver->config_channel_set(
sdi, ch, SR_CHANNEL_SET_ENABLED); sdi, ch, SR_CHANNEL_SET_ENABLED);
/* Roll back change if it wasn't applicable. */ /* Roll back change if it wasn't applicable. */
if (ret == SR_ERR_ARG) 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. */ /* Set new trigger if it has changed. */
ch->trigger = g_strdup(trigger); ch->trigger = g_strdup(trigger);
if (sdi->driver && sdi->driver->config_probe_set) { if (sdi->driver && sdi->driver->config_channel_set) {
ret = sdi->driver->config_probe_set( ret = sdi->driver->config_channel_set(
sdi, ch, SR_CHANNEL_SET_TRIGGER); sdi, ch, SR_CHANNEL_SET_TRIGGER);
/* Roll back change if it wasn't applicable. */ /* Roll back change if it wasn't applicable. */
if (ret == SR_ERR_ARG) { if (ret == SR_ERR_ARG) {

View File

@ -91,7 +91,7 @@
* *
* @since 0.2.0 * @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, const GArray *probe_array, const uint8_t *data_in,
uint64_t length_in, uint8_t **data_out, uint64_t length_in, uint8_t **data_out,
uint64_t *length_out) uint64_t *length_out)

View File

@ -401,7 +401,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
return SR_OK; 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) struct sr_channel *ch, unsigned int changes)
{ {
uint64_t channel_bit; uint64_t channel_bit;
@ -601,7 +601,7 @@ SR_PRIV struct sr_dev_driver sysclk_lwla_driver_info = {
.dev_clear = dev_clear, .dev_clear = dev_clear,
.config_get = config_get, .config_get = config_get,
.config_set = config_set, .config_set = config_set,
.config_probe_set = config_probe_set, .config_channel_set = config_channel_set,
.config_commit = config_commit, .config_commit = config_commit,
.config_list = config_list, .config_list = config_list,
.dev_open = dev_open, .dev_open = dev_open,

View File

@ -224,7 +224,7 @@ SR_PRIV int sr_err(const char *format, ...);
/*--- device.c --------------------------------------------------------------*/ /*--- 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 { enum {
/** The enabled state of the probe has been changed. */ /** The enabled state of the probe has been changed. */
SR_CHANNEL_SET_ENABLED = 1 << 0, SR_CHANNEL_SET_ENABLED = 1 << 0,

View File

@ -993,8 +993,8 @@ struct sr_dev_driver {
const struct sr_dev_inst *sdi, const struct sr_dev_inst *sdi,
const struct sr_channel_group *cg); const struct sr_channel_group *cg);
/** Probe status change. /** Probe status change.
* @see sr_dev_probe_enable(), sr_dev_trigger_set(). */ * @see sr_dev_channel_enable(), sr_dev_trigger_set(). */
int (*config_probe_set) (const struct sr_dev_inst *sdi, int (*config_channel_set) (const struct sr_dev_inst *sdi,
struct sr_channel *ch, unsigned int changes); struct sr_channel *ch, unsigned int changes);
/** Apply configuration settings to the device hardware. /** Apply configuration settings to the device hardware.
* @see sr_config_commit().*/ * @see sr_config_commit().*/

View File

@ -45,9 +45,9 @@ SR_API char *sr_log_logdomain_get(void);
/*--- device.c --------------------------------------------------------------*/ /*--- 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); 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); gboolean state);
SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum, SR_API int sr_dev_trigger_set(const struct sr_dev_inst *sdi, int probenum,
const char *trigger); const char *trigger);
@ -59,7 +59,7 @@ SR_API int sr_dev_close(struct sr_dev_inst *sdi);
/*--- filter.c --------------------------------------------------------------*/ /*--- 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, const GArray *probe_array, const uint8_t *data_in,
uint64_t length_in, uint8_t **data_out, uint64_t length_in, uint8_t **data_out,
uint64_t *length_out); uint64_t *length_out);

View File

@ -197,7 +197,7 @@ SR_API int sr_session_load(const char *filename)
enabled_channels++; enabled_channels++;
tmp_u64 = strtoul(keys[j]+5, NULL, 10); tmp_u64 = strtoul(keys[j]+5, NULL, 10);
/* sr_session_save() */ /* 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)) { } else if (!strncmp(keys[j], "trigger", 7)) {
channelnum = strtoul(keys[j]+7, NULL, 10); channelnum = strtoul(keys[j]+7, NULL, 10);
sr_dev_trigger_set(sdi, channelnum, val); 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. */ /* Disable channels not specifically listed. */
if (total_channels) if (total_channels)
for (p = enabled_channels; p < total_channels; p++) for (p = enabled_channels; p < total_channels; p++)
sr_dev_probe_enable(sdi, p, FALSE); sr_dev_channel_enable(sdi, p, FALSE);
} }
devcnt++; devcnt++;
} }