Rename a few more API calls with 'probe' in their name.
This fixes parts of bug #259.
This commit is contained in:
parent
3f239f0803
commit
f3ca73edd2
12
device.c
12
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) {
|
||||
|
|
2
filter.c
2
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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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().*/
|
||||
|
|
6
proto.h
6
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);
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue