#include <sigrok.h>
#include "config.h"
-source_callback_add source_cb_add = NULL;
-source_callback_remove source_cb_remove = NULL;
-
/* The list of loaded plugins lives here. */
GSList *plugins;
struct hwcap_option hwcap_options[] = {
{HWCAP_SAMPLERATE, T_UINT64, "Sample rate", "samplerate"},
{HWCAP_CAPTURE_RATIO, T_UINT64, "Pre-trigger capture ratio", "captureratio"},
+ {HWCAP_PATTERN_MODE, T_CHAR, "Pattern generator mode", "patternmode"},
{0, 0, NULL, NULL},
};
#ifdef HAVE_LA_LINK_MSO19
extern struct device_plugin link_mso19_plugin_info;
#endif
+#ifdef HAVE_LA_ALSA
+extern struct device_plugin alsa_plugin_info;
+#endif
/* TODO: No linked list needed, this can be a simple array. */
#ifdef HAVE_LA_LINK_MSO19
plugins = g_slist_append(plugins, (gpointer *)&link_mso19_plugin_info);
#endif
+#ifdef HAVE_LA_ALSA
+ plugins = g_slist_append(plugins, (gpointer *)&alsa_plugin_info);
+#endif
- return SIGROK_OK;
+
+ return SR_OK;
}
GSList *list_hwplugins(void)
sdi->index = index;
sdi->status = status;
sdi->instance_type = -1;
- sdi->vendor = strdup(vendor);
- sdi->model = strdup(model);
- sdi->version = strdup(version);
+ sdi->vendor = vendor ? strdup(vendor) : strdup("(unknown)");
+ sdi->model = model ? strdup(model) : NULL;
+ sdi->version = version ? strdup(version) : NULL;
sdi->priv = NULL;
sdi->usb = NULL;
return NULL;
}
+/* unnecessary level of indirection follows. */
+
void source_remove(int fd)
{
- if (source_cb_remove)
- source_cb_remove(fd);
+
+ session_source_remove(fd);
+
}
void source_add(int fd, int events, int timeout, receive_data_callback rcv_cb,
void *user_data)
{
- if (source_cb_add)
- source_cb_add(fd, events, timeout, rcv_cb, user_data);
+
+ session_source_add(fd, events, timeout, rcv_cb, user_data);
+
}