Commit Graph

4824 Commits

Author SHA1 Message Date
Uwe Hermann 77b6b98d1c ipdbg-la: Simplify config_get/_set/_list. 2018-08-30 00:47:03 +02:00
Uwe Hermann 1f9652a861 ipdbg-la: Fix devopts[] contents. 2018-08-30 00:39:40 +02:00
Uwe Hermann 1f15efc1f7 ipdbg-la: Drop various unneeded name prefixes. 2018-08-30 00:33:39 +02:00
Uwe Hermann 932ef10f12 ipdbg-la: Fix incorrect copyright headers.
As per Daniel Anselmi <danselmi@gmx.ch> in an email conversation, the
code was actually written by Eva Kissling <eva.kissling@bluewin.ch>
(as indicated in the commit logs as well). Fix the headers accordingly.
2018-08-30 00:33:39 +02:00
Uwe Hermann 8a9788e2b7 ipdbg-la: Consistently use the same naming everywhere.
Use "ipdbg-la" everywhere to refer to the driver, including
in function name prefixes etc. There's no need to encode
website details (.org) into the driver/function name(s).
2018-08-30 00:11:51 +02:00
Soeren Apel ed18648423 ipdbg-la: Allow rx to time out and handle invalid data properly
This is required for when we connect to invalid devices, e.g.
port 4243 of the IPDBG host instead of 4242.
2018-08-29 23:59:48 +02:00
Soeren Apel 8771222588 ipdbg-la: Remove SR_CONF_SERIALCOMM 2018-08-29 23:59:45 +02:00
Soeren Apel 9d2e5483dc ipdbg-la: Adjust to sigrok indentation style 2018-08-29 23:59:42 +02:00
Soeren Apel 7f4c9a0444 ipdbg-la: More style fixes 2018-08-29 23:59:39 +02:00
Soeren Apel 38e7493dd1 ipdbg-la: Style fixes 2018-08-29 23:59:35 +02:00
Eva Kissling b51288e3da ipdbg-la: stop-command 2018-08-29 23:59:32 +02:00
Eva Kissling b8fa29a175 ipdbg-la: stop-function pulseview 2018-08-29 23:59:30 +02:00
Eva Kissling a66099c6fa ipdbg-la: add edge trigger option 2018-08-29 23:59:27 +02:00
Eva Kissling 2f15f5bfec ipdbg-la: revers order of trigger settings 2018-08-29 23:59:25 +02:00
Eva Kissling a54144c0bd ipdbg-la: return correct samples limit 2018-08-29 23:59:22 +02:00
Eva Kissling 8f6b0eb12a ipdbg-la: add "loggs" 2018-08-29 23:59:20 +02:00
Eva Kissling 750303aab8 ipdbg-la: get rid of crash on shutdown 2018-08-29 23:59:17 +02:00
Eva Kissling d37c6daa84 ipdbg-la: reduce warnings (added explicit casts) 2018-08-29 23:59:14 +02:00
Eva Kissling a4210e1890 ipdbg-la: Add changes for IPDBG project 2018-08-29 23:59:10 +02:00
Uwe Hermann 17e0251d84 sr_buildinfo_libs_get(): Also support LIBUSBX_API_VERSION.
This fixes a build issue on some distros / libusb versions.
2018-07-22 18:01:22 +02:00
Uwe Hermann 0875f11de4 Fix multiple C++ bindings warnings with gcc 8.
bindings/cxx/classes.cpp: In function ‘int sigrok::call_log_callback(void*, int, const char*, __va_list_tag*)’:
  bindings/cxx/classes.cpp:242:17: warning: catching polymorphic type ‘class sigrok::Error’ by value [-Wcatch-value=]
    } catch (Error e) {
                   ^
  In file included from bindings/cxx/classes.cpp:1667:
  bindings/cxx/enums.cpp: In static member function ‘static Glib::VariantBase sigrok::ConfigKey::parse_string(std::__cxx11::string, sr_datatype)’:
  bindings/cxx/enums.cpp:789:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
      } catch (invalid_argument) {
               ^~~~~~~~~~~~~~~~
  bindings/cxx/enums.cpp:804:13: warning: catching polymorphic type ‘class std::invalid_argument’ by value [-Wcatch-value=]
      } catch (invalid_argument) {
               ^~~~~~~~~~~~~~~~
2018-07-22 17:08:44 +02:00
Uwe Hermann 19d816c54a input/wav: Fix potential buffer overflow (and compiler warning).
With gcc 8 this yielded:

  src/input/wav.c: In function ‘receive’:
  src/input/wav.c:345:51: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
                                                     ^~
  src/input/wav.c:345:48: note: directive argument in the range [1, 2147483647]
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
                                                  ^~~~~~
  src/input/wav.c:345:5: note: ‘snprintf’ output between 4 and 13 bytes into a destination of size 8
       snprintf(channelname, sizeof(channelname), "CH%d", i + 1);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2018-07-22 16:59:38 +02:00
Uwe Hermann 0f5bba9622 strutil.c: Use gboolean in favor of bool for consistency. 2018-07-22 16:37:58 +02:00
Gerhard Sittig 081aaebfc7 tests: add (negative) "." test case for rational conversion
A naive implementation of the parse rational conversion helper could
have accepted invalid input. Check for the expected conversion failure.
2018-07-22 16:36:15 +02:00
Gerhard Sittig 74d915331a tests: add more cases for text to rational number conversion
Test the ".1" and "1." cases which are assumed to be problematic on
MacOS (or may not have been supported before a recent update). Add more
tests with leading signs as well as whitespace instead of a sign.
2018-07-22 16:36:15 +02:00
Gerhard Sittig d875496366 strutil: insist in some mantissa for parse rational
The previous implementation accepted either empty integer or empty
fractional parts of a floating point number, but also when both parts
were missing ("." input). Insist in at least one of the parts to be
present.
2018-07-22 16:36:15 +02:00
Gerhard Sittig 7f5bfd6130 strutil: accept leading whitespace in parse rational
Programmatic output of floating point numbers might choose to print
spaces instead of an explicit '+' sign, to align the output with the
result of formatting negative numbers yet achieve a screen appearance
similar to what humans would have written. Skip leading whitespace
before insisting in seeing either signs or digits or decimals.
2018-07-22 16:36:15 +02:00
Gerhard Sittig 42408643f9 strutil: handle empty fractional in parse rational
Accept numbers like "123." where the period (dot) is present yet the
fractional part is empty. Adding a period but no additional digits is a
popular method of turning an otherwise integer literal into a float.
Compilers and strtod() routines accept this notation, too, so we have to
expect seeing such input.
2018-07-22 16:36:15 +02:00
Gerhard Sittig dd3202febf strutil: cosmetics, fixup minor style nits 2018-07-22 16:36:15 +02:00
Gerhard Sittig 83a05ca9b3 tests: echo text input when rational conversion fails
The previous implementation only echoed the p/q conversion results _if_
the return code signalled success but the result was unexpected. Although
the errno value for failed conversion attempts (non-zero return codes)
is not too helpful, seeing which text input failed the test is desirable.
2018-07-22 16:36:15 +02:00
Gerhard Sittig ed367d6820 input/vcd: abort VCD import when timestamp counts backwards
The VCD specification requests that timestamps will strictly increase as
one advances through the file. Add another check where the previous
implementation resulted in a tight loop and made the application stall.
Do print an error message and abort file processing in that case.

This fixes bug #1250.
2018-07-22 16:15:26 +02:00
Uwe Hermann e6104296c2 sr_buildinfo_libs_get(): Show LIBUSB_API_VERSION. 2018-07-19 23:56:33 +02:00
Uwe Hermann 9bf093011a configure.ac: Emit a warning if the C++ bindings are not being built. 2018-07-17 22:25:40 +02:00
Uwe Hermann 51bf39a163 strutil: Fix unit test failure (bug #1093).
Patch by Wojciech Lazarski, thanks a lot!
2018-07-17 19:06:05 +02:00
Gerhard Sittig 3387a5d8ee output: simplify trigger marker position calculation (readability)
This amends commit 67b345b981 which fixed the calculation of the
trigger marker's position. Improve readability of the formulae and
adjust comments.
2018-07-15 20:47:08 +02:00
Gerhard Sittig 67b345b981 output: fixup trigger marker position in ascii/bits/hex output modules
Adjust the calculation of the '^' marker's position in T: lines of the
-O ascii/bits/hex output modules such that it matches the sample data
lines' layout. Add comments which discuss the motivation of the marker
position's calculation, which differs among each of those modules.

Strictly speaking -O bits was already correct. But I chose to adjust and
comment the logic such that multiple output modules follow a common
pattern. If performance is an issue, the bits.c change might be worth
reverting.

This commit fixes bug #1238.
2018-07-15 19:40:00 +02:00
Uwe Hermann 769561cbe9 std: Improve prototypes of some functions. 2018-06-26 16:42:43 +02:00
Uwe Hermann 0f523f2b45 rigol-ds: Add initial Agilent MSO7034A support.
Digital channels (and various other features) are not yet supported.
2018-06-22 22:53:11 +02:00
Uwe Hermann 9ad1d49c4c rigol-ds: Improve a log message. 2018-06-22 19:20:44 +02:00
Uwe Hermann c26107b745 siglent-sds: Drop currently unused switch/case. 2018-06-22 18:54:28 +02:00
Uwe Hermann eb354840f0 siglent_sds_channel_start(): Use ternary operator to shorten code. 2018-06-22 18:54:28 +02:00
Uwe Hermann 55bece00aa rigol-ds: Add missing "return SR_ERR". 2018-06-22 10:53:03 +02:00
marchelh e5b41b8d7e siglent-sds: Fixed samplerate and memory depth calculation 2018-06-22 10:51:50 +02:00
marchelh 7e776c70b0 siglent-sds: Fix, USB connection problem partially solved, bug #1130 2018-06-22 10:51:39 +02:00
Uwe Hermann 5e7ac9f9ec udev: Add rule for Rigol DS4000 series devices. 2018-06-22 01:55:15 +02:00
Valentin Ochs 6b04525ba2 rigol-ds: Initial patch for Rigol DS4000 support
This fixes bug #1208.
2018-06-22 01:55:02 +02:00
Valentin Ochs 643c8824a5 rigol-ds: Rename the CHANINFO macro and comment it 2018-06-22 00:47:09 +02:00
Valentin Ochs 6bcc81ac3a rigol-ds: Store trigger sources and their number for each model
Store trigger sources and their number for each model when it is probed
and use that.

This fixes bug #299.
2018-06-22 00:35:44 +02:00
Uwe Hermann 32054b0963 tests: Expand test_analog_unit_to_string unit test. 2018-06-19 18:22:42 +02:00
Uwe Hermann 72cb20ed07 tests: Fix test_analog_unit_to_string unit test.
The loop body was never executed.
2018-06-19 18:22:42 +02:00