summaryrefslogtreecommitdiff
path: root/module_sigrokdecode.c
AgeCommit message (Collapse)Author
2015-10-06Python: Restrict code to stable ABI subsetDaniel Elstner
Limit usage of the Python C API to the stable ABI subset as defined by PEP 384. This removes some type definitions and functions which libsigrokdecode made use of. Convert all affected code to suitable API alternatives. Also fix a few leaks that became apparent while working on the code. The most visible change is that PyTypeObject is now an opaque type. Thus, the custom Decoder and srd_logic types are now created on the heap via an alternative API. Unfortunately, since tp_name is now inaccessible, type names had to be removed from the log output. Stack traces after Python exceptions are now formatted by calling into Python, since the trace object C API is no longer available.
2015-09-13Build: Include <config.h> first in all source filesDaniel Elstner
Since Autoconf places some important feature flags only into the configuration header, it is necessary to include it globally to guarantee a consistent build.
2014-07-08Remove dependency on Python.h from public API headerMarcus Comstedt
This prevents Python.h from being included into client code, where it can mess things up by e.g. redefining _POSIX_C_SOURCE.
2013-11-15Implement OUTPUT_METABert Vermeulen
This replaces the Decoder.add() method with Decoder.register(). The first argument is still output type, but all arguments are now optional: Decoder.register(output_type, id='someid', meta=(object-type, 'Name', 'Description')) 'id' defaults to the protocol decoder instance id, and only needs changing if a decoder chain needs to fork. 'object-type' refers to a Python object, such as int or str. After registering, the PD submits data as usual with Decoder.put(), with the only argument a value of the registered object-type.
2013-11-07Rename inter-PD output type to SRD_OUTPUT_PYTHONBert Vermeulen
This better reflects what it is: a python object generated and processed by python code.
2013-10-30Pass metadata to PDs only at runtime, not at decoder startBert Vermeulen
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.
2013-10-14Code cleanupBert Vermeulen
2013-05-03Main header is <libsigrokdecode/libsigrokdecode.h> now.Uwe Hermann
This matches the convention used in libsigrok. Potential other headers might end up in libsigrokdecode/, but only libsigrokdecode.h is meant to be #included by frontends directly.
2013-04-23GPL headers: Use correct project name.Uwe Hermann
2013-02-09Doxygen: Mark private functions/variables properly.Uwe Hermann
2012-04-16srd: Quickfix for MinGW build issue.Uwe Hermann
2012-03-18srd: Cosmetics, fix/add Doxygen comments.Uwe Hermann
2012-02-10srd: s/python/Python/.Uwe Hermann
2012-02-10srd: Add/use SRD_API/SRD_PRIV macros.Uwe Hermann
This is not yet finished, more things should be made private.
2012-02-10srd: Cosmetics, whitespace, coding-style fixes.Uwe Hermann
2012-01-22srd: use more appropriate calls for integer constantsBert Vermeulen
2012-01-15move sigrokdecode.Decoder type to its own source fileBert Vermeulen
2012-01-15srd: clean up module loading/unloading, and the decoder structBert Vermeulen
PDs are now checked for a proper Decoder object, with at least the required attributes. The author, long_desc and func attributes in the decoder object are gone.
2012-01-15move srd_Decoder to sigrokdecode.h, and rename it in line with srd_logicBert Vermeulen
2012-01-12srd: Drop duplicate SRD_ prefix from ANN/PROTO.Uwe Hermann
Using srd.SRD_OUTPUT_ANN is unneeded, srd.OUTPUT_ANN is better/shorter.
2012-01-10srd: annotation -> annotations.Uwe Hermann
In the PDs (Python code), the 'annotation' variable/attribute is a list of annotation formats. Use the plural 'annotations' as we do for other lists such as 'inputs', 'outputs', 'probes', 'options', and so on.
2012-01-10srd: Finish consistency rename to ANN/PROTO.Uwe Hermann
2012-01-10Stacked protocol decoders implementation.Bert Vermeulen
The DDC decoder takes input from the I2C PD.
2012-01-09code cleanupBert Vermeulen
2012-01-09srd: change output_new() API call to add()Bert Vermeulen
2012-01-08pass PD output to the calling frontend, simple annotation viewer in CLI.Bert Vermeulen
2012-01-07expose SRD_OUTPUT_* as symbols in the sigrokdecode module.Bert Vermeulen
2012-01-07Decoder.output_new() now takes an extra protocol_id argument.Bert Vermeulen
2012-01-07convert data coming in from a PD to C structsBert Vermeulen
This is in preparation for passing annotation data back to the calling frontend, and python data up to the next protocol in the stack.
2012-01-05new srd_logic type implementation for PDs to iterate over.Bert Vermeulen