sigrok-cli.git
2 years agosigrok-cli.h: Drop unused functions and #defines.
Uwe Hermann [Mon, 16 Apr 2018 22:23:00 +0000 (00:23 +0200)]
sigrok-cli.h: Drop unused functions and #defines.

2 years agoAdd a .desktop file and an icon.
Uwe Hermann [Sat, 7 Apr 2018 17:27:45 +0000 (19:27 +0200)]
Add a .desktop file and an icon.

2 years agomanpage: Don't list specific output formats, mention -L.
Uwe Hermann [Mon, 26 Mar 2018 07:02:56 +0000 (09:02 +0200)]
manpage: Don't list specific output formats, mention -L.

The list is going to be outdated eventually (e.g. "gnuplot" no longer
exists), it's better to just mention that -L can be used to get a list.

2 years agoForce backup analog traces only if needed
Vincent Palatin [Tue, 24 Oct 2017 12:00:29 +0000 (14:00 +0200)]
Force backup analog traces only if needed

With the current conditions, when using the 'srzip' output module with
device generating SR_DF_ANALOG packets, they are processed both by
'srzip' and the backup 'analog' module (as 'out' is always null for
srzip which does its own file operation).
For a moderately fast continuous analog capture (e.g. 2.4MSamples/s),
the overhead of the 'analog' module is important (e.g. 80% of the whole
processing of my workstation) while we are not using its output,
so disable it when the user actually selected an output format/file
but the module doesn't generate text output.

Also remove the second part of the condition as 'opt_output_format'
never seems to be null or at least not in the case where the user has
omitted output parameters.

Tested with a device generating analog packets both with '-o test.sr'
and no output option.

3 years agoUpdate manpage references from -V to -L
yahvuu [Wed, 13 Sep 2017 17:45:50 +0000 (19:45 +0200)]
Update manpage references from -V to -L

Since bug #604, the supported drivers, decoders and input/output formats
are listed by -L|--list-supported.

Update the references in the manpage to -L, accordingly.

3 years agodecode: Always print colon after protocol decoder ID
Gerhard Sittig [Sun, 9 Jul 2017 12:09:31 +0000 (14:09 +0200)]
decode: Always print colon after protocol decoder ID

Remove the "bug compatibility" support. It's assumed that the omission
of the colon after the protocol decoder ID in log level 3 was less of a
design choice, but instead a byproduct of the redundancy in a previous
implementation (multiple code paths that got out of sync).

3 years agodoc: add --protocol-decoder-samplenum option to the manpage
Gerhard Sittig [Mon, 31 Jul 2017 17:32:05 +0000 (19:32 +0200)]
doc: add --protocol-decoder-samplenum option to the manpage

3 years agodecode: Optionally print sample numbers with protocol decoder annotations
Gerhard Sittig [Sun, 9 Jul 2017 11:56:45 +0000 (13:56 +0200)]
decode: Optionally print sample numbers with protocol decoder annotations

Introduce the "--protocol-decoder-samplenum" command line option (no
short form available), which emits sample numbers with textual output
from protocol decoder annotations, regardless of a log level value.

This shall increase usability of sigrok-cli output with external
postprocessors, as the option exclusively adds sample numbers to the
output but does not affect the presence or layout of any other line.

This commit prepends "text" and "meta" annotations with sample number
information. It does not change "binary" output.

3 years agodecode: Rework logic for text output of protocol decoder annotations
Gerhard Sittig [Sun, 9 Jul 2017 11:44:39 +0000 (13:44 +0200)]
decode: Rework logic for text output of protocol decoder annotations

Fold the previous three code paths which formatted text output for
annotations into one code path, which inspects the flags that were
determined before the actual output, and then always formats the fields
in identical ways regardless of why a field is shown.

Remove the assert checks that were introduced in a previous commit. The
logic for the field selection was proven to be identical to the previous
behaviour.

3 years agodecode: Prepare to rework text output for protocol decoder annotations
Gerhard Sittig [Sun, 9 Jul 2017 11:10:31 +0000 (13:10 +0200)]
decode: Prepare to rework text output for protocol decoder annotations

When the current implementation receives a protocol decoder annotation,
one out of several code paths prints one of several different variations
of text layout. The current implementation exclusively checks the active
log level to determine the layout variant.

Prepare to rework that text layout logic. Separate the determination of
which fields to display from the logic which does emit those fields in a
specific format.

This commit does not yet adjust the print statements. It is supposed to
verify that the "which fields to display?" logic results in identical
behaviour to the previous implementation.

3 years agodecode: Nit, avoid 'class' identifier for local variable
Gerhard Sittig [Sun, 9 Jul 2017 08:50:42 +0000 (10:50 +0200)]
decode: Nit, avoid 'class' identifier for local variable

3 years agosession: Adjust scan for non-demo device
Gerhard Sittig [Sat, 17 Jun 2017 16:19:34 +0000 (18:19 +0200)]
session: Adjust scan for non-demo device

The "demo?" condition is a property of the driver not a device instance.
Adjust the check accordingly, by not passing the 'sdi' when retrieving
the list of options. Rename the involved variable to reflect its purpose.
Adjust an error message text.

This fixes bug #848.

3 years agoHACKING: Prefer git pull requests over mailing list patches.
Uwe Hermann [Tue, 13 Jun 2017 15:08:21 +0000 (17:08 +0200)]
HACKING: Prefer git pull requests over mailing list patches.

Also, drop the reference to gitorious.org (no longer available).

3 years agoconfigure.ac: Bump package version to 0.8.0.
Uwe Hermann [Tue, 13 Jun 2017 20:52:53 +0000 (22:52 +0200)]
configure.ac: Bump package version to 0.8.0.

0.8.0 will be the next major release. Bump now, so that
there is no confusion of tarball 0.7.0 and 0.8.0-git snapshots.

3 years agoNEWS: Update for upcoming 0.7.0 release.
Uwe Hermann [Thu, 8 Jun 2017 18:28:02 +0000 (20:28 +0200)]
NEWS: Update for upcoming 0.7.0 release.

3 years agoFix various clang warnings. sigrok-cli-unreleased
Uwe Hermann [Thu, 8 Jun 2017 21:16:18 +0000 (23:16 +0200)]
Fix various clang warnings.

../show.c:668:30: warning: variable 'q' is uninitialized when used here [-Wuninitialized]
                                        s = sr_period_string(p, q);
                                                                ^
../show.c:324:30: note: initialize the variable 'q' to silence this warning
        const uint64_t *uint64, p, q, low, high;
                                    ^
                                     = 0
../show.c:668:27: warning: variable 'p' is uninitialized when used here [-Wuninitialized]
                                        s = sr_period_string(p, q);
                                                             ^
../show.c:324:27: note: initialize the variable 'p' to silence this warning
        const uint64_t *uint64, p, q, low, high;
                                 ^
                                  = 0
../show.c:458:58: warning: variable 'high' is uninitialized when used here [-Wuninitialized]
                                printf("    Maximum number of samples: %"PRIu64"\n", high);
                                                                                     ^~~~
../show.c:324:41:   CC       input.o
note: initialize the variable 'high' to silence this warning
        const uint64_t *uint64, p, q, low, high;
                                               ^
                                                = 0
../show.c:589:33: warning: variable 'low' is uninitialized when used here [-Wuninitialized]
                                printf("%"PRIu64"-%"PRIu64, low, high);
                                                            ^~~
../show.c:324:35: note: initialize the variable 'low' to silence this warning
        const uint64_t *uint64, p, q, low, high;
                                         ^
                                          = 0

3 years agoHACKING: Update URL to Linux kernel coding style.
Uwe Hermann [Tue, 6 Jun 2017 12:45:37 +0000 (14:45 +0200)]
HACKING: Update URL to Linux kernel coding style.

3 years agoREADME: Drop trailing whitespace.
Uwe Hermann [Tue, 6 Jun 2017 12:05:12 +0000 (14:05 +0200)]
README: Drop trailing whitespace.

3 years agoFix build when using --without-libsigrokdecode.
Uwe Hermann [Tue, 6 Jun 2017 09:15:45 +0000 (11:15 +0200)]
Fix build when using --without-libsigrokdecode.

3 years agoInstaller: Whitespace consistency fixes.
Uwe Hermann [Mon, 5 Jun 2017 15:43:32 +0000 (17:43 +0200)]
Installer: Whitespace consistency fixes.

3 years agoInstaller: Add "sigrok-cli" to uninstaller/Zadig links.
Soeren Apel [Mon, 5 Jun 2017 15:16:30 +0000 (17:16 +0200)]
Installer: Add "sigrok-cli" to uninstaller/Zadig links.

Windows 10 merges all links of the same vendor ("sigrok" here) into one
section in the Start menu. If PulseView and sigrok-cli are installed,
there will be two "Uninstall" links and the user will not know which one
uninstalls which program.

3 years agoInstaller: Place set of example .sr files in separate section
Soeren Apel [Mon, 5 Jun 2017 15:13:21 +0000 (17:13 +0200)]
Installer: Place set of example .sr files in separate section

3 years ago--list-supported: Show detailed library/feature info.
Uwe Hermann [Sat, 3 Jun 2017 15:17:04 +0000 (17:17 +0200)]
--list-supported: Show detailed library/feature info.

3 years agoList supported devices, modules, decoders via --list-supported.
Uwe Hermann [Sat, 3 Jun 2017 15:03:44 +0000 (17:03 +0200)]
List supported devices, modules, decoders via --list-supported.

Move this data from -V to -L|--list-supported for usability reasons.

This fixes bug #604.

3 years agoBump requirements to libsigrok/libsigrokdecode 0.5.0.
Uwe Hermann [Wed, 31 May 2017 21:09:57 +0000 (23:09 +0200)]
Bump requirements to libsigrok/libsigrokdecode 0.5.0.

We use various new API calls from the upcoming 0.5.0 releases and are
not compatible with the respective 0.4.x anymore.

3 years agoshow: Also print the possible decoder input/output IDs.
Uwe Hermann [Wed, 31 May 2017 21:00:39 +0000 (23:00 +0200)]
show: Also print the possible decoder input/output IDs.

3 years agooptions: expand builtin help, discuss samples/time/continuous constraint
Gerhard Sittig [Tue, 23 May 2017 17:41:41 +0000 (19:41 +0200)]
options: expand builtin help, discuss samples/time/continuous constraint

It might be surprising when the sigrok-cli(1) program does nothing (yet
spends user noticable time) before quitting while it spews the --help
text to the screen. Expand the builtin help text, explicitly mention
that either of --samples or --frames or --time or --continuous are
essentially required for data acquisition.

3 years agoUpdate sr_period_string usage
Soeren Apel [Sat, 25 Feb 2017 21:56:36 +0000 (22:56 +0100)]
Update sr_period_string usage

3 years agoconfigure summary: Show linker flags.
Uwe Hermann [Sun, 5 Mar 2017 16:08:54 +0000 (17:08 +0100)]
configure summary: Show linker flags.

3 years agoShow annotations based on decoder ID
Karl Palsson [Tue, 29 Nov 2016 16:21:30 +0000 (16:21 +0000)]
Show annotations based on decoder ID

Originally, decoder ID was equal to decoder instance ID, so it didn't
matter what you were comparing with. However, with distinct decoder
instances, this assumption fails. Because instance IDs can't be known
in advance, and because it would make the CLI arguments even more
complex, we simply let the -A option continue to be per decoder, not per
instance. This maintains compatibility with prior behaviour, but
doesn't allow the full flexibility possible with the library.

Behaviour preserved:
Single PD, no -A flag => all annotations from PD
Single PD, -A pdid => all annotations from PD
Single PD, -A pdid=annX => annX from PD

Behaviour now added:
Duplicate PDs, no -A flag => all annotations from all PDs
Duplicate PDs, -A pdid => all annotations from all PDs of type pdid
Duplicate PDs, -A pdid=annX => all annX from all PDs of type pdid

This fixes parts of bug #868.

Signed-off-by: Karl Palsson <karlp@etactica.com>
3 years agovalgrind: Clear more unfreed memory issues
Karl Palsson [Tue, 29 Nov 2016 14:32:29 +0000 (14:32 +0000)]
valgrind: Clear more unfreed memory issues

Command line used for checking:

  $ valgrind -v --leak-check=full ./sigrok-cli \
    -i rockband_wireless_keyboard_wii/midi_key4.sr \
    -P uart:baudrate=31250,midi -P uart:baudrate=31250,midi

Signed-off-by: Karl Palsson <karlp@etactica.com>
3 years agoInclude decoder instance ID in normal outputs
Karl Palsson [Tue, 29 Nov 2016 13:19:46 +0000 (13:19 +0000)]
Include decoder instance ID in normal outputs

Without this, it's nigh impossible to determine what lines of output are
from what decoder. While -l 4 and above will include this information,
this feels like something that is essential even at the basic level.

Old:
System Realtime: active sensing
System Realtime: active sensing
System Realtime: active sensing
UNHANDLED DATA: 0x00
Channel 1: note on (note = 51 'D#3', velocity = 70)
System Realtime: active sensing
System Realtime: active sensing
System Realtime: active sensing
System Realtime: active sensing
UNHANDLED DATA: 0x00
Channel 1: note on (note = 51 'D#3', velocity = 70)
System Realtime: active sensing

New:

midi1: System Realtime: active sensing
midi1: System Realtime: active sensing
midi1: System Realtime: active sensing
midi1: UNHANDLED DATA: 0x00
midi1: Channel 1: note on (note = 51 'D#3', velocity = 70)
midi1: System Realtime: active sensing
midi2: System Realtime: active sensing
midi2: System Realtime: active sensing
midi2: System Realtime: active sensing
midi2: UNHANDLED DATA: 0x00
midi2: Channel 1: note on (note = 51 'D#3', velocity = 70)
midi2: System Realtime: active sensing

This fixes parts of bug #868.

Signed-off-by: Karl Palsson <karlp@etactica.com>
3 years agoSupport multiple protocol decoder stacks
Karl Palsson [Fri, 25 Nov 2016 16:28:17 +0000 (16:28 +0000)]
Support multiple protocol decoder stacks

Requires libsigrokdecode changes to actually work.
This allows multiple -P options to be specified, each of which is
registered as a full stack with libsigrokdecode.

At this point, there's no way to specify annotations per instance, the
annotations are simply global per decoder (as before) rather than per
instance.

This fixes parts of bug #868.

Signed-off-by: Karl Palsson <karlp@etactica.com>
3 years agoDrop -S stack option
Karl Palsson [Thu, 24 Nov 2016 12:29:09 +0000 (12:29 +0000)]
Drop -S stack option

The -P option already stacks. The -S option was only used for changing the
stacking order. Simply require the correct order with -P. This reduces
the confusion in stacking.

Signed-off-by: Karl Palsson <karlp@etactica.com>
3 years agosigrok-cli_cross.nsi.in: Use Python 3.4 (Windows XP support).
Uwe Hermann [Fri, 17 Feb 2017 08:24:18 +0000 (09:24 +0100)]
sigrok-cli_cross.nsi.in: Use Python 3.4 (Windows XP support).

The last Python version to officially support Windows XP was 3.4.x.

We'll keep the Windows installers at that version for the time being,
until Windows XP support is no longer feasible (e.g. because important
sigrok requirements such as Qt, glib, or libusb drop XP suppport).

3 years agosigrok-cli_cross.nsi.in: Bump Python version to 3.6.
Uwe Hermann [Thu, 2 Feb 2017 21:26:52 +0000 (22:26 +0100)]
sigrok-cli_cross.nsi.in: Bump Python version to 3.6.

3 years agolicense: remove FSF postal address from boiler plate license text
Gerhard Sittig [Thu, 20 Oct 2016 07:49:00 +0000 (09:49 +0200)]
license: remove FSF postal address from boiler plate license text

Remove the FSF postal address as it might change (it did in the past).
Reference the gnu.org website instead which is more stable.

3 years ago--help output: More specific --show help text.
Uwe Hermann [Thu, 20 Oct 2016 21:09:24 +0000 (23:09 +0200)]
--help output: More specific --show help text.

Mention that --show also works for showing input/output format options,
as well as protocol decoder options.

This fixes bug #851.

3 years agoshow: print binary classes as well in protocol decoder details
Gerhard Sittig [Sun, 16 Oct 2016 16:25:30 +0000 (18:25 +0200)]
show: print binary classes as well in protocol decoder details

The output of `sigrok -P <decoder> --show` omitted the binary classes,
users could not learn which specs are available for the -B option.  Add
a "Binary classes:" section after the list of annotations.

Signed-off-by: Gerhard Sittig <gerhard.sittig@gmx.net>
4 years agoconfigure.ac: Bump package version to 0.7.0.
Uwe Hermann [Mon, 15 Aug 2016 12:52:18 +0000 (14:52 +0200)]
configure.ac: Bump package version to 0.7.0.

0.7.0 will be the next major release. Bump now, so that
there is no confusion of tarball 0.6.0 and 0.7.0-git snapshots.

4 years agoNEWS: Update for upcoming 0.6.0 release. sigrok-cli-0.6.x sigrok-cli-0.6.0
Uwe Hermann [Fri, 29 Jan 2016 20:51:13 +0000 (21:51 +0100)]
NEWS: Update for upcoming 0.6.0 release.

4 years agoUpdate API calls due to recent libsigrok renames.
Uwe Hermann [Thu, 31 Dec 2015 17:55:29 +0000 (18:55 +0100)]
Update API calls due to recent libsigrok renames.

 - sr_driver_scan_options() -> sr_driver_scan_options_list()

 - sr_dev_config_capabilities() -> sr_dev_config_capabilities_list()

4 years agoUpdate for configuration API changes.
Martin Ling [Tue, 3 Nov 2015 11:42:30 +0000 (11:42 +0000)]
Update for configuration API changes.

4 years agoinput: Use own main loop instead of sr_session_run()
Daniel Elstner [Fri, 9 Oct 2015 16:45:03 +0000 (18:45 +0200)]
input: Use own main loop instead of sr_session_run()

Again, this is mainly for demonstration purposes, and to make
sigrok-cli consistently use the same "modern" API everywhere.

4 years agobuild: Require GLib 2.32.0
Daniel Elstner [Fri, 9 Oct 2015 16:33:14 +0000 (18:33 +0200)]
build: Require GLib 2.32.0

This is needed for the G_SOURCE_REMOVE symbolic constant. Although
it would be trivial to make do without it, there is no reason not to
bump the requirement since libsigrok depends on GLib 2.32.0 anyway.

4 years agoanykey: Use GLib I/O channel watch
Daniel Elstner [Fri, 9 Oct 2015 16:26:00 +0000 (18:26 +0200)]
anykey: Use GLib I/O channel watch

Watch for input on a GLib I/O channel using the standard GLib main
loop API instead of injecting an FD event source into the sigrok
session loop.

Also run the session in a main loop created by sigrok-cli instead
of using sr_session_run(). This is mainly for demonstration; the
GLib I/O watch change would work even with sr_session_run() since
it is using the same main context in this case.

4 years agooptions: Type of G_OPTION_ARG_NONE is gboolean
Daniel Elstner [Fri, 9 Oct 2015 15:22:21 +0000 (17:22 +0200)]
options: Type of G_OPTION_ARG_NONE is gboolean

Change mistaken gchar * variables to gboolean type.

4 years agoUse g_strerror() in favor of strerror().
Uwe Hermann [Wed, 7 Oct 2015 00:05:00 +0000 (02:05 +0200)]
Use g_strerror() in favor of strerror().

4 years agowindows: Install data files into share subdirectory
Daniel Elstner [Sat, 3 Oct 2015 15:50:28 +0000 (17:50 +0200)]
windows: Install data files into share subdirectory

This allows these files to be found on standard paths relative
to the executable location.

5 years agoMakefile.am: Shorten ChangeLog target a bit.
Uwe Hermann [Mon, 14 Sep 2015 15:31:59 +0000 (17:31 +0200)]
Makefile.am: Shorten ChangeLog target a bit.

5 years agoBuild: Move _POSIX_C_SOURCE definition to config.h
Daniel Elstner [Sun, 13 Sep 2015 20:45:24 +0000 (22:45 +0200)]
Build: Move _POSIX_C_SOURCE definition to config.h

Do not redefine it though when already set, so that it can be
overridden by the user, or indirectly by the compiler settings.

5 years agoBuild: Include <config.h> first in all source files
Daniel Elstner [Sun, 13 Sep 2015 20:42:51 +0000 (22:42 +0200)]
Build: Include <config.h> first in all source files

Since Autoconf places some important feature flags only into the
configuration header, it is necessary to include it globally to
guarantee a consistent build.

5 years agoUse PRIu64 instead of %ld for uint64_t printing.
Uwe Hermann [Sat, 12 Sep 2015 15:06:43 +0000 (17:06 +0200)]
Use PRIu64 instead of %ld for uint64_t printing.

5 years agoClean up .gitignore
Daniel Elstner [Sat, 5 Sep 2015 22:51:10 +0000 (00:51 +0200)]
Clean up .gitignore

5 years agoBuild: Adopt modernized Autotools build system
Daniel Elstner [Sat, 5 Sep 2015 21:12:09 +0000 (23:12 +0200)]
Build: Adopt modernized Autotools build system

5 years agoBuild: Add copy of sigrok.m4 from libsigrok
Daniel Elstner [Sat, 5 Sep 2015 21:08:51 +0000 (23:08 +0200)]
Build: Add copy of sigrok.m4 from libsigrok

5 years agodevice: Use g_ascii_strcasecmp() for portability
Daniel Elstner [Sat, 5 Sep 2015 21:20:21 +0000 (23:20 +0200)]
device: Use g_ascii_strcasecmp() for portability

5 years agoFree trigger after acquisition session.
Bert Vermeulen [Tue, 8 Sep 2015 12:26:22 +0000 (14:26 +0200)]
Free trigger after acquisition session.

5 years agoNSIS installer fix for Windows
Daniel Elstner [Wed, 2 Sep 2015 13:55:41 +0000 (15:55 +0200)]
NSIS installer fix for Windows

5 years agoSupport SR_T_MQ.
Bert Vermeulen [Sun, 23 Aug 2015 21:21:14 +0000 (23:21 +0200)]
Support SR_T_MQ.

5 years agoSupport SR_T_MQLIST.
Bert Vermeulen [Sun, 23 Aug 2015 21:21:14 +0000 (23:21 +0200)]
Support SR_T_MQLIST.

5 years agoUse new sr_key_info instead of sr_config_info.
Bert Vermeulen [Sun, 23 Aug 2015 21:20:40 +0000 (23:20 +0200)]
Use new sr_key_info instead of sr_config_info.

5 years agosession: Use INTERNAL_IO_HANDLING output module flag
Soeren Apel [Thu, 20 Aug 2015 18:24:29 +0000 (20:24 +0200)]
session: Use INTERNAL_IO_HANDLING output module flag

Also, fix the segfault occuring due to an invalid outfile
handle when using srzip.

5 years agoPass unitsize to srd_session_send() directly.
Uwe Hermann [Thu, 20 Aug 2015 17:47:12 +0000 (19:47 +0200)]
Pass unitsize to srd_session_send() directly.

Follow an API change in libsigrokdecode where srd_inst_channel_set_all()
no longer gets passed a unitsize, but rather srd_session_send() gets it.

This allows us to avoid having to guess a unitsize based on the number
of channels (which guesses incorrectly in some cases).

This fixes (parts of) bug #352.

5 years agonsis: Add start menu entries for Zadig.
Uwe Hermann [Sun, 9 Aug 2015 15:27:18 +0000 (17:27 +0200)]
nsis: Add start menu entries for Zadig.

This fixes bug #543.

5 years agoDon't open an output file in the case of srzip.
Uwe Hermann [Thu, 30 Jul 2015 17:11:17 +0000 (19:11 +0200)]
Don't open an output file in the case of srzip.

This fixes parts of bug #570.

5 years agosession: Supply filename to the output module directly
Soeren Apel [Wed, 29 Jul 2015 19:37:47 +0000 (21:37 +0200)]
session: Supply filename to the output module directly

This fixes parts of bug #570.

5 years agoBuild-depend on the upcoming libsigrok + libsigrokdecode 0.4.0.
Uwe Hermann [Sat, 18 Jul 2015 16:07:12 +0000 (18:07 +0200)]
Build-depend on the upcoming libsigrok + libsigrokdecode 0.4.0.

5 years agoBump version to 0.6.0 (the upcoming next major release).
Uwe Hermann [Sat, 18 Jul 2015 16:05:58 +0000 (18:05 +0200)]
Bump version to 0.6.0 (the upcoming next major release).

5 years agoAppend "-git" to the version string.
Uwe Hermann [Sat, 18 Jul 2015 16:05:36 +0000 (18:05 +0200)]
Append "-git" to the version string.

This avoids confusion with the released tarballs.

5 years agoCheck if hash table is NULL before accessing it.
Jens Steinhauser [Fri, 17 Apr 2015 21:28:44 +0000 (23:28 +0200)]
Check if hash table is NULL before accessing it.

This fixes bug 520.

5 years agoautogen.sh: Drop obsolete MinGW/MSYS items.
Uwe Hermann [Tue, 7 Apr 2015 00:38:39 +0000 (02:38 +0200)]
autogen.sh: Drop obsolete MinGW/MSYS items.

For Windows builds (which require MinGW-w64) we currently support:

 - cross-builds using MXE (mxe.cc) and possibly other cross-compile setups

 - native builds using MSYS2 (sf.net/projects/msys2/)

Neither of those require explicitly specifying ACLOCAL_DIR.

5 years agoUpdate due to sr_driver_list() now taking a context.
Uwe Hermann [Sat, 4 Apr 2015 17:34:06 +0000 (19:34 +0200)]
Update due to sr_driver_list() now taking a context.

5 years agoMinor cosmetics.
Uwe Hermann [Thu, 26 Mar 2015 20:56:29 +0000 (21:56 +0100)]
Minor cosmetics.

5 years agoDon't check g_free() arguments for NULL.
Uwe Hermann [Thu, 26 Mar 2015 20:51:37 +0000 (21:51 +0100)]
Don't check g_free() arguments for NULL.

The g_free() call is guaranteed to not segfault when NULL is passed.

5 years agoVarious #include file cosmetic fixes.
Uwe Hermann [Thu, 26 Mar 2015 20:39:28 +0000 (21:39 +0100)]
Various #include file cosmetic fixes.

Generally include system headers before local headers, unless there's
a technical reason to use another order.

5 years agosigrok-cli: Update for sr_session_{new,load} API change.
Martin Ling [Wed, 25 Mar 2015 01:54:52 +0000 (01:54 +0000)]
sigrok-cli: Update for sr_session_{new,load} API change.

5 years agoMinor cosmetics, whitespace- and consistency fixes.
Uwe Hermann [Fri, 20 Mar 2015 18:38:33 +0000 (19:38 +0100)]
Minor cosmetics, whitespace- and consistency fixes.

5 years agoUse sr_dev_channel_enable().
Martin Ling [Thu, 19 Mar 2015 22:00:34 +0000 (22:00 +0000)]
Use sr_dev_channel_enable().

5 years agoFix memory leak in config_key_has_cap().
Martin Ling [Wed, 18 Mar 2015 16:40:18 +0000 (16:40 +0000)]
Fix memory leak in config_key_has_cap().

5 years agosession.c: Indicate the error type when --config --set fails.
Bartosz Golaszewski [Thu, 26 Feb 2015 15:06:26 +0000 (16:06 +0100)]
session.c: Indicate the error type when --config --set fails.

When sigrok-cli fails to set a config option it doesn't indicate
the actual error as opposed to --get. Print the error message in
both cases.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
5 years agoshow: pass NULL parameter to config_key_has_cap() instead of uninitialized cg.
Aurelien Jacobs [Thu, 12 Feb 2015 16:08:33 +0000 (17:08 +0100)]
show: pass NULL parameter to config_key_has_cap() instead of uninitialized cg.

It doesn't make sense to pass a cg to this config_key_has_cap() call
as it is trying to retrieve the device's global SR_CONF_LIMIT_SAMPLES.

This fixes the following warning:

show.c: In function ‘show_dev_detail’:
show.c:392:8: warning: ‘cg’ may be used uninitialized in this function [-Wmaybe-uninitialized]
     && config_key_has_cap(driver, sdi, cg, key, SR_CONF_LIST)) {
        ^

5 years agosession: remove unused variable 'size'.
Aurelien Jacobs [Thu, 12 Feb 2015 15:00:54 +0000 (16:00 +0100)]
session: remove unused variable 'size'.

5 years agoImplement support for running transform modules.
Uwe Hermann [Wed, 11 Feb 2015 08:49:03 +0000 (09:49 +0100)]
Implement support for running transform modules.

Syntax:

 sigrok-cli ... -T <transformmodule>:opt1=val1:opt2=val2 ...

5 years agoAdd -T|--transform-module and show transform modules in -V output.
Uwe Hermann [Tue, 10 Feb 2015 19:01:07 +0000 (20:01 +0100)]
Add -T|--transform-module and show transform modules in -V output.

5 years agoREADME: Update build requirements list.
Uwe Hermann [Sat, 24 Jan 2015 19:52:31 +0000 (20:52 +0100)]
README: Update build requirements list.

5 years agoopt_to_gvar: notify the user in case of invalid values for --config
Bartosz Golaszewski [Thu, 4 Dec 2014 16:27:08 +0000 (17:27 +0100)]
opt_to_gvar: notify the user in case of invalid values for --config

sigrok-cli exits silently in many cases where values passed to --config are
empty strings or haven't been converted by GLib functions properly.

Check for errors and notify the user.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
5 years agoopt_to_gvar: support SR_T_KEYVALUE
Bartosz Golaszewski [Thu, 4 Dec 2014 16:27:07 +0000 (17:27 +0100)]
opt_to_gvar: support SR_T_KEYVALUE

The key-value data type is not supported as a configuration option. Implement
its support as a GLib dictionary.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
5 years agoopt_to_gvar: print an error message for unsupported data types
Bartosz Golaszewski [Thu, 4 Dec 2014 16:27:06 +0000 (17:27 +0100)]
opt_to_gvar: print an error message for unsupported data types

Unsupported data types are silently ignored in opt_to_gvar() switch
statement. This leads to confusion as sigrok-cli just exits without
giving the user any hint on what's the reason for not setting the option
properly.

Add an error message for unmatched data types.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
5 years agomingw: Drop libusb0.dll, always use libusb-1.0.
Uwe Hermann [Sun, 7 Dec 2014 16:48:29 +0000 (17:48 +0100)]
mingw: Drop libusb0.dll, always use libusb-1.0.

5 years agoAlways check config key capabilities before using them.
Bert Vermeulen [Tue, 18 Nov 2014 15:24:52 +0000 (16:24 +0100)]
Always check config key capabilities before using them.

5 years agoCheck for config key availability before using it.
Bert Vermeulen [Mon, 17 Nov 2014 12:59:42 +0000 (13:59 +0100)]
Check for config key availability before using it.

5 years agoUse the srzip output module instead of session save API.
Bert Vermeulen [Tue, 11 Nov 2014 23:03:16 +0000 (00:03 +0100)]
Use the srzip output module instead of session save API.

5 years agoUse getters now that 'struct sr_dev_inst' is opaque.
Uwe Hermann [Tue, 11 Nov 2014 15:32:33 +0000 (16:32 +0100)]
Use getters now that 'struct sr_dev_inst' is opaque.

5 years agoShow driver detail even if no device was found.
Bert Vermeulen [Mon, 27 Oct 2014 20:29:17 +0000 (21:29 +0100)]
Show driver detail even if no device was found.

5 years agoshow: Handle more datatypes in a generic way.
Bert Vermeulen [Mon, 27 Oct 2014 20:28:16 +0000 (21:28 +0100)]
show: Handle more datatypes in a generic way.

5 years agoFix memory leak.
Bert Vermeulen [Sun, 19 Oct 2014 09:52:37 +0000 (11:52 +0200)]
Fix memory leak.

5 years agoParse boolean command line options.
Jens Steinhauser [Sun, 19 Oct 2014 08:47:31 +0000 (10:47 +0200)]
Parse boolean command line options.

This fixes bug 450.

5 years agoClean up session file loading.
Bert Vermeulen [Thu, 2 Oct 2014 09:35:07 +0000 (11:35 +0200)]
Clean up session file loading.

5 years agoinput: Use sr_input_end() at end of input stream.
Bert Vermeulen [Tue, 23 Sep 2014 10:16:50 +0000 (12:16 +0200)]
input: Use sr_input_end() at end of input stream.