* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "sigrok-cli.h"
+#include <config.h>
#include <stdlib.h>
#include <glib.h>
+#include "sigrok-cli.h"
struct sr_context *sr_ctx = NULL;
#ifdef HAVE_SRD
int select_channels(struct sr_dev_inst *sdi)
{
struct sr_channel *ch;
+ gboolean enabled;
GSList *selected_channels, *l, *channels;
channels = sr_dev_inst_channels_get(sdi);
for (l = channels; l; l = l->next) {
ch = l->data;
- if (g_slist_find(selected_channels, ch))
- ch->enabled = TRUE;
- else
- ch->enabled = FALSE;
+ enabled = (g_slist_find(selected_channels, ch) != NULL);
+ if (sr_dev_channel_enable(ch, enabled) != SR_OK)
+ return SR_ERR;
}
g_slist_free(selected_channels);
}
{
struct sr_dev_inst *sdi;
struct sr_channel_group *cg;
- const struct sr_config_info *ci;
+ const struct sr_key_info *ci;
GSList *devices;
GVariant *gvar;
GHashTable *devargs;
}
cg = select_channel_group(sdi);
- if (!(ci = sr_config_info_name_get(opt_get)))
+ if (!(ci = sr_key_info_name_get(SR_KEY_CONFIG, opt_get)))
g_critical("Unknown option '%s'", opt_get);
if ((devargs = parse_generic_arg(opt_config, FALSE)))