]> sigrok.org Git - libsigrok.git/blobdiff - session.c
log messages: Use device name, not vendor name.
[libsigrok.git] / session.c
index 2976ce75b10636be1ead596408ebb9d1e67bd046..b80ab7d59f489ff4bcd3e87918a2e3454b2ee806 100644 (file)
--- a/session.c
+++ b/session.c
@@ -24,6 +24,7 @@
 #include <string.h>
 #include <glib.h>
 #include <sigrok.h>
+#include <sigrok-internal.h>
 
 /* demo.c */
 extern GIOChannel channels[2];
@@ -32,7 +33,7 @@ struct source {
        int fd;
        int events;
        int timeout;
-       receive_data_callback cb;
+       sr_receive_data_callback cb;
        void *user_data;
 };
 
@@ -70,8 +71,8 @@ int sr_session_device_add(struct sr_device *device)
 {
        int ret;
 
-       if (device->plugin && device->plugin->open) {
-               ret = device->plugin->open(device->plugin_index);
+       if (device->plugin && device->plugin->opendev) {
+               ret = device->plugin->opendev(device->plugin_index);
                if (ret != SR_OK)
                        return ret;
        }
@@ -81,6 +82,7 @@ int sr_session_device_add(struct sr_device *device)
        return SR_OK;
 }
 
+#if 0
 void sr_session_pa_clear(void)
 {
        /*
@@ -91,10 +93,11 @@ void sr_session_pa_clear(void)
        session->analyzers = NULL;
 }
 
-void sr_session_pa_add(struct analyzer *an)
+void sr_session_pa_add(struct sr_analyzer *an)
 {
        session->analyzers = g_slist_append(session->analyzers, an);
 }
+#endif
 
 void sr_session_datafeed_callback_clear(void)
 {
@@ -156,7 +159,7 @@ int sr_session_start(void)
        GSList *l;
        int ret;
 
-       g_message("session: starting");
+       sr_info("session: starting");
        for (l = session->devices; l; l = l->next) {
                device = l->data;
                if ((ret = device->plugin->start_acquisition(
@@ -170,7 +173,7 @@ int sr_session_start(void)
 void sr_session_run(void)
 {
 
-       g_message("session: running");
+       sr_info("session: running");
        session->running = TRUE;
 
        /* do we have real sources? */
@@ -187,7 +190,7 @@ void sr_session_run(void)
 void sr_session_halt(void)
 {
 
-       g_message("session: halting");
+       sr_info("session: halting");
        session->running = FALSE;
 
 }
@@ -197,7 +200,7 @@ void sr_session_stop(void)
        struct sr_device *device;
        GSList *l;
 
-       g_message("session: stopping");
+       sr_info("session: stopping");
        session->running = FALSE;
        for (l = session->devices; l; l = l->next) {
                device = l->data;
@@ -223,7 +226,7 @@ void sr_session_bus(struct sr_device *device, struct sr_datafeed_packet *packet)
 }
 
 void sr_session_source_add(int fd, int events, int timeout,
-               receive_data_callback callback, void *user_data)
+               sr_receive_data_callback callback, void *user_data)
 {
        struct source *new_sources, *s;