summaryrefslogtreecommitdiff
path: root/irmp/irmp-main-sharedlib.c
AgeCommit message (Collapse)Author
2021-12-26ir_irmp: wrapper lib, add locking and Python threading supportGerhard Sittig
The IRMP core library is not thread safe (known limitation, heritage of the AVR firmware origin). Add a mutex so that calling applications can lock IR decoder core instances. Allow Python threading while waiting for the locks, we can safely assume that this IRMP wrapper is used in the sigrok context which does require Python for decoders. Add my copyright for the non-trivial changes. This implementation uses glib for locking to improve portability, which already is a dependency of the libsigrokdecode component. This version uses belt and suspenders by implementing a constructor as well as adding auto init calls to each of the public API code paths. The client ID is not an essential requirement, but useful during application maintenance.
2021-12-26ir_irmp: wrapper lib, silence warnings in "Windows or Unix" conditionGerhard Sittig
Platform detection in the external IRMP library works best when either the WIN32 or the unix identifiers are provided, which the sigrokdecode build environment derives from other identifiers which are more reliably available. It turns out that other external dependencies like glib or Python may provide some of these identifiers, too. Which results in the compiler warning about symbols' redefinition. Only define derived identifiers when they haven't been provided yet. This amends commit ab88bae1c7b9.
2020-07-18irmp: workaround incomplete platform detection when under libtoolGerhard Sittig
The upstream IRMP project builds fine with direct gcc(1) invocation. While the same imported source fails detection and then defaults to AVR when built under libtool in the libsigrokdecode setup. Provide the symbols which IRMP logic expects, to reduce changes against upstream sources. Derive these symbols from conditions that are checked in the sigrok project in other locations, too.
2020-07-18irmp: silence core logic ANALYZE output from the shared libraryGerhard Sittig
Workaround the default verbosity level of the IRMP core logic for PC library build configurations. Silence the ANALYZE related output.
2020-07-18irmp: rework shared library (style, reliability, TODO items)Gerhard Sittig
Address several style nits in the previous implementation of the PC library, but keep the core as is to simplify future upstream tracking. Eliminate camel case identifiers, and in(?)/out prefixes for variables, only keep s_ for global(?) variables. Fixup whitespace, reduce a little indentation where appropriate. Separate variable declaration from later assignments and updates to improve readability. Use C style comments. Drop initializer values for .bss variables. Decorate the declaration as well as implementation of routines for symbol export. Improve robustness of name lookups in the list of known protocols. Prefer native C language data types in the public API. Normalize data in the wrapper so that application code need not care. Make the byte buffer API for IR frame detection optional. The API is limited and overloaded at the same time, and may need more consideration. Extend comments in spots which are essential for proper operation, or which encode non-obvious details of the build system. Control visibility of public API identifiers on non-Windows platforms, too. Rephrase the doxygen comments for more formal API documentation. Discuss limitations in the current implementation. Keep a TODO list in the source code.
2020-07-18irmp: introduce PC side shared library code for IRMP core logicGerhard Sittig
Introduce sources which implement a shared object (DLL) which embeds the IRMP core logic, receives pin values from an application, and makes IR detection from previously captured data available in PC environments as a library, in contrast to the text oriented desktop applications and the MCU firmware which existed before in the upstream project. Provided by: Rene Staffen