]> sigrok.org Git - libsigrok.git/blobdiff - hardware/demo/demo.c
sr: Fix/document probe names.
[libsigrok.git] / hardware / demo / demo.c
index 2ba59cc81b271efabca07a4f20386820a5754c55..8a84e8ce65a3d6b7d4f407da0107703f510eb6e2 100644 (file)
@@ -102,6 +102,7 @@ static const char *pattern_strings[] = {
        NULL,
 };
 
+/* We name the probes 0-7 on our demo driver. */
 static const char *probe_names[NUM_PROBES + 1] = {
        "0",
        "1",
@@ -125,6 +126,9 @@ static uint8_t pattern_sigrok[] = {
        0xbe, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 };
 
+/* Private, per-device-instance driver context. */
+/* TODO: struct context as with the other drivers. */
+
 /* List of struct sr_dev_inst, maintained by dev_open()/dev_close(). */
 static GSList *dev_insts = NULL;
 static uint64_t cur_samplerate = SR_KHZ(200);
@@ -134,7 +138,7 @@ static int default_pattern = PATTERN_SIGROK;
 static GThread *my_thread;
 static int thread_running;
 
-static int hw_acquisition_stop(int dev_index, gpointer session_data);
+static int hw_dev_acquisition_stop(int dev_index, gpointer session_data);
 
 static int hw_init(const char *devinfo)
 {
@@ -227,7 +231,7 @@ static int *hw_hwcap_get_all(void)
        return hwcaps;
 }
 
-static int hw_config_set(int dev_index, int hwcap, void *value)
+static int hw_dev_config_set(int dev_index, int hwcap, void *value)
 {
        int ret;
        char *stropt;
@@ -405,7 +409,7 @@ static int receive_data(int fd, int revents, void *session_data)
        return TRUE;
 }
 
-static int hw_acquisition_start(int dev_index, gpointer session_data)
+static int hw_dev_acquisition_start(int dev_index, gpointer session_data)
 {
        struct sr_datafeed_packet *packet;
        struct sr_datafeed_header *header;
@@ -477,7 +481,7 @@ static int hw_acquisition_start(int dev_index, gpointer session_data)
        return SR_OK;
 }
 
-static int hw_acquisition_stop(int dev_index, gpointer session_data)
+static int hw_dev_acquisition_stop(int dev_index, gpointer session_data)
 {
        /* Avoid compiler warnings. */
        (void)dev_index;
@@ -500,7 +504,7 @@ SR_PRIV struct sr_dev_plugin demo_plugin_info = {
        .dev_info_get = hw_dev_info_get,
        .dev_status_get = hw_dev_status_get,
        .hwcap_get_all = hw_hwcap_get_all,
-       .config_set = hw_config_set,
-       .acquisition_start = hw_acquisition_start,
-       .acquisition_stop = hw_acquisition_stop,
+       .dev_config_set = hw_dev_config_set,
+       .dev_acquisition_start = hw_dev_acquisition_start,
+       .dev_acquisition_stop = hw_dev_acquisition_stop,
 };