Uwe Hermann [Fri, 31 Jan 2014 15:59:22 +0000 (16:59 +0100)]
Add support for annotation rows.
An annotation row is a list of annotation classes that should all be
displayed in the same "row" in GUIs.
For example, the UART decoder would have at least two rows (for decoded
RX and TX data/startbits/stopbits/paritybits), the SPI decoder would have
at least two rows (for decoded MISO and MOSI data), and so on.
Each annotation row has a short ID string (mostly for use in
command-line frontends), a description string (mostly for use by GUIs),
and a tuple/list of annotation class IDs belonging to this row.
If no annotation rows are provided by the decoder, frontends can
consider this as the "trivial" case of all annotation classes being
displayed on the same (only) row.
Uwe Hermann [Thu, 30 Jan 2014 14:26:06 +0000 (15:26 +0100)]
uart: Better fix for ASCII output.
This is a temporary thing, later there'll be some facility to let
frontends handle any annotations marked as "this is a number" (as opposed
to "this is a string") in a generic manner and display them in any
supported (by that frontend) format, e.g. ascii, hex, oct, decimal,
binary, big-endian vs. little-endian, and so on.
Uwe Hermann [Wed, 22 Jan 2014 21:47:18 +0000 (22:47 +0100)]
All PDs: Drop unneeded comments.
The single comment re-stating the PD's name / description / purpose in
each pd.py file is not really needed, that info is available in the
Decoder class' attributes already.
Uwe Hermann [Mon, 20 Jan 2014 20:52:15 +0000 (21:52 +0100)]
transitioncounter: Drop PD (obsolete).
This decoder was just a simple test case for early libsigrokdecode
development and testing, it is neither useful nor properly working
currently, so drop it.
Uwe Hermann [Mon, 20 Jan 2014 16:43:01 +0000 (17:43 +0100)]
uart: Add binaryout/dump support, drop obsolete 'uart_dump' PD.
The functionality of the preliminary 'uart_dump' PD is now available
in the proper 'uart' PD, via the OUTPUT_BINARY mechanism that frontends
can use to dump decoded data (in various formats) to a file, or pipe it
into other applications, and so on.
Uwe Hermann [Sat, 18 Jan 2014 18:15:41 +0000 (19:15 +0100)]
i2s: Add WAV dump support, drop obsolete 'i2s_dump' PD.
The functionality of the preliminary 'i2s_dump' PD is now available
in the proper 'i2s' PD, via the OUTPUT_BINARY mechanism that frontends
can use to dump decoded data (in various formats) to a file, or pipe it
into other applications, and so on.
Uwe Hermann [Fri, 17 Jan 2014 16:56:08 +0000 (17:56 +0100)]
configure.ac: Check for all known Python3 pkg-config names.
Even when using pkg-config not all distro/platform specific issues are
transparent, unfortunately. On some systems the pkg-config file is
named "python3.pc" on others it's versioned, e.g. "python-3.2.pc".
See also: http://sigrok.org/wiki/Libsigrokdecode/Python
This should fix the build on e.g. FreeBSD, NetBSD, Mac OS X (some
versions), and possibly various Linux distros, e.g. Gentoo.
Also, drop manual AC_MSG_ERROR() and let PKG_CHECK_MODULES() output a
more verbose and standardized error message if Python 3 is not found.
Uwe Hermann [Fri, 3 Jan 2014 16:41:24 +0000 (17:41 +0100)]
Link against libm to avoid Python related linking errors.
The python3-config script reported "-lm" as linker option previously,
but we switched to using pkg-config (among other things for
cross-compile support) which doesn't report "-lm" though (this is a
common behaviour across multiple distros and OSes).
Bert Vermeulen [Wed, 11 Dec 2013 17:31:56 +0000 (18:31 +0100)]
Load decoders from all search paths, not just the default.
srd_decoder_load_all() was really only getting a list of decoders
from the default (installation) path, so could not find uninstalled
decoders, or those in a custom added search path.
This broke development of new PDs when using the SIGROKDECODE_DIR
environment variable, and broke many of the unit tests in the tests/
directory -- those actually tested against the already-installed
decoders, not the ones about to be installed.
Bert Vermeulen [Tue, 10 Dec 2013 16:17:38 +0000 (17:17 +0100)]
Add protocol decoder testing framework.
This adds a tool in the tests directory, called pdtest. It uses the
"test/" directory in every PD directory, if present, to run the
PD against dumps found in the sigrok-dumps repository, and compares
the output against ".output" files in the "test/" directory. The file
"test/test.conf" is used to configure which tests to run.
A separate tool (tests/runtc.c) is used to run the actual decoding and
report output.
To get an overview of the options, run tests/pdtest without any options.
Bert Vermeulen [Wed, 27 Nov 2013 15:47:04 +0000 (16:47 +0100)]
Automate protocol decoder installation.
This automatically figures out the files to install for each protocol
decoder, without involving autotools.
All python files (filenames ending in .py) are always installed. If a
protocol decoder requires installation of a non-python file, a small
file called 'config' can be created in that protocol decoder's
directory, with the following content:
# comments are ok
extra-install vendorlist.txt commands.txt
Uwe Hermann [Tue, 19 Nov 2013 20:14:03 +0000 (21:14 +0100)]
Add a missing #include.
This causes compiler errors in some setups otherwise, e.g.:
CC libsigrokdecode_la-session.lo
session.c: In function 'srd_session_metadata_set':
session.c:195:46: error: expected ')' before 'PRIu64'
srd_dbg("Setting session %d samplerate to %"PRIu64".",
^
session.c: In function 'srd_session_send':
session.c:242:15: error: expected ')' before 'PRIu64'
"number %" PRIu64 ", %" PRIu64 " bytes at 0x%p",
^
Bert Vermeulen [Mon, 18 Nov 2013 09:44:28 +0000 (10:44 +0100)]
Don't try to load an already-loaded module
Python silently uses the existing module anyway, but the library
was counting it as an extra module. This was exposed by a test
case in the test suite.
Bert Vermeulen [Sun, 10 Nov 2013 11:42:11 +0000 (12:42 +0100)]
Implement OUTPUT_BINARY
This requires the PD to have a tuple in its class called 'binary',
which contains a list of strings describing the different binary
classes it can output. For the SPI decoder this might be 'MOSI' and
'MISO', for example.
The data is submitted to the frontend as struct srd_proto_data_binary,
which contains the class that data belongs to.