+ devc = g_malloc0(sizeof(struct dev_context));
+
+ /* Default non-zero values (if any) */
+ devc->fd = -1;
+ devc->limit_samples = (uint64_t)10000000;
+ devc->tcp_buffer = 0;
+
+ if (!conn) {
+ devc->beaglelogic = &beaglelogic_native_ops;
+ sr_info("BeagleLogic device found at "BEAGLELOGIC_DEV_NODE);
+ } else {
+ devc->read_timeout = 1000 * 1000;
+ devc->beaglelogic = &beaglelogic_tcp_ops;
+ devc->address = g_strdup(params[1]);
+ devc->port = g_strdup(params[2]);
+ g_strfreev(params);
+
+ if (devc->beaglelogic->open(devc) != SR_OK)
+ goto err_free;
+ if (beaglelogic_tcp_detect(devc) != SR_OK)
+ goto err_free;
+ if (devc->beaglelogic->close(devc) != SR_OK)
+ goto err_free;
+ sr_info("BeagleLogic device found at %s : %s",
+ devc->address, devc->port);
+ }