Commit Graph

82 Commits

Author SHA1 Message Date
Joel Holdsworth 915f7cc87a sr: Made hwcap const 2012-05-31 19:51:09 +01:00
Bert Vermeulen 79afc8cac4 sr: add voltage parser and prettyprinter 2012-05-30 23:56:12 +02:00
Bert Vermeulen 76f4c61086 sr: add period parser 2012-05-30 23:56:12 +02:00
Uwe Hermann 787c43905d sr: Add functions to query sr version(s). 2012-04-15 20:33:45 +02:00
Uwe Hermann 01c3e9dbd5 sr: s/_clear/_remove_all/ for consistency. 2012-03-31 11:33:43 +02:00
Uwe Hermann 054e670906 sr: out: Use uint8_t (not char) for buffers. 2012-03-31 11:33:43 +02:00
Uwe Hermann 8ec95d2282 sr/srd: Small fixes, constifications, doc updates. 2012-03-21 23:20:09 +01:00
Uwe Hermann b5118d6c01 sr/srd: s/handler/callback/.
We should consistently use the same name for the same thing.
2012-03-04 15:10:10 +01:00
Uwe Hermann 1f9813eb6c sr: Name all callback data 'cb_data'. 2012-03-02 02:25:42 +01:00
Uwe Hermann d08490aaba sr/srd: Consistency fixes for callbacks.
- Callback function pointer typedefs end with _t.

 - Variables holding callback functions are named 'cb' everywhere.
2012-03-01 23:49:25 +01:00
Uwe Hermann cfe064d8e7 sr/cli/gtk/qt: s/hw/driver/ in some places. 2012-03-01 23:49:25 +01:00
Uwe Hermann 2f8cf27409 sr: s/sr_dev_probe_name/sr_dev_probe_name_set/. 2012-03-01 23:49:24 +01:00
Uwe Hermann c09f0b578c sr/cli/gtk/qt/: s/plugin/driver/. 2012-02-28 23:52:30 +01:00
Uwe Hermann 050e9219d6 sr: No need for dynamic hardware driver registration.
We don't need or allow run-time registration of hardware
drivers/plugins, they're added at compile-time.
2012-02-23 00:28:20 +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
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 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 996b0c7234 sr: clean up public/private split in headers 2012-02-13 02:13:51 +01:00
Bert Vermeulen bb08ee2e53 sr: public/private API cleanup in hwplugin 2012-02-12 23:57:43 +01:00
Bert Vermeulen 6cfa474a80 sr: rm unused sr_device_clear() and sr_device_probe_clear() 2012-02-12 22:36:19 +01:00
Uwe Hermann 0ae67ff784 sr: Implement proper logging framework.
This is pretty much identical to the current libsigrokdecode API/framework.
2012-02-10 09:30:40 +01:00
Uwe Hermann 0f8522bf74 Project-wide consistent naming for #include guards.
Document the naming scheme in HACKING.
2012-02-05 15:05:13 +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
Anatoly Sokolov fd9836bfab Add sr_device_get_info 2012-01-30 13:56:38 +01:00
Uwe Hermann e0508e6799 sr: session: Make most functions return int.
This allows us to return error codes etc.

Add a little more error handling.
2012-01-07 17:11:50 +01:00
Uwe Hermann 3b7c8f54fc sr: Drop some obsolete and commented out code. 2012-01-02 14:25:52 +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 155d1012f1 sigrok-proto.h: Drop obsolete prototype, move other one. 2011-12-28 21:37:37 +01:00
Uwe Hermann 08d4cc1d14 device: Make some parameters const. 2011-12-28 21:34:37 +01:00
Uwe Hermann 0e3b143994 device: Change some functions to return int.
The callers of these functions are yet to be changed so that they
actually check the return values and handle errors appropriately.
2011-12-28 17:26:19 +01:00
Uwe Hermann 15278f3e9c datastore.c: Improve error handling and docs.
- Add Doxygen comments for all functions (some TODOs remain).

 - Check for invalid input parameters (such as NULL pointers etc).

 - Return SR_ERR_ARG upon invalid input parameters.

 - Make sr_datastore_put() return int instead of void, so we can pass
   an error code (SR_OK, SR_ERR_MALLOC, and so on) to the caller.
2011-12-26 21:26:02 +01:00
Uwe Hermann 488a13b110 Improve sr_filter_probes error handling and docs.
- Much more elaborate doxygen comments for the function and its
   parameters, allowed input values, and so on.

 - Make 'probelist' const, the function doesn't modify it.

 - Check for invalid inputs such as NULL pointers.

 - Use g_try_malloc() and g_free() for the output buffer. Document who
   is expected to g_free() the buffer.
2011-12-22 14:16:07 +01:00
Bert Vermeulen f64c14141b fix CLI size string specification
accept "hz" as optional qualifier but nothing else
properly return an error instead of quietly returning zero size
2011-11-27 19:33:07 +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
Bert Vermeulen 60eb1eb582 fix parameter type 2011-06-19 00:55:36 +02:00
Bert Vermeulen 8722c31e26 better cleanup of device/plugin resources 2011-06-05 01:51:49 +02:00
Uwe Hermann 1352eeddd4 libsigrok/cli: Implement loglevel support.
libsigrok can now be told at which loglevel to work, i.e., how many
debug/error/warning output to generate. You can also query the current
loglevel.

In sigrok-cli it is now possible to set the loglevel via -l. For example:

 - Disable all output: sigrok-cli -l 0
 - Only show errors: sigrok-cli -l 1
 - Show errors, warnings, info, and debug messages: sigrok-cli -l 4
2011-05-05 13:06:13 +02:00
Uwe Hermann 8bb416becf Kill unused functions (avoid namespace pollution). 2011-03-03 20:24:25 +01:00
Uwe Hermann cd009d5561 sr_exit(): Return int to be able to report errors. 2011-03-03 20:24:24 +01:00
Uwe Hermann 809c5f2011 Add sr_ prefix for analog stuff some structs. 2011-02-20 21:16:24 +01: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 13b0573369 Add sr_ prefix to datafeed_callback typedef. 2011-02-20 21:16:23 +01:00
Uwe Hermann e5551f657d Drop obsolete source_callback_*(). 2011-02-20 21:16:23 +01:00
Uwe Hermann c25d2039de Add sr_ prefix to filter_probes(). 2011-02-20 21:16:23 +01:00
Uwe Hermann 8225e92175 Constify a few more 'char *' parameters. 2011-02-20 21:16:23 +01:00