From ed41649709abc02362df526cbd725775000e8199 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Wed, 30 Oct 2013 16:30:05 +0100 Subject: Pass metadata to PDs only at runtime, not at decoder start The SRD_CONF_NUM_PROBES metadata key was removed. It wasn't actually used for anything, since this is trivially available via the configured (or default) probe list. The SRD_CONF_UNITSIZE key was removed. The unit size is instead derived from the probe list: the number of probes packed into the least amount of space possible defines the unit size. PD changes: * The start() method no longer takes a 'metadata' parameter. * Metadata now comes in only via the metadata() method, which takes a key and value. The only key defined so far is SRD_CONF_SAMPLERATE, which is exported into the module namespace. API changes: * srd_session_send() now takes an end_samplenum parameter, and had its options rearranged. * srd_session_config_set() is now srd_session_metadata_set(). This keeps "config" options for a future feature to allow PDs or frontends to configure each other's options on the fly, up and down the stack. --- module_sigrokdecode.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module_sigrokdecode.c') diff --git a/module_sigrokdecode.c b/module_sigrokdecode.c index 655c1f5..6fba05c 100644 --- a/module_sigrokdecode.c +++ b/module_sigrokdecode.c @@ -77,6 +77,9 @@ PyMODINIT_FUNC PyInit_sigrokdecode(void) if (PyModule_AddIntConstant(mod, "OUTPUT_BINARY", SRD_OUTPUT_BINARY) == -1) return NULL; + if (PyModule_AddIntConstant(mod, "SRD_CONF_SAMPLERATE", + SRD_CONF_SAMPLERATE) == -1) + return NULL; mod_sigrokdecode = mod; -- cgit v1.2.3-70-g09d2