]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: Pass samplerate to decoder in metadata.
authorGareth McMullin <redacted>
Mon, 28 Nov 2011 08:52:35 +0000 (21:52 +1300)
committerGareth McMullin <redacted>
Mon, 28 Nov 2011 08:52:35 +0000 (21:52 +1300)
decode.c
sigrokdecode.h

index 50b87b4c269478d834770531f7092417ca2ae2a7..fed9fa790ef75edccade6dcc3f73c80a3e1831f2 100644 (file)
--- a/decode.c
+++ b/decode.c
@@ -365,15 +365,17 @@ int srd_instance_set_probe(struct srd_decoder_instance *di,
 }
 
 int srd_instance_start(struct srd_decoder_instance *di,
-                       const char *driver, int unitsize, uint64_t starttime)
+                       const char *driver, int unitsize, uint64_t starttime,
+                       uint64_t samplerate)
 {
        PyObject *py_res;
 
        if (!(py_res = PyObject_CallMethod(di->py_instance, "start",
-                                        "{s:s,s:i,s:d}", 
+                                        "{s:s,s:l,s:l,s:l}", 
                                         "driver", driver,
-                                        "unitsize", unitsize,
-                                        "starttime", starttime))) {
+                                        "unitsize", (long)unitsize,
+                                        "starttime", (long)starttime,
+                                        "samplerate", (long)samplerate))) {
                if (PyErr_Occurred())
                        PyErr_Print(); /* Returns void. */
 
index abc3baad8b8b3511dea8219341e91f3e63096a59..27f2734a02ed072f1a41934019e5fb9412899f58 100644 (file)
@@ -109,7 +109,8 @@ struct srd_decoder_instance *srd_instance_new(const char *id);
 int srd_instance_set_probe(struct srd_decoder_instance *di,
                                const char *probename, int num);
 int srd_instance_start(struct srd_decoder_instance *di,
-                       const char *driver, int unitsize, uint64_t starttime);
+                       const char *driver, int unitsize, uint64_t starttime,
+                       uint64_t samplerate);
 int srd_exit(void);
 
 #ifdef __cplusplus