X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fdemo%2Fdemo.c;h=6605d1e6c321f6fe5be8998d65a4799a5594cce3;hb=357285a944b514bb4498f16b6318829516e33e1a;hp=1492dadf3ad205032889bebd521505077791e040;hpb=cb93f8a927e6fb2cb1d89176766c5c9c398db5c3;p=libsigrok.git diff --git a/hardware/demo/demo.c b/hardware/demo/demo.c index 1492dadf..6605d1e6 100644 --- a/hardware/demo/demo.c +++ b/hardware/demo/demo.c @@ -22,14 +22,14 @@ #include #include #include -#include -#include #ifdef _WIN32 #include #include #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;