]> sigrok.org Git - libsigrok.git/blobdiff - hardware/demo/demo.c
link-mso19: Add debug messages.
[libsigrok.git] / hardware / demo / demo.c
index 1492dadf3ad205032889bebd521505077791e040..6605d1e6c321f6fe5be8998d65a4799a5594cce3 100644 (file)
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <sigrok.h>
-#include <sigrok-internal.h>
 #ifdef _WIN32
 #include <io.h>
 #include <fcntl.h>
 #define pipe(fds) _pipe(fds, 4096, _O_BINARY)
 #endif
 #include "config.h"
+#include "sigrok.h"
+#include "sigrok-internal.h"
 
 /* TODO: Number of probes should be configurable. */
 #define NUM_PROBES             8
@@ -102,6 +102,18 @@ static const char *pattern_strings[] = {
        NULL,
 };
 
+static const char *probe_names[NUM_PROBES + 1] = {
+       "0",
+       "1",
+       "2",
+       "3",
+       "4",
+       "5",
+       "6",
+       "7",
+       NULL,
+};
+
 static uint8_t pattern_sigrok[] = {
        0x4c, 0x92, 0x92, 0x92, 0x64, 0x00, 0x00, 0x00,
        0x82, 0xfe, 0xfe, 0x82, 0x00, 0x00, 0x00, 0x00,
@@ -185,6 +197,9 @@ static void *hw_get_device_info(int device_index, int device_info_id)
        case SR_DI_NUM_PROBES:
                info = GINT_TO_POINTER(NUM_PROBES);
                break;
+       case SR_DI_PROBE_NAMES:
+               info = probe_names;
+               break;
        case SR_DI_SAMPLERATES:
                info = &samplerates;
                break;