]> sigrok.org Git - libsigrok.git/blobdiff - hardware/link-mso19/api.c
Add struct sr_session parameter to all session source backends.
[libsigrok.git] / hardware / link-mso19 / api.c
index 9e0273aec6b0e80b4aa17c3fa8156016137f93f6..13c2972001a506627ea325f1c35467606d751a14 100644 (file)
@@ -25,6 +25,7 @@ static const int32_t hwcaps[] = {
        SR_CONF_OSCILLOSCOPE,
        SR_CONF_LOGIC_ANALYZER,
        SR_CONF_SAMPLERATE,
+       SR_CONF_TRIGGER_TYPE,
        SR_CONF_TRIGGER_SLOPE,
        SR_CONF_HORIZ_TRIGGERPOS,
 //      SR_CONF_CAPTURE_RATIO,
@@ -37,7 +38,7 @@ static const int32_t hwcaps[] = {
  *
  * See also: http://www.linkinstruments.com/images/mso19_1113.gif
  */
-SR_PRIV const char *mso19_channel_names[NUM_PROBES + 1] = {
+SR_PRIV const char *mso19_channel_names[NUM_CHANNELS + 1] = {
        /* Note: DSO needs to be first. */
        "DSO", "0", "1", "2", "3", "4", "5", "6", "7", NULL,
 };
@@ -101,7 +102,7 @@ static GSList *scan(GSList *options)
        GSList *l;
        struct sr_config *src;
        struct udev *udev;
-       int ptype;
+       int chtype;
 
        for (l = options; l; l = l->next) {
                src = l->data;
@@ -216,10 +217,10 @@ static GSList *scan(GSList *options)
                sdi->driver = di;
                sdi->priv = devc;
 
-               for (i = 0; i < NUM_PROBES; i++) {
+               for (i = 0; i < NUM_CHANNELS; i++) {
                        struct sr_channel *ch;
-                       ptype = (i == 0) ? SR_PROBE_ANALOG : SR_PROBE_LOGIC;
-                       if (!(ch = sr_channel_new(i, ptype, TRUE,
+                       chtype = (i == 0) ? SR_CHANNEL_ANALOG : SR_CHANNEL_LOGIC;
+                       if (!(ch = sr_channel_new(i, chtype, TRUE,
                                                   mso19_channel_names[i])))
                                return 0;
                        sdi->channels = g_slist_append(sdi->channels, ch);
@@ -460,7 +461,8 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi, void *cb_data)
        /* Our first channel is analog, the other 8 are of type 'logic'. */
        /* TODO. */
 
-       serial_source_add(devc->serial, G_IO_IN, -1, mso_receive_data, cb_data);
+       serial_source_add(sdi->session, devc->serial, G_IO_IN, -1,
+                       mso_receive_data, cb_data);
 
        return SR_OK;
 }