SR_CONF_CONTINUOUS,
};
-static int dev_clear(void)
-{
- return std_dev_clear(di, NULL);
-}
-
static int init(struct sr_context *sr_ctx)
{
return std_init(sr_ctx, di, LOG_PREFIX);
/* Can get called on an unused driver, doesn't matter. */
return SR_OK;
- ret = dev_clear();
+
+ ret = std_dev_clear(di, NULL);
g_free(drvc);
di->priv = NULL;
return ret;
}
-static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_get(int id, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *channel_group)
{
struct sr_usb_dev_inst *usb;
char str[128];
+ (void)channel_group;
+
switch (id) {
case SR_CONF_CONN:
if (!sdi || !sdi->conn)
return SR_OK;
}
-static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi)
+static int config_set(int id, GVariant *data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *channel_group)
{
struct dev_context *devc;
gint64 now;
int ret;
+ (void)channel_group;
+
if (sdi->status != SR_ST_ACTIVE)
return SR_ERR_DEV_CLOSED;
return ret;
}
-static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi)
+static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
+ const struct sr_channel_group *channel_group)
{
-
(void)sdi;
+ (void)channel_group;
switch (key) {
case SR_CONF_SCAN_OPTIONS:
struct sr_dev_inst *sdi;
struct timeval tv;
gint64 now;
- int i;
(void)fd;
(void)revents;
}
if (sdi->status == SR_ST_STOPPING) {
- for (i = 0; devc->usbfd[i] != -1; i++)
- sr_source_remove(devc->usbfd[i]);
+ usb_source_remove(drvc->sr_ctx);
dev_close(sdi);
{
struct dev_context *devc;
struct drv_context *drvc = di->priv;
- const struct libusb_pollfd **pfd;
struct sr_usb_dev_inst *usb;
struct libusb_transfer *transfer;
- int ret, i;
+ int ret;
unsigned char *buf;
if (sdi->status != SR_ST_ACTIVE)
/* Send header packet to the session bus. */
std_session_send_df_header(cb_data, LOG_PREFIX);
- pfd = libusb_get_pollfds(drvc->sr_ctx->libusb_ctx);
- for (i = 0; pfd[i]; i++) {
- /* Handle USB events every 100ms, for decent latency. */
- sr_source_add(pfd[i]->fd, pfd[i]->events, 100,
- handle_events, (void *)sdi);
- /* We'll need to remove this fd later. */
- devc->usbfd[i] = pfd[i]->fd;
- }
- devc->usbfd[i] = -1;
+ usb_source_add(drvc->sr_ctx, 100, handle_events, (void *)sdi);
buf = g_try_malloc(DMM_DATA_SIZE);
transfer = libusb_alloc_transfer(0);
.cleanup = cleanup,
.scan = scan,
.dev_list = dev_list,
- .dev_clear = dev_clear,
+ .dev_clear = NULL,
.config_get = config_get,
.config_set = config_set,
.config_list = config_list,