]> sigrok.org Git - libserialport.git/log
libserialport.git
11 years agoWindows nonblocking write: 1 byte at a time to know when buffer fills.
Martin Ling [Mon, 25 Nov 2013 15:21:19 +0000 (15:21 +0000)]
Windows nonblocking write: 1 byte at a time to know when buffer fills.

11 years agoImplement non-blocking I/O on Windows.
Martin Ling [Mon, 25 Nov 2013 11:47:19 +0000 (11:47 +0000)]
Implement non-blocking I/O on Windows.

11 years agoFix SET_FAIL macro.
Martin Ling [Mon, 25 Nov 2013 11:34:42 +0000 (11:34 +0000)]
Fix SET_FAIL macro.

11 years agoHandle -EAGAIN in non-blocking reads on Unix, and return 0 from sp_read().
Martin Ling [Mon, 25 Nov 2013 10:23:13 +0000 (10:23 +0000)]
Handle -EAGAIN in non-blocking reads on Unix, and return 0 from sp_read().

11 years agoFix bug in debug message generation in sp_flush().
Martin Ling [Sat, 23 Nov 2013 21:21:18 +0000 (21:21 +0000)]
Fix bug in debug message generation in sp_flush().

11 years agoInitialise structure in sp_new_config().
Martin Ling [Sat, 23 Nov 2013 20:55:18 +0000 (20:55 +0000)]
Initialise structure in sp_new_config().

11 years agoAdd generator program for configuration accessor headers.
Martin Ling [Sat, 23 Nov 2013 20:45:09 +0000 (20:45 +0000)]
Add generator program for configuration accessor headers.

11 years agoMake configuration structure opaque.
Martin Ling [Sat, 23 Nov 2013 20:41:01 +0000 (20:41 +0000)]
Make configuration structure opaque.

11 years agoClarify documentation.
Martin Ling [Sat, 23 Nov 2013 18:23:45 +0000 (18:23 +0000)]
Clarify documentation.

11 years agoAdd sp_get_port_handle() function.
Martin Ling [Sat, 23 Nov 2013 17:50:45 +0000 (17:50 +0000)]
Add sp_get_port_handle() function.

11 years agoMake port structure opaque.
Martin Ling [Sat, 23 Nov 2013 17:11:19 +0000 (17:11 +0000)]
Make port structure opaque.

11 years agoAdd back previously deleted sp_get_config function.
Martin Ling [Sat, 23 Nov 2013 12:04:21 +0000 (12:04 +0000)]
Add back previously deleted sp_get_config function.

11 years agoFix swapped DCD & RI signals on Windows.
Martin Ling [Sat, 23 Nov 2013 11:59:42 +0000 (11:59 +0000)]
Fix swapped DCD & RI signals on Windows.

11 years agoReturn SP_ERR_SUPP from sp_list_ports() on unsupported platforms.
Martin Ling [Sat, 23 Nov 2013 11:57:17 +0000 (11:57 +0000)]
Return SP_ERR_SUPP from sp_list_ports() on unsupported platforms.

11 years agoGenerate debug output when returning using TRY() macro.
Martin Ling [Sat, 23 Nov 2013 11:49:35 +0000 (11:49 +0000)]
Generate debug output when returning using TRY() macro.

11 years agoAdditional argument checking.
Martin Ling [Sat, 23 Nov 2013 11:39:59 +0000 (11:39 +0000)]
Additional argument checking.

11 years agoAdd additional debug messages.
Martin Ling [Sat, 23 Nov 2013 01:08:57 +0000 (01:08 +0000)]
Add additional debug messages.

11 years agoAdd debug output for all entry and exit points.
Martin Ling [Sat, 23 Nov 2013 00:26:44 +0000 (00:26 +0000)]
Add debug output for all entry and exit points.

11 years agoAdd debug macros.
Martin Ling [Fri, 22 Nov 2013 22:44:19 +0000 (22:44 +0000)]
Add debug macros.

11 years agoAdd API for and default handler for debug messages.
Martin Ling [Fri, 22 Nov 2013 22:41:03 +0000 (22:41 +0000)]
Add API for and default handler for debug messages.

11 years agoserialport.c: Add missing linux_termios.h #include.
Uwe Hermann [Fri, 22 Nov 2013 21:37:15 +0000 (22:37 +0100)]
serialport.c: Add missing linux_termios.h #include.

This is safe to include (at the moment) on all non-win32 OSes, since it
doesn't contain anything OS-specific.

11 years agoRemove dupliate/redundant return value documentation.
Martin Ling [Fri, 22 Nov 2013 20:27:39 +0000 (20:27 +0000)]
Remove dupliate/redundant return value documentation.

11 years agoUse new SP_ERR_SUPP error to indicate unsupported operations.
Martin Ling [Fri, 22 Nov 2013 20:12:39 +0000 (20:12 +0000)]
Use new SP_ERR_SUPP error to indicate unsupported operations.

11 years agoMakefile.am: Add missing linux_termios.h.
Uwe Hermann [Fri, 22 Nov 2013 19:13:17 +0000 (20:13 +0100)]
Makefile.am: Add missing linux_termios.h.

If the file is not listed in SOURCES, it won't end up in the tarball.

Thanks to Dan HorĂ¡k for the report.

11 years agoCheck for termiox support at runtime.
Martin Ling [Fri, 22 Nov 2013 19:00:24 +0000 (19:00 +0000)]
Check for termiox support at runtime.

11 years agoFix memory leaks.
Martin Ling [Fri, 22 Nov 2013 18:43:41 +0000 (18:43 +0000)]
Fix memory leaks.

11 years agoUse common 3-digit package version number.
Uwe Hermann [Fri, 22 Nov 2013 15:18:46 +0000 (16:18 +0100)]
Use common 3-digit package version number.

11 years agoTemporarily disable USE_TERMIOX code (breaks the lib).
Uwe Hermann [Fri, 22 Nov 2013 15:07:32 +0000 (16:07 +0100)]
Temporarily disable USE_TERMIOX code (breaks the lib).

On some systems the use of the code enabled by USE_TERMIOX leads to a
non-working sp_open() which breaks all functionality provided by the lib.

Thus, temporarily disable that code until the details are investigated.

This has been tested with a serial port DMM and the OLS logic analyzer
on an x86 64bit Linux system with kernel version 3.11. The code compiles
fine but doesn't work at runtime. The configure output included:

checking for struct termios2... yes
checking for struct termiox... yes

The root cause for the problem is that the ioctl(fd, TCGETX, data) call in
get_flow() returns -1 ("Invalid argument"), which in turn lets sp_open()
return SP_ERR_FAIL.

11 years agoMinor cosmetics.
Uwe Hermann [Fri, 22 Nov 2013 14:53:34 +0000 (15:53 +0100)]
Minor cosmetics.

11 years agoAdd missing #include guards.
Uwe Hermann [Fri, 22 Nov 2013 10:59:12 +0000 (11:59 +0100)]
Add missing #include guards.

11 years agoFix the build on non-Linux platforms.
Uwe Hermann [Fri, 22 Nov 2013 10:56:40 +0000 (11:56 +0100)]
Fix the build on non-Linux platforms.

11 years agoIgnore linux_termios leftovers.
Bert Vermeulen [Fri, 22 Nov 2013 01:23:17 +0000 (02:23 +0100)]
Ignore linux_termios leftovers.

11 years agoFix to sp_flush() on Unix.
Martin Ling [Thu, 21 Nov 2013 17:22:16 +0000 (17:22 +0000)]
Fix to sp_flush() on Unix.

11 years agoAdd missing @param port entries to documentation.
Martin Ling [Wed, 20 Nov 2013 19:11:39 +0000 (19:11 +0000)]
Add missing @param port entries to documentation.

11 years agoAdd sp_get_signals() function.
Martin Ling [Wed, 20 Nov 2013 18:56:35 +0000 (18:56 +0000)]
Add sp_get_signals() function.

11 years agoAdd sp_start_break() and sp_end_break() functions.
Martin Ling [Wed, 20 Nov 2013 18:11:17 +0000 (18:11 +0000)]
Add sp_start_break() and sp_end_break() functions.

11 years agoAdd sp_drain() function.
Martin Ling [Wed, 20 Nov 2013 17:30:50 +0000 (17:30 +0000)]
Add sp_drain() function.

11 years agoAdd missing @param port entry to documentation.
Martin Ling [Wed, 20 Nov 2013 19:13:12 +0000 (19:13 +0000)]
Add missing @param port entry to documentation.

11 years agoMake sp_flush take an option for what to flush.
Martin Ling [Wed, 20 Nov 2013 17:22:50 +0000 (17:22 +0000)]
Make sp_flush take an option for what to flush.

11 years agoUse a more logical set of SP_MODE_* flags.
Martin Ling [Wed, 20 Nov 2013 15:54:10 +0000 (15:54 +0000)]
Use a more logical set of SP_MODE_* flags.

11 years agoDefine SP_PARITY_* more logically.
Martin Ling [Wed, 20 Nov 2013 19:56:11 +0000 (19:56 +0000)]
Define SP_PARITY_* more logically.

11 years agoDocument this madness.
Martin Ling [Thu, 21 Nov 2013 11:52:54 +0000 (11:52 +0000)]
Document this madness.

11 years agoSupport non-standard flow control modes on Linux.
Martin Ling [Thu, 21 Nov 2013 11:52:41 +0000 (11:52 +0000)]
Support non-standard flow control modes on Linux.

11 years agoSupport custom baudrates on Linux.
Martin Ling [Thu, 21 Nov 2013 00:35:51 +0000 (00:35 +0000)]
Support custom baudrates on Linux.

11 years agoAdded support for non-standard baud rates for Apple.
Matthias Heidbrink [Wed, 20 Nov 2013 13:21:07 +0000 (14:21 +0100)]
Added support for non-standard baud rates for Apple.

11 years agoRetrieve XON/XOFF setting on Unix.
Martin Ling [Tue, 19 Nov 2013 20:46:52 +0000 (20:46 +0000)]
Retrieve XON/XOFF setting on Unix.

11 years agoDoxygen cosmetics.
Uwe Hermann [Tue, 19 Nov 2013 18:55:02 +0000 (19:55 +0100)]
Doxygen cosmetics.

11 years agoConsistently use the "@" notation for Doxygen tags.
Uwe Hermann [Tue, 19 Nov 2013 18:37:03 +0000 (19:37 +0100)]
Consistently use the "@" notation for Doxygen tags.

11 years agoCosmetics, whitespace, consistency fixes.
Uwe Hermann [Tue, 19 Nov 2013 18:31:23 +0000 (19:31 +0100)]
Cosmetics, whitespace, consistency fixes.

11 years agoget_config(): Add a quickfix for xon_xoff.
Uwe Hermann [Tue, 19 Nov 2013 18:20:50 +0000 (19:20 +0100)]
get_config(): Add a quickfix for xon_xoff.

The config->xon_xoff variable is not filled correctly with data read
from the current serial port config. Without this, the value of the
variable will be bogus and some code that depends on the variable will fail.

Note: This is just a temporary quickfix, not a proper final solution.

11 years ago.gitignore: Add libserialport.h.
Uwe Hermann [Tue, 19 Nov 2013 16:58:48 +0000 (17:58 +0100)]
.gitignore: Add libserialport.h.

11 years agoset_config(): Add missing CS5 handling.
Uwe Hermann [Tue, 19 Nov 2013 11:32:01 +0000 (12:32 +0100)]
set_config(): Add missing CS5 handling.

11 years agoFix minor Doxygen warning.
Uwe Hermann [Tue, 19 Nov 2013 11:30:55 +0000 (12:30 +0100)]
Fix minor Doxygen warning.

11 years agoClarify usage of -1 in configuration API.
Martin Ling [Tue, 19 Nov 2013 03:14:09 +0000 (03:14 +0000)]
Clarify usage of -1 in configuration API.

11 years agoGroup functions for documentation.
Martin Ling [Tue, 19 Nov 2013 03:02:45 +0000 (03:02 +0000)]
Group functions for documentation.

11 years agoUse named enums instead of ints for clearer documentation.
Martin Ling [Tue, 19 Nov 2013 02:36:22 +0000 (02:36 +0000)]
Use named enums instead of ints for clearer documentation.

11 years agoAdd doxygen documentation.
Martin Ling [Tue, 19 Nov 2013 02:11:34 +0000 (02:11 +0000)]
Add doxygen documentation.

11 years agoMark config argument to sp_set_config as const.
Martin Ling [Mon, 18 Nov 2013 22:07:09 +0000 (22:07 +0000)]
Mark config argument to sp_set_config as const.

11 years agoAdditional argument checking for config functions.
Martin Ling [Mon, 18 Nov 2013 20:08:25 +0000 (20:08 +0000)]
Additional argument checking for config functions.

11 years agoRemove sp_ prefix from private port data structure.
Martin Ling [Mon, 18 Nov 2013 20:04:54 +0000 (20:04 +0000)]
Remove sp_ prefix from private port data structure.

11 years agoTidy up static functions.
Martin Ling [Mon, 18 Nov 2013 20:02:30 +0000 (20:02 +0000)]
Tidy up static functions.

11 years agoMake sure OS handles are set correctly for unopened / closed ports.
Martin Ling [Mon, 18 Nov 2013 20:00:15 +0000 (20:00 +0000)]
Make sure OS handles are set correctly for unopened / closed ports.

11 years agoGet Xon/Xoff status on Windows.
Martin Ling [Mon, 18 Nov 2013 19:55:43 +0000 (19:55 +0000)]
Get Xon/Xoff status on Windows.

11 years agoRefactor port configuration code.
Martin Ling [Mon, 18 Nov 2013 19:52:37 +0000 (19:52 +0000)]
Refactor port configuration code.

11 years agoAdd sp_get_config() function.
Martin Ling [Sat, 16 Nov 2013 20:55:53 +0000 (20:55 +0000)]
Add sp_get_config() function.

11 years agoUpdate documentation.
Martin Ling [Fri, 15 Nov 2013 00:20:01 +0000 (00:20 +0000)]
Update documentation.

11 years agoRemove disused flowcontrol field from sp_port_config.
Martin Ling [Fri, 15 Nov 2013 00:12:50 +0000 (00:12 +0000)]
Remove disused flowcontrol field from sp_port_config.

11 years agoEliminate lengthy switch/case blocks for baudrates.
Martin Ling [Thu, 14 Nov 2013 23:24:51 +0000 (23:24 +0000)]
Eliminate lengthy switch/case blocks for baudrates.

11 years agoAdd sp_set_flowcontrol helper function.
Martin Ling [Thu, 14 Nov 2013 22:43:03 +0000 (22:43 +0000)]
Add sp_set_flowcontrol helper function.

11 years agoStore control bits in sp_port_data on Unix.
Martin Ling [Thu, 14 Nov 2013 22:27:51 +0000 (22:27 +0000)]
Store control bits in sp_port_data on Unix.

11 years agoSplit up prototypes in include file for clarity.
Martin Ling [Thu, 14 Nov 2013 22:05:22 +0000 (22:05 +0000)]
Split up prototypes in include file for clarity.

11 years agoAdd functions for setting individual port parameters.
Martin Ling [Thu, 14 Nov 2013 22:01:11 +0000 (22:01 +0000)]
Add functions for setting individual port parameters.

11 years agoApply sane termios settings at port open time.
Martin Ling [Thu, 14 Nov 2013 21:43:07 +0000 (21:43 +0000)]
Apply sane termios settings at port open time.

11 years agoAdd prototypes for config helper functions.
Martin Ling [Thu, 14 Nov 2013 21:39:56 +0000 (21:39 +0000)]
Add prototypes for config helper functions.

11 years agoRetrieve current control line settings in start_config.
Martin Ling [Thu, 14 Nov 2013 21:27:06 +0000 (21:27 +0000)]
Retrieve current control line settings in start_config.

11 years agoNew API for serial control lines.
Martin Ling [Thu, 14 Nov 2013 21:12:17 +0000 (21:12 +0000)]
New API for serial control lines.

11 years agoMove cfset{i,o}speed() calls to set_baudrate().
Martin Ling [Thu, 14 Nov 2013 20:30:26 +0000 (20:30 +0000)]
Move cfset{i,o}speed() calls to set_baudrate().

11 years agoUse negative values in sp_port_config to retain existing settings.
Martin Ling [Thu, 14 Nov 2013 19:45:42 +0000 (19:45 +0000)]
Use negative values in sp_port_config to retain existing settings.

11 years agoReplace sp_set_params with sp_set_config, which takes a struct.
Martin Ling [Thu, 14 Nov 2013 18:41:28 +0000 (18:41 +0000)]
Replace sp_set_params with sp_set_config, which takes a struct.

11 years agoUse new project URL.
Uwe Hermann [Fri, 15 Nov 2013 10:36:14 +0000 (11:36 +0100)]
Use new project URL.

11 years agopkg-config file: Use Requires.private to fix static build.
Uwe Hermann [Thu, 14 Nov 2013 21:09:14 +0000 (22:09 +0100)]
pkg-config file: Use Requires.private to fix static build.

Any libs needed when building static binaries must be listed in the
'Requires.private' field of the installed pkg-config file libserialport.pc.

Currently, this is libudev (but only when building on/for Linux).

11 years agolibserialport.h: Add package/lib version macros.
Uwe Hermann [Thu, 14 Nov 2013 21:16:11 +0000 (22:16 +0100)]
libserialport.h: Add package/lib version macros.

These can be used by frontends e.g. for conditional compilation, or
simply for printing, logging to debug output, and so on.

11 years agoconfigure.ac: Drop unneeded AC_MSG_ERROR.
Uwe Hermann [Thu, 14 Nov 2013 21:01:08 +0000 (22:01 +0100)]
configure.ac: Drop unneeded AC_MSG_ERROR.

The default behaviour of PKG_CHECK_MODULES is to abort with an error
anyway, but it will also print a more usable error message and hints
for the user about how to use PKG_CONFIG_PATH and so on.

11 years agolibserialport: Allow C++ frontends to use the lib easily.
Uwe Hermann [Thu, 14 Nov 2013 20:58:03 +0000 (21:58 +0100)]
libserialport: Allow C++ frontends to use the lib easily.

11 years agoMinor cosmetics, typos, and so on.
Uwe Hermann [Thu, 14 Nov 2013 16:33:53 +0000 (17:33 +0100)]
Minor cosmetics, typos, and so on.

11 years agoDivide sp_set_params into separate helper functions.
Martin Ling [Thu, 14 Nov 2013 13:09:52 +0000 (13:09 +0000)]
Divide sp_set_params into separate helper functions.

11 years agoInclude <stdio.h> on Windows for sprintf, used in sp_open.
Martin Ling [Mon, 4 Nov 2013 14:08:03 +0000 (14:08 +0000)]
Include <stdio.h> on Windows for sprintf, used in sp_open.

11 years agoSupport 6-bit data on Unix.
Martin Ling [Mon, 4 Nov 2013 14:02:51 +0000 (14:02 +0000)]
Support 6-bit data on Unix.

11 years agoSet data bits on Windows.
Martin Ling [Mon, 4 Nov 2013 14:02:41 +0000 (14:02 +0000)]
Set data bits on Windows.

11 years agoAdd sp_copy_port() function.
Martin Ling [Mon, 4 Nov 2013 13:42:55 +0000 (13:42 +0000)]
Add sp_copy_port() function.

11 years agoOn Windows, prefix port names with '\\.\' to work with ports above COM9.
Martin Ling [Mon, 4 Nov 2013 13:08:09 +0000 (13:08 +0000)]
On Windows, prefix port names with '\\.\' to work with ports above COM9.

11 years agoRename header to libserialport.h.
Martin Ling [Mon, 4 Nov 2013 12:53:12 +0000 (12:53 +0000)]
Rename header to libserialport.h.

11 years agoFix enumeration on Windows.
Martin Ling [Mon, 4 Nov 2013 02:16:21 +0000 (02:16 +0000)]
Fix enumeration on Windows.

11 years agoFix enumeration on OS X.
Martin Ling [Mon, 4 Nov 2013 00:00:05 +0000 (00:00 +0000)]
Fix enumeration on OS X.

11 years agoUpdate documentation.
Martin Ling [Sun, 3 Nov 2013 23:12:03 +0000 (23:12 +0000)]
Update documentation.

11 years agoRemove outdated inline documentation, README is now authoritative.
Martin Ling [Sun, 3 Nov 2013 22:40:39 +0000 (22:40 +0000)]
Remove outdated inline documentation, README is now authoritative.

11 years agoClarify return values of sp_get_port_by_name() and sp_list_ports().
Martin Ling [Sun, 3 Nov 2013 22:38:50 +0000 (22:38 +0000)]
Clarify return values of sp_get_port_by_name() and sp_list_ports().

11 years agoClarify documentation for sp_read() and sp_write().
Martin Ling [Sun, 3 Nov 2013 22:34:17 +0000 (22:34 +0000)]
Clarify documentation for sp_read() and sp_write().

11 years agoUpdate documentation.
Martin Ling [Sun, 3 Nov 2013 22:30:46 +0000 (22:30 +0000)]
Update documentation.

11 years agoAdd sp_free_port() function.
Martin Ling [Sun, 3 Nov 2013 22:27:59 +0000 (22:27 +0000)]
Add sp_free_port() function.