static GSList *scan(struct sr_dev_driver *di, GSList *options)
{
- struct drv_context *drvc;
struct dev_context *devc;
struct sr_dev_inst *sdi;
struct sr_channel *ch;
struct sr_channel_group *cg, *acg;
struct sr_config *src;
struct analog_gen *ag;
- GSList *devices, *l;
+ GSList *l;
int num_logic_channels, num_analog_channels, pattern, i;
char channel_name[16];
- drvc = di->context;
-
num_logic_channels = DEFAULT_NUM_LOGIC_CHANNELS;
num_analog_channels = DEFAULT_NUM_ANALOG_CHANNELS;
for (l = options; l; l = l->next) {
}
}
- devices = NULL;
-
sdi = g_malloc0(sizeof(struct sr_dev_inst));
sdi->status = SR_ST_INACTIVE;
sdi->model = g_strdup("Demo device");
- sdi->driver = di;
devc = g_malloc0(sizeof(struct dev_context));
devc->cur_samplerate = SR_KHZ(200);
}
sdi->priv = devc;
- devices = g_slist_append(devices, sdi);
- drvc->instances = g_slist_append(drvc->instances, sdi);
- return devices;
+ return std_scan_complete(di, g_slist_append(NULL, sdi));
}
static int dev_open(struct sr_dev_inst *sdi)
sr_session_source_add(sdi->session, -1, 0, 100,
prepare_data, (struct sr_dev_inst *)sdi);
- std_session_send_df_header(sdi, LOG_PREFIX);
+ std_session_send_df_header(sdi);
/* We use this timestamp to decide how many more samples to send. */
devc->start_us = g_get_monotonic_time();
{
sr_dbg("Stopping acquisition.");
sr_session_source_remove(sdi->session, -1);
- std_session_send_df_end(sdi, LOG_PREFIX);
+ std_session_send_df_end(sdi);
return SR_OK;
}