static int hw_dev_acquisition_stop(int dev_index, void *cb_data);
-static int hw_init(const char *devinfo)
+static int hw_init(void)
{
- struct sr_dev_inst *sdi;
- /* Avoid compiler warnings. */
- (void)devinfo;
+ /* Nothing to do. */
+
+ return SR_OK;
+}
+
+static int hw_scan(void)
+{
+ struct sr_dev_inst *sdi;
sdi = sr_dev_inst_new(0, SR_ST_ACTIVE, DEMONAME, NULL, NULL);
if (!sdi) {
ctx->channels[0] = g_io_channel_unix_new(ctx->pipe_fds[0]);
ctx->channels[1] = g_io_channel_unix_new(ctx->pipe_fds[1]);
+ g_io_channel_set_flags(ctx->channels[0], G_IO_FLAG_NONBLOCK, NULL);
+
/* Set channel encoding to binary (default is UTF-8). */
g_io_channel_set_encoding(ctx->channels[0], NULL, NULL);
g_io_channel_set_encoding(ctx->channels[1], NULL, NULL);
.api_version = 1,
.init = hw_init,
.cleanup = hw_cleanup,
+ .scan = hw_scan,
.dev_open = hw_dev_open,
.dev_close = hw_dev_close,
.dev_info_get = hw_dev_info_get,