void device_scan(void)
{
GSList *plugins, *l;
- struct device_plugin *plugin;
+ struct sr_device_plugin *plugin;
plugins = list_hwplugins();
}
-int device_plugin_init(struct device_plugin *plugin)
+int device_plugin_init(struct sr_device_plugin *plugin)
{
int num_devices, num_probes, i;
void device_close_all(void)
{
- struct device *device;
+ struct sr_device *device;
while (devices) {
device = devices->data;
return devices;
}
-struct device *device_new(struct device_plugin *plugin, int plugin_index,
- int num_probes)
+struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
+ int num_probes)
{
- struct device *device;
+ struct sr_device *device;
int i;
char probename[16];
- device = g_malloc0(sizeof(struct device));
+ device = g_malloc0(sizeof(struct sr_device));
device->plugin = plugin;
device->plugin_index = plugin_index;
devices = g_slist_append(devices, device);
return device;
}
-void device_clear(struct device *device)
+void device_clear(struct sr_device *device)
{
unsigned int pnum;
device_probe_clear(device, pnum);
}
-void device_destroy(struct device *device)
+void device_destroy(struct sr_device *device)
{
unsigned int pnum;
g_free(device);
}
-void device_probe_clear(struct device *device, int probenum)
+void device_probe_clear(struct sr_device *device, int probenum)
{
struct probe *p;
}
}
-void device_probe_add(struct device *device, char *name)
+void device_probe_add(struct sr_device *device, char *name)
{
struct probe *p;
device->probes = g_slist_append(device->probes, p);
}
-struct probe *probe_find(struct device *device, int probenum)
+struct probe *probe_find(struct sr_device *device, int probenum)
{
GSList *l;
struct probe *p, *found_probe;
return found_probe;
}
-void device_probe_name(struct device *device, int probenum, char *name)
+void device_probe_name(struct sr_device *device, int probenum, char *name)
{
struct probe *p;
p->name = g_strdup(name);
}
-void device_trigger_clear(struct device *device)
+void device_trigger_clear(struct sr_device *device)
{
struct probe *p;
unsigned int pnum;
}
}
-void device_trigger_set(struct device *device, int probenum, char *trigger)
+void device_trigger_set(struct sr_device *device, int probenum, char *trigger)
{
struct probe *p;
session_device_id = session_device_id;
}
-struct device_plugin alsa_plugin_info = {
+struct sr_device_plugin alsa_plugin_info = {
"alsa",
"ALSA driver",
1,
sigma->state.state = SIGMA_DOWNLOAD;
}
-struct device_plugin asix_sigma_plugin_info = {
+struct sr_device_plugin asix_sigma_plugin_info = {
"asix-sigma",
"ASIX SIGMA",
1,
{
}
-struct device_plugin skeleton_plugin_info = {
+struct sr_device_plugin skeleton_plugin_info = {
"skeleton",
"Skeleton driver",
1,
thread_running = 0;
}
-struct device_plugin demo_plugin_info = {
+struct sr_device_plugin demo_plugin_info = {
"demo",
"Demo driver and pattern generator",
1,
session_bus(session_device_id, &packet);
}
-struct device_plugin link_mso19_plugin_info = {
+struct sr_device_plugin link_mso19_plugin_info = {
.name = "link-mso19",
.longname = "Link Instruments MSO-19",
.api_version = 1,
session_bus(session_device_id, &packet);
}
-struct device_plugin ols_plugin_info = {
+struct sr_device_plugin ols_plugin_info = {
"ols",
"Openbench Logic Sniffer",
1,
/* TODO: Need to cancel and free any queued up transfers. */
}
-struct device_plugin saleae_logic_plugin_info = {
+struct sr_device_plugin saleae_logic_plugin_info = {
"saleae-logic",
"Saleae Logic",
1,
/* TODO: Need to cancel and free any queued up transfers. */
}
-struct device_plugin zeroplus_logic_cube_plugin_info = {
+struct sr_device_plugin zeroplus_logic_cube_plugin_info = {
"zeroplus-logic-cube",
"Zeroplus Logic Cube LAP-C series",
1,
};
#ifdef HAVE_LA_DEMO
-extern struct device_plugin demo_plugin_info;
+extern struct sr_device_plugin demo_plugin_info;
#endif
#ifdef HAVE_LA_SALEAE_LOGIC
-extern struct device_plugin saleae_logic_plugin_info;
+extern struct sr_device_plugin saleae_logic_plugin_info;
#endif
#ifdef HAVE_LA_OLS
-extern struct device_plugin ols_plugin_info;
+extern struct sr_device_plugin ols_plugin_info;
#endif
#ifdef HAVE_LA_ZEROPLUS_LOGIC_CUBE
-extern struct device_plugin zeroplus_logic_cube_plugin_info;
+extern struct sr_device_plugin zeroplus_logic_cube_plugin_info;
#endif
#ifdef HAVE_LA_ASIX_SIGMA
-extern struct device_plugin asix_sigma_plugin_info;
+extern struct sr_device_plugin asix_sigma_plugin_info;
#endif
#ifdef HAVE_LA_LINK_MSO19
-extern struct device_plugin link_mso19_plugin_info;
+extern struct sr_device_plugin link_mso19_plugin_info;
#endif
#ifdef HAVE_LA_ALSA
-extern struct device_plugin alsa_plugin_info;
+extern struct sr_device_plugin alsa_plugin_info;
#endif
session->devices = NULL;
}
-int session_device_add(struct device *device)
+int session_device_add(struct sr_device *device)
{
int ret;
int session_start(void)
{
- struct device *device;
+ struct sr_device *device;
GSList *l;
int ret;
void session_stop(void)
{
- struct device *device;
+ struct sr_device *device;
GSList *l;
g_message("stopping session");
}
-void session_bus(struct device *device, struct sr_datafeed_packet *packet)
+void session_bus(struct sr_device *device, struct sr_datafeed_packet *packet)
{
GSList *l;
datafeed_callback cb;
{
GSList *l, *p, *d;
FILE *meta;
- struct device *device;
+ struct sr_device *device;
struct probe *probe;
struct datastore *ds;
struct zip *zipfile;
/*--- device.c --------------------------------------------------------------*/
void device_scan(void);
-int device_plugin_init(struct device_plugin *plugin);
+int device_plugin_init(struct sr_device_plugin *plugin);
void device_close_all(void);
GSList *device_list(void);
-struct device *device_new(struct device_plugin *plugin, int plugin_index,
- int num_probes);
-void device_clear(struct device *device);
-void device_destroy(struct device *dev);
+struct sr_device *device_new(struct sr_device_plugin *plugin, int plugin_index,
+ int num_probes);
+void device_clear(struct sr_device *device);
+void device_destroy(struct sr_device *dev);
-void device_probe_clear(struct device *device, int probenum);
-void device_probe_add(struct device *device, char *name);
-struct probe *probe_find(struct device *device, int probenum);
-void device_probe_name(struct device *device, int probenum, char *name);
+void device_probe_clear(struct sr_device *device, int probenum);
+void device_probe_add(struct sr_device *device, char *name);
+struct probe *probe_find(struct sr_device *device, int probenum);
+void device_probe_name(struct sr_device *device, int probenum, char *name);
-void device_trigger_clear(struct device *device);
-void device_trigger_set(struct device *device, int probenum, char *trigger);
+void device_trigger_clear(struct sr_device *device);
+void device_trigger_set(struct sr_device *device, int probenum, char *trigger);
/*--- filter.c --------------------------------------------------------------*/
typedef void (*source_callback_remove) (int fd);
typedef void (*source_callback_add) (int fd, int events, int timeout,
receive_data_callback callback, void *user_data);
-typedef void (*datafeed_callback) (struct device *device,
+typedef void (*datafeed_callback) (struct sr_device *device,
struct sr_datafeed_packet *packet);
/* Session setup */
struct session *session_new(void);
void session_destroy(void);
void session_device_clear(void);
-int session_device_add(struct device *device);
+int session_device_add(struct sr_device *device);
/* Protocol analyzers setup */
void session_pa_clear(void);
void session_run(void);
void session_halt(void);
void session_stop(void);
-void session_bus(struct device *device, struct sr_datafeed_packet *packet);
+void session_bus(struct sr_device *device, struct sr_datafeed_packet *packet);
void make_metadata(char *filename);
int session_save(char *filename);
void session_source_add(int fd, int events, int timeout,
struct sr_input {
struct sr_input_format *format;
char *param;
- struct device *vdevice;
+ struct sr_device *vdevice;
};
struct sr_input_format {
struct sr_output {
struct sr_output_format *format;
- struct device *device;
+ struct sr_device *device;
char *param;
void *internal;
};
* to the device index within that plugin; it may be handling more than one
* device. All relevant plugin calls take a device_index parameter for this.
*/
-struct device {
+struct sr_device {
/* Which plugin handles this device */
- struct device_plugin *plugin;
+ struct sr_device_plugin *plugin;
/* A plugin may handle multiple devices of the same type */
int plugin_index;
/* List of struct probe* */
uint64_t *list;
};
-struct device_plugin {
+struct sr_device_plugin {
/* Plugin-specific */
char *name;
char *longname;
};
struct session {
- /* List of struct device* */
+ /* List of struct sr_device* */
GSList *devices;
/* List of struct analyzer* */
GSList *analyzers;