]> sigrok.org Git - libsigrok.git/blobdiff - hardware/demo/demo.c
Mark some private stuff 'static'.
[libsigrok.git] / hardware / demo / demo.c
index 1eec6a2074b2abf956f13a0730ffd6e1882a7b62..734b01da6bb86b61667bc972d7e150a1366666b8 100644 (file)
@@ -41,6 +41,7 @@ enum {
        GENMODE_INC,
 };
 
+/* FIXME: Should not be global. */
 GIOChannel *channels[2];
 
 struct databag {
@@ -55,12 +56,20 @@ struct databag {
 
 static int capabilities[] = {
        SR_HWCAP_LOGIC_ANALYZER,
+       SR_HWCAP_SAMPLERATE,
        SR_HWCAP_PATTERN_MODE,
        SR_HWCAP_LIMIT_SAMPLES,
        SR_HWCAP_LIMIT_MSEC,
        SR_HWCAP_CONTINUOUS,
 };
 
+static struct sr_samplerates samplerates = {
+       1,
+       GHZ(1),
+       1,
+       NULL,
+};
+
 static const char *patternmodes[] = {
        "random",
        "incremental",
@@ -142,6 +151,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_SAMPLERATES:
+               info = &samplerates;
+               break;
        case SR_DI_CUR_SAMPLERATE:
                info = &cur_samplerate;
                break;