]> sigrok.org Git - libserialport.git/log
libserialport.git
4 years agoDoxygen: Fix an issue causing missing #define documentation output.
Uwe Hermann [Sun, 5 Jan 2020 17:17:04 +0000 (18:17 +0100)]
Doxygen: Fix an issue causing missing #define documentation output.

  Searching for documented defines...
  [...]libserialport.h:1624: warning: documentation for unknown define SP_PACKAGE_VERSION_MAJOR found.
  [...]libserialport.h:1627: warning: documentation for unknown define SP_PACKAGE_VERSION_MINOR found.
  [...]libserialport.h:1630: warning: documentation for unknown define SP_PACKAGE_VERSION_MICRO found.
  [...]libserialport.h:1633: warning: documentation for unknown define SP_PACKAGE_VERSION_STRING found.
  [...]libserialport.h:1640: warning: documentation for unknown define SP_LIB_VERSION_CURRENT found.
  [...]libserialport.h:1643: warning: documentation for unknown define SP_LIB_VERSION_REVISION found.
  [...]libserialport.h:1646: warning: documentation for unknown define SP_LIB_VERSION_AGE found.
  [...]libserialport.h:1649: warning: documentation for unknown define SP_LIB_VERSION_STRING found.

4 years agoUpdate Doxyfile for doxygen 1.8.16.
Martin Ling [Sun, 5 Jan 2020 16:17:40 +0000 (16:17 +0000)]
Update Doxyfile for doxygen 1.8.16.

4 years agoRelease examples as public domain.
Martin Ling [Sun, 5 Jan 2020 14:53:09 +0000 (14:53 +0000)]
Release examples as public domain.

4 years agoAdd some additional formatting hints to Doxygen comments.
Martin Ling [Sun, 5 Jan 2020 03:28:58 +0000 (03:28 +0000)]
Add some additional formatting hints to Doxygen comments.

4 years agoIntegrate examples into Doxygen.
Martin Ling [Sun, 5 Jan 2020 03:04:38 +0000 (03:04 +0000)]
Integrate examples into Doxygen.

4 years agoAdd examples directory with two example programs.
Martin Ling [Sun, 5 Jan 2020 02:04:06 +0000 (02:04 +0000)]
Add examples directory with two example programs.

4 years agoandroid: Fix build compatibility with NDK platform 21 and up.
Martin Ling [Sat, 4 Jan 2020 23:00:17 +0000 (23:00 +0000)]
android: Fix build compatibility with NDK platform 21 and up.

In platforms 21 and higher of the NDK, linux/serial.h is available,
which it was not before. This broke the build, because the configure
script would detect the availability of 'struct serial_struct' in that
header and set HAVE_STRUCT_SERIAL_STRUCT, but the #ifndef __ANDROID__
in libserialport_internal.h stopped us actually including the header.

This change fixes things to build with all versions of the NDK, and is
tested with builds for arm from versions 9 to 24.

Version 21 also added availability of tcdrain(), so we also use that
where available, and only use the direct ioctl() method on NDK < 21.

Fixes #1078.

4 years agoDefine _POSIX_C_SOURCE to 199309L to get clock_gettime().
Martin Ling [Sat, 4 Jan 2020 15:39:54 +0000 (15:39 +0000)]
Define _POSIX_C_SOURCE to 199309L to get clock_gettime().

4 years agolinux: Fix compile warning on gcc 6+ for readlink() call.
Martin Ling [Tue, 31 Dec 2019 15:50:55 +0000 (16:50 +0100)]
linux: Fix compile warning on gcc 6+ for readlink() call.

Fixes #1268.

4 years agoUse O_CLOEXEC where available
Christian Seiler [Sun, 15 Oct 2017 17:28:05 +0000 (19:28 +0200)]
Use O_CLOEXEC where available

Ensures that the file descriptor is (by default) not passed to
subprocesses spawned by applications using libserialport.

This fixes bug #1051.

4 years agowindows: Fix a build error.
Uwe Hermann [Sat, 28 Dec 2019 22:39:15 +0000 (23:39 +0100)]
windows: Fix a build error.

  serialport.c: In function 'get_time':
  serialport.c:64:6: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
    if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
        ^
  serialport.c:64:20: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
    if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1)
                      ^
  serialport.c:64:20: note: each undeclared identifier is reported only once for each function it appears in
  serialport.c:65:17: error: 'CLOCK_REALTIME' undeclared (first use in this function)
     clock_gettime(CLOCK_REALTIME, &ts);
                   ^
  serialport.c: At top level:
  serialport.c:60:13: warning: 'get_time' defined but not used [-Wunused-function]
   static void get_time(struct timeval *time)
               ^

4 years agoFall back to CLOCK_REALTIME if CLOCK_MONOTONIC not usable.
Martin Ling [Sun, 23 Sep 2018 17:03:32 +0000 (18:03 +0100)]
Fall back to CLOCK_REALTIME if CLOCK_MONOTONIC not usable.

Sounds like this may be necessary on some older systems.

4 years agoUse mach_absolute_time() on OSX without clock_gettime().
Martin Ling [Sun, 23 Sep 2018 16:43:46 +0000 (17:43 +0100)]
Use mach_absolute_time() on OSX without clock_gettime().

This should fix #759 for OSX versions below 10.12.

4 years agoUse clock_gettime(CLOCK_MONOTONIC) if available.
Martin Ling [Sun, 23 Sep 2018 16:28:11 +0000 (17:28 +0100)]
Use clock_gettime(CLOCK_MONOTONIC) if available.

Should fix #759 except on OSX versions below 10.12, which don't
have clock_gettime.

4 years agoconfigure: Check whether clock_gettime is available.
Martin Ling [Sun, 23 Sep 2018 16:22:20 +0000 (17:22 +0100)]
configure: Check whether clock_gettime is available.

4 years agoMove all gettimeofday() calls into a wrapper function.
Martin Ling [Sun, 23 Sep 2018 16:19:50 +0000 (17:19 +0100)]
Move all gettimeofday() calls into a wrapper function.

4 years agowindows: Use architecture-specific size limit for WriteFile calls.
Martin Ling [Sat, 28 Dec 2019 18:47:06 +0000 (19:47 +0100)]
windows: Use architecture-specific size limit for WriteFile calls.

4 years agowindows: Use an adaptively sized buffer for nonblocking writes.
Martin Ling [Mon, 3 Jul 2017 20:43:38 +0000 (21:43 +0100)]
windows: Use an adaptively sized buffer for nonblocking writes.

4 years agowindows: Await completion of previous write before changing config.
Martin Ling [Mon, 3 Jul 2017 19:56:21 +0000 (20:56 +0100)]
windows: Await completion of previous write before changing config.

4 years agounix: Fix handling of EAGAIN in sp_nonblocking_write().
Martin Ling [Sat, 28 Dec 2019 16:53:11 +0000 (17:53 +0100)]
unix: Fix handling of EAGAIN in sp_nonblocking_write().

4 years agoRandom minor whitespace fixes.
Uwe Hermann [Sat, 28 Dec 2019 18:23:30 +0000 (19:23 +0100)]
Random minor whitespace fixes.

4 years agowindows: Fix incorrect wc_to_utf8() calls.
Uwe Hermann [Sat, 28 Dec 2019 16:08:49 +0000 (17:08 +0100)]
windows: Fix incorrect wc_to_utf8() calls.

This fixes bug #1079.

4 years agowindows: wc_to_utf8(): Fix a WCHAR related issue causing crashes.
Martin Jackson [Sat, 9 Sep 2017 22:37:48 +0000 (00:37 +0200)]
windows: wc_to_utf8(): Fix a WCHAR related issue causing crashes.

In wc_to_utf8() in windows.c, the zero terminator is written to an invalid
array index, which results in 2 bytes being zeroed in a random place in the
stack. This sometimes causes a crash when running sp_list_ports() (depending
on string length and compiler optimisation settings).

sizeof(wc_str) returns the size in bytes, so cannot be used directly as an
index into that array, it should be divided by sizeof(WCHAR). Otherwise the
zero terminator index is approximately twice what it should be.

This fixes bug #1031.

6 years agoREADME: Add link to bug tracker.
Uwe Hermann [Sun, 17 Dec 2017 17:15:56 +0000 (18:15 +0100)]
README: Add link to bug tracker.

6 years agoREADME: Add missing contact info.
Uwe Hermann [Fri, 15 Dec 2017 17:38:11 +0000 (18:38 +0100)]
README: Add missing contact info.

6 years agowindows: Break out helper function for awaiting previous write completion.
Martin Ling [Mon, 3 Jul 2017 19:55:13 +0000 (20:55 +0100)]
windows: Break out helper function for awaiting previous write completion.

6 years agoRemove redundant inclusions of limits.h
Stefan Tauner [Sun, 21 May 2017 21:44:03 +0000 (23:44 +0200)]
Remove redundant inclusions of limits.h

The first one would be included for Windows too which seems to be
an error. The second one is obviously redundant.

6 years agoCanonicalize symlinks in portnames
Stefan Tauner [Sun, 21 May 2017 21:42:06 +0000 (23:42 +0200)]
Canonicalize symlinks in portnames

This allows users to supply symlinks created e.g. by udev rules instead
of the actual device names.

6 years agoFreeBSD: Add missing libusb-2.0 to pkg-config file.
Uwe Hermann [Wed, 13 Sep 2017 13:04:35 +0000 (15:04 +0200)]
FreeBSD: Add missing libusb-2.0 to pkg-config file.

This fixes bug #1033.

7 years agoLinux: fix for alpha where BOTHER is not defined.
Martin Ling [Sun, 19 Mar 2017 12:16:49 +0000 (12:16 +0000)]
Linux: fix for alpha where BOTHER is not defined.

Fixes bug #363.

7 years agoconfigure summary: Show compiler version and flags.
Uwe Hermann [Sun, 5 Mar 2017 16:01:17 +0000 (17:01 +0100)]
configure summary: Show compiler version and flags.

7 years agoconfigure summary: Show whether shared/static build is enabled.
Uwe Hermann [Sun, 5 Mar 2017 15:43:58 +0000 (16:43 +0100)]
configure summary: Show whether shared/static build is enabled.

7 years agoconfigure summary: Slightly change formatting.
Uwe Hermann [Sun, 5 Mar 2017 15:42:37 +0000 (16:42 +0100)]
configure summary: Slightly change formatting.

7 years agouse readdir() instead of the deprecated readir_r()
Aurelien Jacobs [Fri, 14 Oct 2016 21:50:08 +0000 (23:50 +0200)]
use readdir() instead of the deprecated readir_r()

readir() is threadsafe on both linux and freebsd anyway.
The rationale behind the readdir_r() deprecation is in the glibc manual:
https://www.gnu.org/software/libc/manual/html_node/Reading_002fClosing-Directory.html

This fixes the following warning with recent glibc:

linux.c: In function ‘list_ports’:
linux.c:197:2: warning: ‘readdir_r’ is deprecated [-Wdeprecated-declarations]
  while (!readdir_r(dir, &entry, &result) && result) {
  ^~~~~

7 years agolibserialport: Fix Linux files not compiled in with a toolchain for ucLinux
Paul Cercueil [Mon, 29 Aug 2016 13:05:20 +0000 (15:05 +0200)]
libserialport: Fix Linux files not compiled in with a toolchain for ucLinux

Buildroot can create toolchains for the no-MMU flavour of Linux, with a triple
containing 'uclinux' instead of just 'linux'.

Signed-off-by: Paul Cercueil <redacted>
8 years agolinux: freebsd: do check on proper pointer libserialport-unreleased
Wolfram Sang [Fri, 19 Feb 2016 21:25:00 +0000 (22:25 +0100)]
linux: freebsd: do check on proper pointer

We want to check here if we added something to the list, not if the
function argument was valid. Problem spotted by Coverity, CID 50754.

Signed-off-by: Wolfram Sang <redacted>
8 years agoBump libtool version (not package version) to 1:0:1.
Uwe Hermann [Sat, 9 Jan 2016 00:13:45 +0000 (01:13 +0100)]
Bump libtool version (not package version) to 1:0:1.

The last release (0.1.0) had the libtool version (current:revision:age)
set to 0:0:0. Since this release doesn't change/remove any
interfaces (it does *add* new interfaces, though), 'current' and 'age'
are increased and 'revision' is set to 0, resulting in 1:0:1.

http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info

Programs using libserialport don't need to be recompiled or relinked.

8 years agoNEWS: Last updates for the upcoming 0.1.1 release.
Uwe Hermann [Fri, 8 Jan 2016 23:48:39 +0000 (00:48 +0100)]
NEWS: Last updates for the upcoming 0.1.1 release.

8 years agoFix ERROR_SEM_TIMEOUT issue on Windows.
Uwe Hermann [Wed, 27 Jan 2016 07:19:38 +0000 (08:19 +0100)]
Fix ERROR_SEM_TIMEOUT issue on Windows.

The sp_blocking_write() call was incorrectly returning an error upon
ERROR_SEM_TIMEOUT. It now returns 0 instead.

8 years agoFix sp_blocking_read_next() implementation on Windows.
Uwe Hermann [Fri, 22 Jan 2016 14:30:44 +0000 (15:30 +0100)]
Fix sp_blocking_read_next() implementation on Windows.

A ReadFile() call needed to check the actual number of bytes read,
instead of assuming all requested bytes were read.

8 years agowindows: Fix iSerial for composite devices.
Martino Facchin [Wed, 16 Dec 2015 18:07:49 +0000 (19:07 +0100)]
windows: Fix iSerial for composite devices.

USB composite devices can contain an ACM serial interface.
On Windows, the correct iSerial descriptor field is assigned to the parent
(composite) device instead of to the actual serial interface. A bogus
value is returned if the serial interface is asked to provide the S/N.
This patch provides a fallback for this kind of device (tested on Android
with adb + cdc gadgets and on Arduino Zero Programming Port)

8 years agomacosx: Fix port listing on ElCapitan.
Martino Facchin [Fri, 18 Dec 2015 11:40:58 +0000 (12:40 +0100)]
macosx: Fix port listing on ElCapitan.

On OSX 10.11 (ElCapitan) the query for IOProviderClass fails to list ACM
devices as USB.
Add a fallback query using IOClass to correctly recognize these devices.
The fix has no effect on previous OSX versions (tested on Mavericks)

8 years agoChange debug message to "Port not open" when a closed port is used.
Martin Ling [Tue, 29 Dec 2015 02:36:04 +0000 (02:36 +0000)]
Change debug message to "Port not open" when a closed port is used.

Fixes bug #710.

8 years agolibserialport_internal: use new macro to enable timeradd, etc.
Wolfram Sang [Mon, 28 Dec 2015 13:33:40 +0000 (14:33 +0100)]
libserialport_internal: use new macro to enable timeradd, etc.

Since glibc 2.20, the usage of _BSD_SOURCE is deprecated. Fix it like
described here:

https://sourceware.org/glibc/wiki/Release/2.20#Deprecation_of__BSD_SOURCE_and__SVID_SOURCE_feature_macros

This fixes bug #716.

Signed-off-by: Wolfram Sang <redacted>
8 years agowindows: Handle ERROR_IO_PENDING from ReadFile in sp_nonblocking_read().
Martin Ling [Tue, 8 Dec 2015 20:08:49 +0000 (20:08 +0000)]
windows: Handle ERROR_IO_PENDING from ReadFile in sp_nonblocking_read().

This fixes bug #707.

8 years agosp_wait: Avoid overflow of timeout parameter to poll().
Martin Ling [Tue, 13 Oct 2015 14:04:03 +0000 (15:04 +0100)]
sp_wait: Avoid overflow of timeout parameter to poll().

8 years agoBuild: Include config.h first in all source files
Daniel Elstner [Sun, 13 Sep 2015 18:04:31 +0000 (20:04 +0200)]
Build: Include config.h first in all source files

8 years agoBuild: Use GNUMAKEFLAGS and $@
Daniel Elstner [Thu, 10 Sep 2015 20:03:07 +0000 (22:03 +0200)]
Build: Use GNUMAKEFLAGS and $@

8 years agoautogen.sh: Create autostuff/ dir if it does not exist
Daniel Elstner [Thu, 27 Aug 2015 09:46:06 +0000 (11:46 +0200)]
autogen.sh: Create autostuff/ dir if it does not exist

8 years agoconfigure: Enable largefile support on 32-bit systems
Daniel Elstner [Wed, 26 Aug 2015 20:49:40 +0000 (22:49 +0200)]
configure: Enable largefile support on 32-bit systems

8 years agoClean up .gitignore
Daniel Elstner [Wed, 26 Aug 2015 20:01:03 +0000 (22:01 +0200)]
Clean up .gitignore

8 years agoBuild: Clean up configure.ac and Makefile.am
Daniel Elstner [Wed, 26 Aug 2015 19:42:32 +0000 (21:42 +0200)]
Build: Clean up configure.ac and Makefile.am

Among other things, rename some config defines so we can take
advantage of standard Autoconf macros.

8 years agoBuild: Reduce autogen.sh to trivial stub
Daniel Elstner [Wed, 26 Aug 2015 17:46:43 +0000 (19:46 +0200)]
Build: Reduce autogen.sh to trivial stub

Use autoreconf instead of invoking the various Auto tools
separately. Get rid of the Darwin-specific guesswork -- it does
not make sense to handle this at the level of libserialport.

People should set up their ACLOCAL_PATH themselves as appropriate
for their own system; just as they already need to set up various
other paths.

8 years agoUpdate copyright notices.
Martin Ling [Sun, 31 May 2015 12:07:20 +0000 (13:07 +0100)]
Update copyright notices.

8 years agoUpdate AUTHORS file.
Martin Ling [Sun, 31 May 2015 11:32:21 +0000 (12:32 +0100)]
Update AUTHORS file.

8 years agoNEWS: Update for the upcoming 0.1.1 release.
Uwe Hermann [Sat, 30 May 2015 20:04:56 +0000 (22:04 +0200)]
NEWS: Update for the upcoming 0.1.1 release.

8 years agodoc: Provided channel is binary, not necessarily 8-bit.
Martin Ling [Sat, 30 May 2015 20:03:38 +0000 (21:03 +0100)]
doc: Provided channel is binary, not necessarily 8-bit.

8 years agoFix possible use of uninitialised variable in poll() setup.
Martin Ling [Wed, 27 May 2015 10:21:56 +0000 (11:21 +0100)]
Fix possible use of uninitialised variable in poll() setup.

8 years agodoc: Additional introductory text.
Martin Ling [Wed, 27 May 2015 09:53:46 +0000 (10:53 +0100)]
doc: Additional introductory text.

8 years agodoc: Expanded introductory text.
Martin Ling [Sun, 24 May 2015 12:47:38 +0000 (13:47 +0100)]
doc: Expanded introductory text.

8 years agodoc: Additional notes on sp_last_error_{code,message}.
Martin Ling [Sun, 24 May 2015 12:47:09 +0000 (13:47 +0100)]
doc: Additional notes on sp_last_error_{code,message}.

8 years agoHandle the case when /sys/class/tty/ entries are not symlinks.
silverbuddy [Wed, 20 May 2015 12:51:47 +0000 (15:51 +0300)]
Handle the case when /sys/class/tty/ entries are not symlinks.

For example:

$ uname -a
Linux RT-N66U 2.6.22.19 #1 Thu Feb 12 20:33:36 CST 2015 mips GNU/Linux

$ ls -lF /sys/class/tty/
drwxr-xr-x    2 foo  root             0 May 18 18:12 ttyACM0/

$ ls -lF /sys/class/tty/ttyACM0/
-r--r--r--    1 foo  root          4096 May 18 18:12 dev
lrwxrwxrwx    1 foo  root             0 May 18 18:12 device -> ../../../devices/pci0000:00/0000:00:04.1/usb1/1-1/1-1.1/1-1.1:1.0/
lrwxrwxrwx    1 foo  root             0 May 18 18:12 subsystem -> ../../../class/tty/
-rw-r--r--    1 foo  root          4096 May 18 18:12 uevent

8 years agoAdd new sp_blocking_read_next() function.
Martin Ling [Thu, 7 May 2015 09:07:55 +0000 (10:07 +0100)]
Add new sp_blocking_read_next() function.

8 years agowindows: Always check and set ReadTotalTimeoutMultiplier.
Martin Ling [Thu, 7 May 2015 09:06:33 +0000 (10:06 +0100)]
windows: Always check and set ReadTotalTimeoutMultiplier.

This is not currently touched, but will be by the upcoming
sp_blocking_read_next() function.

8 years agoposix: Make sure blocking operations can't time out without trying.
Martin Ling [Thu, 7 May 2015 09:04:11 +0000 (10:04 +0100)]
posix: Make sure blocking operations can't time out without trying.

8 years agoposix: Consistent debug output when blocking operations time out.
Martin Ling [Thu, 7 May 2015 08:41:41 +0000 (09:41 +0100)]
posix: Consistent debug output when blocking operations time out.

8 years agoposix: Move FD_ZERO() and FD_SET() calls outside loops.
Martin Ling [Thu, 7 May 2015 08:41:02 +0000 (09:41 +0100)]
posix: Move FD_ZERO() and FD_SET() calls outside loops.

8 years agowindows: Always check return value of GetOverlappedResult().
Martin Ling [Thu, 7 May 2015 08:19:47 +0000 (09:19 +0100)]
windows: Always check return value of GetOverlappedResult().

8 years agowindows: Restructure if/else blocks with unnecessary indentation.
Martin Ling [Wed, 6 May 2015 23:09:49 +0000 (00:09 +0100)]
windows: Restructure if/else blocks with unnecessary indentation.

8 years agowindows: restart_wait_if_needed(): Inline receive buffer check.
Martin Ling [Wed, 6 May 2015 19:18:37 +0000 (20:18 +0100)]
windows: restart_wait_if_needed(): Inline receive buffer check.

This removes all the debug spam arising from calling sp_input_waiting().

8 years agowindows: restart_wait_if_needed(): Skip buffer check if no bytes read.
Martin Ling [Wed, 6 May 2015 19:15:46 +0000 (20:15 +0100)]
windows: restart_wait_if_needed(): Skip buffer check if no bytes read.

8 years agowindows: Refactor duplicated code into a static function.
Martin Ling [Wed, 6 May 2015 19:11:17 +0000 (20:11 +0100)]
windows: Refactor duplicated code into a static function.

8 years agowindows: Avoid unnecessary calls to SetCommTimeouts().
Martin Ling [Wed, 6 May 2015 15:40:41 +0000 (16:40 +0100)]
windows: Avoid unnecessary calls to SetCommTimeouts().

This fixes bug #586.

8 years agowindows: Strip CR/LF from end of system error messages.
Martin Ling [Wed, 6 May 2015 15:12:27 +0000 (16:12 +0100)]
windows: Strip CR/LF from end of system error messages.

This fixes bug #585.

9 years agodoc: correct structure name in sp_get_port_handle() documentation.
Martin Ling [Thu, 23 Apr 2015 21:23:14 +0000 (22:23 +0100)]
doc: correct structure name in sp_get_port_handle() documentation.

9 years agolibserialport.h.in: Fix/update some API docs.
Uwe Hermann [Sat, 2 May 2015 19:20:30 +0000 (21:20 +0200)]
libserialport.h.in: Fix/update some API docs.

9 years agosp_list_ports(): Actually set list_ptr NULL as documented.
Uwe Hermann [Sat, 2 May 2015 19:18:36 +0000 (21:18 +0200)]
sp_list_ports(): Actually set list_ptr NULL as documented.

9 years agoFix a potential segfault in sp_get_config_*().
Uwe Hermann [Sat, 2 May 2015 19:10:21 +0000 (21:10 +0200)]
Fix a potential segfault in sp_get_config_*().

9 years agoFix a potential segfault in sp_get_port_handle().
Uwe Hermann [Thu, 30 Apr 2015 20:38:58 +0000 (22:38 +0200)]
Fix a potential segfault in sp_get_port_handle().

9 years agowindows.c: Constify a few function parameters.
Uwe Hermann [Sun, 19 Apr 2015 17:33:22 +0000 (19:33 +0200)]
windows.c: Constify a few function parameters.

9 years agosp_get_port_usb_vid_pid(): Document that usb_vid/usb_pid can be NULL.
Uwe Hermann [Sun, 19 Apr 2015 17:18:05 +0000 (19:18 +0200)]
sp_get_port_usb_vid_pid(): Document that usb_vid/usb_pid can be NULL.

9 years agoRename timeout to timeout_ms for clarity in a few places.
Uwe Hermann [Sun, 19 Apr 2015 16:53:26 +0000 (18:53 +0200)]
Rename timeout to timeout_ms for clarity in a few places.

9 years agoautotools: Don't set/override "user variables".
Uwe Hermann [Sun, 19 Apr 2015 16:36:58 +0000 (18:36 +0200)]
autotools: Don't set/override "user variables".

This fixes bug #577.

9 years agoMakefile.am: Simplify LDFLAGS handling a bit.
Uwe Hermann [Sun, 19 Apr 2015 16:33:47 +0000 (18:33 +0200)]
Makefile.am: Simplify LDFLAGS handling a bit.

9 years agoConstify the sp_get_port_description() parameter.
Uwe Hermann [Sun, 19 Apr 2015 17:00:52 +0000 (19:00 +0200)]
Constify the sp_get_port_description() parameter.

9 years agoConstify the sp_get_port_transport() parameter.
Uwe Hermann [Sun, 19 Apr 2015 16:28:10 +0000 (18:28 +0200)]
Constify the sp_get_port_transport() parameter.

9 years agoconfigure.ac: Drop no longer needed SP_PKGLIBS.
Uwe Hermann [Sun, 19 Apr 2015 16:21:19 +0000 (18:21 +0200)]
configure.ac: Drop no longer needed SP_PKGLIBS.

9 years agoVarious Doxygen comment updates and fixes.
Uwe Hermann [Sat, 18 Apr 2015 21:48:29 +0000 (23:48 +0200)]
Various Doxygen comment updates and fixes.

 - Add some missing @param lines.

 - Add [in], [out], or [in,out] markers for @param tags.

 - Add explicit "Must not be NULL" comments for parameters where
   the caller should not pass in a NULL.

9 years agolibserialport.h.in: Drop unneeded <windows.h> #include.
Uwe Hermann [Wed, 15 Apr 2015 23:05:04 +0000 (01:05 +0200)]
libserialport.h.in: Drop unneeded <windows.h> #include.

This is not needed and would pollute the namespace of every
libserialport user on Windows.

9 years agolibserialport.h.in: Add @since tags for new enums.
Uwe Hermann [Wed, 15 Apr 2015 22:53:50 +0000 (00:53 +0200)]
libserialport.h.in: Add @since tags for new enums.

9 years agoSet package version to 0.1.1, use "@since 0.1.1" Doxygen tags.
Uwe Hermann [Wed, 15 Apr 2015 22:47:21 +0000 (00:47 +0200)]
Set package version to 0.1.1, use "@since 0.1.1" Doxygen tags.

The next release will not contain any backwards-incompatible
API or ABI changes, thus changing the package version to 0.1.1.

9 years agowindows: Drop no longer needed -luuid.
Uwe Hermann [Wed, 15 Apr 2015 22:40:49 +0000 (00:40 +0200)]
windows: Drop no longer needed -luuid.

Also, use SP_LIBS in Makefile.am.

This is build-tested using a native MinGW-w64 based toolchain
as well as a MinGW-w64 based cross-compile setup.

9 years agoconfigure.ac: Minor whitespace cosmetics.
Uwe Hermann [Wed, 15 Apr 2015 19:40:32 +0000 (21:40 +0200)]
configure.ac: Minor whitespace cosmetics.

9 years agoDoxyfile: Update to Doxygen 1.8.8 template.
Uwe Hermann [Wed, 15 Apr 2015 19:20:18 +0000 (21:20 +0200)]
Doxyfile: Update to Doxygen 1.8.8 template.

(by running 'doxygen -u')

9 years agoconfigure.ac: Add #include guard to config.h.
Uwe Hermann [Wed, 15 Apr 2015 19:15:04 +0000 (21:15 +0200)]
configure.ac: Add #include guard to config.h.

9 years agoFix a compiler warning when -Wshadow is used.
Uwe Hermann [Sat, 11 Apr 2015 19:03:53 +0000 (21:03 +0200)]
Fix a compiler warning when -Wshadow is used.

    CC       serialport.lo
  In file included from ../serialport.c:25:0:
  ../serialport.c: In function 'get_config':
  ../libserialport_internal.h:227:25: warning: declaration of 'ret' shadows a previous local [-Wshadow]
   #define TRY(x) do { int ret = x; if (ret != SP_OK) RETURN_CODEVAL(ret); } while (0)
                           ^
  ../serialport.c:1566:3: note: in expansion of macro 'TRY'
     TRY(get_baudrate(port->fd, &config->baudrate));
     ^
  ../serialport.c:1543:6: warning: shadowed declaration is here [-Wshadow]
    int ret = get_flow(port->fd, data);
        ^

Also, add -Wshadow to the list of default compiler options.

9 years agoautogen.sh: Drop obsolete MinGW/MSYS items.
Uwe Hermann [Mon, 6 Apr 2015 22:04:43 +0000 (00:04 +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.

9 years agoREADME: Refer to MSYS2 only.
Uwe Hermann [Mon, 6 Apr 2015 18:25:42 +0000 (20:25 +0200)]
README: Refer to MSYS2 only.

The "old" MSYS related to the "old" and unsupported MinGW (from
mingw.org) may or may not work properly, so only refer to MSYS2 which
we currently recommend and which has been tested.

9 years agoMinor Doxygen improvements and fixes.
Uwe Hermann [Mon, 6 Apr 2015 16:51:17 +0000 (18:51 +0200)]
Minor Doxygen improvements and fixes.

9 years agoconfigure.ac: Use $host_os instead of $target_os.
Uwe Hermann [Sat, 4 Apr 2015 16:10:18 +0000 (18:10 +0200)]
configure.ac: Use $host_os instead of $target_os.

$build and $build_os refer to the machine on which the software is
built, $host and $host_os refer to the machine for which the software
is (cross-)built.

The variables $target and $target_os (despite the confusing names)
are only relevant in the context of building cross-compilers.