]> sigrok.org Git - libsigrok.git/blobdiff - hardware/link-mso19/link-mso19.c
Move the probe naming to the creator of the device, and let each driver name its...
[libsigrok.git] / hardware / link-mso19 / link-mso19.c
index 63b910318615002dfc653225232898ce5e50e464..30bda395fc848a28b585aa9b376c608096b6952d 100644 (file)
 #include <inttypes.h>
 #include <glib.h>
 #include <libudev.h>
-#include <sigrok.h>
 #include <arpa/inet.h>
-#include <sigrok-internal.h>
+#include "sigrok.h"
+#include "sigrok-internal.h"
 #include "config.h"
 #include "link-mso19.h"
 
 #define USB_VENDOR "3195"
 #define USB_PRODUCT "f190"
 
+#define NUM_PROBES 8
+
 static int capabilities[] = {
        SR_HWCAP_LOGIC_ANALYZER,
 //     SR_HWCAP_OSCILLOSCOPE,
@@ -46,6 +48,18 @@ static int capabilities[] = {
        0,
 };
 
+static const char *probe_names[NUM_PROBES + 1] = {
+       "0",
+       "1",
+       "2",
+       "3",
+       "4",
+       "5",
+       "6",
+       "7",
+       NULL,
+};
+
 static uint64_t supported_samplerates[] = {
        SR_HZ(100),
        SR_HZ(200),
@@ -573,7 +587,10 @@ static void *hw_get_device_info(int device_index, int device_info_id)
                info = sdi;
                break;
        case SR_DI_NUM_PROBES: /* FIXME: How to report analog probe? */
-               info = GINT_TO_POINTER(8);
+               info = GINT_TO_POINTER(NUM_PROBES);
+               break;
+       case SR_DI_PROBE_NAMES: 
+               info = probe_names;
                break;
        case SR_DI_SAMPLERATES:
                info = &samplerates;