Commit Graph

62 Commits

Author SHA1 Message Date
Uwe Hermann ffedd0bf5d sr/cli/gtk: s/capability/hwcap/. 2012-02-18 00:17:18 +01:00
Uwe Hermann 1d9a8a5fe1 sr/cli/gtk: A few more s/instance/inst/. 2012-02-17 23:55:27 +01:00
Uwe Hermann bb7ef79377 sr/cli/gtk/qt: s/device/dev/ in many places.
Also, a few s/instance/inst/ occurences.
2012-02-17 23:47:00 +01:00
Uwe Hermann d68e2d1a21 sr: Some more s/device_instance/dev_inst/. 2012-02-17 22:40:51 +01:00
Uwe Hermann 44dae53925 sr: Random cosmetics, fix/amend Doxygen comments. 2012-02-17 22:40:51 +01:00
Bert Vermeulen 93a04e3be9 sr: rename all sr_hwplugin(s)_* functions to sr_hw_* 2012-02-15 03:18:48 +01:00
Bert Vermeulen da1466d677 sr: rename more functions to sr_thing_action format
Also improved the interface to find capabilities in a hardware plugin.
2012-02-14 00:23:51 +01:00
Bert Vermeulen d3683c42e7 sr: rename all sr_device_instance_* functions to sr_dev_inst_* 2012-02-13 22:45:49 +01:00
Bert Vermeulen c532476aa7 sr: rename hwplugin functions to sr_thing_action format 2012-02-13 19:56:24 +01:00
Bert Vermeulen c73d2ea421 sr: adjust copyright year 2012-02-13 14:31:51 +01:00
Bert Vermeulen 031685005b sr: rename all sr_device_* functions to sr_dev_* 2012-02-13 14:00:47 +01:00
Bert Vermeulen a1645fcd81 sr: more API cleanup and documentation 2012-02-13 03:36:32 +01:00
Bert Vermeulen bb08ee2e53 sr: public/private API cleanup in hwplugin 2012-02-12 23:57:43 +01:00
Uwe Hermann 133a37bfba Use g_try_malloc/g_free/g_strdup consistently.
Avoid plain malloc()/free() in sr/srd, especially in the API calls.
Also avoid g_malloc*() in favor of g_try_malloc*().

Use g_strdup() instead of strdup() so that we can use g_free()
consistently everywhere.

Exceptions: Stuff that is allocated via other libs (not using glib),
should also be properly free'd using the respective free-ing function
(instead of g_free()). Examples: Stuff allocated by libusb, libftdi, etc.

Also, use sr_err() instead of sr_warn() for actual errors. sr_warn() is
meant for non-fatal/uncritical warnings.
2012-02-11 22:34:16 +01:00
Uwe Hermann ca070ed9a0 sr: Make more symbols private via static/SR_PRIV.
Additional zeroplus fixes:

 - Remove unneeded function prototypes from .h files.

 - Remove unused variables and/or use standard libusb #defines instead.

 - Remove unused GL_* error code #defines.
2012-02-02 21:46:10 +01:00
Uwe Hermann 1a081ca67d sr: Mark API functions with SR_API/SR_PRIV.
Use SR_API to mark public API symbols, and SR_PRIV for private symbols.

Variables and functions marked 'static' are private already and don't
need SR_PRIV. However, functions which are not static (because they need
to be used in other libsigrok-internal files) but are also not meant to
be part of the public libsigrok API, must use SR_PRIV.

This uses the 'visibility' feature of gcc (requires gcc >= 4.0).

Details: http://gcc.gnu.org/wiki/Visibility
2012-02-02 00:03:17 +01:00
Uwe Hermann 69890f7399 sr: Eliminate usb/serial instances from API.
The API should be generic and only provide sr_device_instance_new() and
friends, but not sr_usb_device_instance_new(), sr_serial_device_instance_new(),
or others for other device types we may have in the future. The
frontends shouldn't have to know or care about this implementation detail.

This also fixes the problem that parts of sigrok.h contained
'#ifdef HAVE_LIBUSB_1_0' and such, which is even less desirable for the API.

The usb/serial instance specifics are now private, and each driver that
needs them keeps a pointer in its driver-specific context.
2012-01-31 02:04:35 +01:00
Uwe Hermann 66410a8617 sr: g_free()/g_string_free() can handle NULL input. 2012-01-19 00:32:02 +01:00
Uwe Hermann 8f81fe8728 sr: s/g_message/sr_dbg/.
libsigrok should only use sr_*() for debug output.
2012-01-10 22:16:41 +01:00
Uwe Hermann c37d2b1ba1 probe names: Fix cosmetics, add docs, fix off-by-one. 2011-12-29 19:50:14 +01:00
Kristoffer Sjöberg 464d12c72a Move the probe naming to the creator of the device, and let each driver name its own probes. 2011-12-29 17:04:31 +01:00
Uwe Hermann b7f09cf86d libsigrok: Fix #includes.
In the lib, we should only #include "sigrok.h" or "sigrok-internal.h",
but not the (possibly installed and thus different/older versions) via
<sigrok.h> or <sigrok-internal.h>.

Frontends should of course use <sigrok.h> and <sigrok-internal.h>.
2011-12-28 23:07:08 +01:00
Uwe Hermann a0ecd83bc6 Make more variables/functions static and non-global.
The 'GSList *devices' from device.c was actually really global (i.e.,
listed in sigrok.h), which is now fixed.
2011-12-28 22:55:21 +01:00
Uwe Hermann cb93f8a927 Other method to avoid "unused var" compiler warnings.
The '(void)varname' method is nicer than 'varname = varname' and also
prevents warnings when compiling sigrok with clang instead of gcc.
2011-11-24 22:57:48 +01:00
Gareth McMullin 4d436e71ba Changed SR_T_NULL to SR_T_BOOL and adjusted RLE option. 2011-11-19 13:41:41 +13:00
Gareth McMullin 3a4d09c0de Run-Length Encoding support for the OLS. 2011-10-30 01:56:54 +02:00
Bert Vermeulen 8722c31e26 better cleanup of device/plugin resources 2011-06-05 01:51:49 +02:00
Uwe Hermann b08024a836 libsigrok: Introduce sr_dbg/sr_info/sr_warn/sr_err.
We should use these (internal) functions in libsigrok exclusively from
now on, i.e. no more use of glib's g_debug() etc.

These functions are only for libsigrok, the frontends use whatever
logging mechanism is suitable there.
2011-04-14 10:11:08 +02:00
Uwe Hermann f4314d7e06 Add initial support for the ChronoVu LA8. 2011-04-04 19:40:30 +02:00
Bert Vermeulen 4fe9a6da79 OLS driver overhaul
support for metadata in recent versions of the FPGA code
moved constants and structs out to separate header file
got rid of all device instance-specific globals
2011-04-03 06:18:05 +02:00
Uwe Hermann a887e3da97 Add sr_ prefix to receive_data_callback typedef.
Also, drop obsolete add_source() prototype from sigrok-cli.h.
2011-02-20 21:16:24 +01:00
Uwe Hermann ee4b6342af Add sr_ prefix to list_hwplugins(). 2011-02-20 21:16:22 +01:00
Uwe Hermann 6f1be0a2d4 Add sr_ prefix to session_{add,remove}. 2011-02-20 21:16:22 +01:00
Uwe Hermann a65de0309b Add sr_ prefix for hwcap structs/functions. 2011-02-20 21:16:19 +01:00
Uwe Hermann 8a2efef2d5 Add sr_ prefix to session related API functions. 2011-02-08 22:28:00 +01:00
Uwe Hermann 22b0238344 Fix build when no libusb-LA is compiled.
Until now the build would break if the user doesn't enable at least one
of the libusb1.0-based LAs. I.e., you could not compile only OLS, or
only the demo driver.
2011-02-02 10:25:52 +01:00
Uwe Hermann 5a2326a71b SR_ prefix for all public enums. 2011-01-30 18:32:59 +01:00
Uwe Hermann 6c29007211 Prefixes for *_device_instance. 2011-01-30 18:32:59 +01:00
Uwe Hermann 5c2d46d1db Prefix device structs with sr_. 2011-01-30 18:32:58 +01:00
Uwe Hermann d32d961d17 get_sr_device_instance() -> sr_get_device_instance(). 2011-01-30 18:32:56 +01:00
Uwe Hermann a00ba01228 Change all sigrok_ prefixes to sr_. 2011-01-30 18:32:55 +01:00
Uwe Hermann e46b8fb154 Change SIGROK_ prefix to SR_. 2011-01-30 18:32:53 +01:00
Bert Vermeulen 544a458212 move session main loop stuff into libsigrok (session_run) 2011-01-30 17:12:54 +01:00
Daniel Ribeiro 6ed4f04437 initial version of alsa plugin.
It does NOT work yet.
2011-01-22 00:57:27 -02:00
Uwe Hermann bffed4fc10 Re-enable stuff we temporarily disabled for 0.1. 2011-01-20 00:43:57 +01:00
Uwe Hermann 07c81bfad1 Disable Link Instruments MSO-19 for 0.1. 2011-01-19 23:55:03 +01:00
Uwe Hermann 484760d1a8 Cosmetics. 2011-01-15 15:57:54 +01:00
Bert Vermeulen 925dbf9f97 add new HWCAP patternmode 2011-01-15 05:11:40 +01:00
Uwe Hermann 17e1afcb81 Whitespace and consistency fixes.
Also, drop a <poll.h> #include. It's unused anyway, and breaks the build
on MinGW/Windows as there is no poll.h there.
2011-01-13 23:52:25 +01:00
Uwe Hermann a61b0e6a35 configure: Add --enable-demo option. 2011-01-11 22:17:33 +01:00