struct sr_dev *parse_devstring(const char *devstring)
{
struct sr_dev *dev, *d;
- struct sr_dev_plugin **plugins;
+ struct sr_dev_driver **drivers;
GSList *devs, *l;
int i, num_devs, dev_num, dev_cnt;
char *tmp;
dev = NULL;
dev_num = strtol(devstring, &tmp, 10);
if (tmp != devstring) {
- /* argument is numeric, meaning a device ID. Make all driver
- * plugins scan for devices.
+ /* argument is numeric, meaning a device ID. Make all drivers
+ * scan for devices.
*/
num_devs = num_real_devs();
if (dev_num < 0 || dev_num >= num_devs)
* no need to let them all scan
*/
dev = NULL;
- plugins = sr_hw_list();
- for (i = 0; plugins[i]; i++) {
- if (strcmp(plugins[i]->name, devstring))
+ drivers = sr_hw_list();
+ for (i = 0; drivers[i]; i++) {
+ if (strcmp(drivers[i]->name, devstring))
continue;
- num_devs = sr_hw_init(plugins[i]);
+ num_devs = sr_hw_init(drivers[i]);
if (num_devs == 1) {
devs = sr_dev_list();
dev = devs->data;
static void show_version(void)
{
GSList *l;
- struct sr_dev_plugin **plugins;
+ struct sr_dev_driver **drivers;
struct sr_input_format **inputs;
struct sr_output_format **outputs;
struct srd_decoder *dec;
printf("sigrok-cli %s\n\n", VERSION);
printf("Supported hardware drivers:\n");
- plugins = sr_hw_list();
- for (i = 0; plugins[i]; i++) {
- printf(" %-20s %s\n", plugins[i]->name, plugins[i]->longname);
+ drivers = sr_hw_list();
+ for (i = 0; drivers[i]; i++) {
+ printf(" %-20s %s\n", drivers[i]->name, drivers[i]->longname);
}
printf("\n");
}
title = "Supported options:\n";
- hwcaps = dev->plugin->hwcap_get_all();
+ hwcaps = dev->driver->hwcap_get_all();
for (cap = 0; hwcaps[cap]; cap++) {
if (!(hwo = sr_hw_hwcap_get(hwcaps[cap])))
continue;
ret = sr_parse_sizestring(value, &tmp_u64);
if (ret != SR_OK)
break;
- ret = dev->plugin->dev_config_set(dev->plugin_index,
+ ret = dev->driver->dev_config_set(dev->driver_index,
sr_hwcap_options[i].hwcap, &tmp_u64);
break;
case SR_T_CHAR:
- ret = dev->plugin->dev_config_set(dev->plugin_index,
+ ret = dev->driver->dev_config_set(dev->driver_index,
sr_hwcap_options[i].hwcap, value);
break;
case SR_T_BOOL:
tmp_bool = TRUE;
else
tmp_bool = sr_parse_boolstring(value);
- ret = dev->plugin->dev_config_set(dev->plugin_index,
+ ret = dev->driver->dev_config_set(dev->driver_index,
sr_hwcap_options[i].hwcap,
GINT_TO_POINTER(tmp_bool));
break;
return;
if (opt_continuous) {
- if (!sr_hw_has_hwcap(dev->plugin, SR_HWCAP_CONTINUOUS)) {
+ if (!sr_hw_has_hwcap(dev->driver, SR_HWCAP_CONTINUOUS)) {
printf("This device does not support continuous sampling.");
sr_session_destroy();
return;
return;
}
- if (sr_hw_has_hwcap(dev->plugin, SR_HWCAP_LIMIT_MSEC)) {
- if (dev->plugin->dev_config_set(dev->plugin_index,
+ if (sr_hw_has_hwcap(dev->driver, SR_HWCAP_LIMIT_MSEC)) {
+ if (dev->driver->dev_config_set(dev->driver_index,
SR_HWCAP_LIMIT_MSEC, &time_msec) != SR_OK) {
printf("Failed to configure time limit.\n");
sr_session_destroy();
return;
}
- if (dev->plugin->dev_config_set(dev->plugin_index,
+ if (dev->driver->dev_config_set(dev->driver_index,
SR_HWCAP_LIMIT_SAMPLES, &limit_samples) != SR_OK) {
printf("Failed to configure time-based sample limit.\n");
sr_session_destroy();
if (opt_samples) {
if ((sr_parse_sizestring(opt_samples, &limit_samples) != SR_OK)
- || (dev->plugin->dev_config_set(dev->plugin_index,
+ || (dev->driver->dev_config_set(dev->driver_index,
SR_HWCAP_LIMIT_SAMPLES, &limit_samples) != SR_OK)) {
printf("Failed to configure sample limit.\n");
sr_session_destroy();
}
}
- if (dev->plugin->dev_config_set(dev->plugin_index,
+ if (dev->driver->dev_config_set(dev->driver_index,
SR_HWCAP_PROBECONFIG, (char *)dev->probes) != SR_OK) {
printf("Failed to configure probes.\n");
sr_session_destroy();