1
0
mirror of git://sigrok.org/libserialport synced 2023-08-10 21:13:24 +03:00
Commit Graph

351 Commits

Author SHA1 Message Date
Martino Facchin
02c8a1424d 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)
2016-01-06 13:54:17 +00:00
Martino Facchin
aacba60dca 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)
2016-01-06 13:54:11 +00:00
Martin Ling
8062087ab3 Change debug message to "Port not open" when a closed port is used.
Fixes bug #710.
2015-12-29 13:30:30 +01:00
Wolfram Sang
4d8195fe3f 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 <wsa@the-dreams.de>
2015-12-29 01:16:28 +01:00
Martin Ling
ae2c5825e7 windows: Handle ERROR_IO_PENDING from ReadFile in sp_nonblocking_read().
This fixes bug #707.
2015-12-09 12:43:11 +01:00
Martin Ling
127d8d0ce7 sp_wait: Avoid overflow of timeout parameter to poll(). 2015-10-13 15:04:03 +01:00
Daniel Elstner
1a584c45b0 Build: Include config.h first in all source files 2015-09-13 20:04:31 +02:00
Daniel Elstner
962143bc5c Build: Use GNUMAKEFLAGS and $@ 2015-09-10 22:19:15 +02:00
Daniel Elstner
c37c9f348d autogen.sh: Create autostuff/ dir if it does not exist 2015-08-27 11:46:06 +02:00
Daniel Elstner
07f61c7131 configure: Enable largefile support on 32-bit systems 2015-08-26 22:49:40 +02:00
Daniel Elstner
87f4a6f021 Clean up .gitignore 2015-08-26 22:01:03 +02:00
Daniel Elstner
f1c916ede1 Build: Clean up configure.ac and Makefile.am
Among other things, rename some config defines so we can take
advantage of standard Autoconf macros.
2015-08-26 21:55:10 +02:00
Daniel Elstner
ef08a6d52b 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.
2015-08-26 19:46:43 +02:00
Martin Ling
f77bb46df5 Update copyright notices. 2015-05-31 18:26:53 +02:00
Martin Ling
d931da1042 Update AUTHORS file. 2015-05-31 18:26:53 +02:00
Uwe Hermann
e2b7ba1214 NEWS: Update for the upcoming 0.1.1 release. 2015-05-30 22:11:46 +02:00
Martin Ling
56fe6e3207 doc: Provided channel is binary, not necessarily 8-bit. 2015-05-30 21:03:38 +01:00
Martin Ling
6b8eee0682 Fix possible use of uninitialised variable in poll() setup. 2015-05-30 21:38:03 +02:00
Martin Ling
49fd7b1bc2 doc: Additional introductory text. 2015-05-30 21:38:03 +02:00
Martin Ling
deef6e528c doc: Expanded introductory text. 2015-05-27 11:19:27 +02:00
Martin Ling
ec4b55ae25 doc: Additional notes on sp_last_error_{code,message}. 2015-05-27 11:09:26 +02:00
silverbuddy
46d8b0a039 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
2015-05-27 11:09:26 +02:00
Martin Ling
e5c2630eee Add new sp_blocking_read_next() function. 2015-05-27 11:09:26 +02:00
Martin Ling
0188a545c7 windows: Always check and set ReadTotalTimeoutMultiplier.
This is not currently touched, but will be by the upcoming
sp_blocking_read_next() function.
2015-05-27 11:09:25 +02:00
Martin Ling
76222ee578 posix: Make sure blocking operations can't time out without trying. 2015-05-27 11:09:25 +02:00
Martin Ling
c3cee38c3b posix: Consistent debug output when blocking operations time out. 2015-05-27 11:09:25 +02:00
Martin Ling
772c586133 posix: Move FD_ZERO() and FD_SET() calls outside loops. 2015-05-27 11:09:25 +02:00
Martin Ling
27911925c1 windows: Always check return value of GetOverlappedResult(). 2015-05-27 11:09:25 +02:00
Martin Ling
bbe566fe1c windows: Restructure if/else blocks with unnecessary indentation. 2015-05-27 11:09:25 +02:00
Martin Ling
8ebfaf8966 windows: restart_wait_if_needed(): Inline receive buffer check.
This removes all the debug spam arising from calling sp_input_waiting().
2015-05-27 11:09:25 +02:00
Martin Ling
21ae5ce197 windows: restart_wait_if_needed(): Skip buffer check if no bytes read. 2015-05-27 11:09:25 +02:00
Martin Ling
94a314a806 windows: Refactor duplicated code into a static function. 2015-05-27 11:09:25 +02:00
Martin Ling
27a58c0521 windows: Avoid unnecessary calls to SetCommTimeouts().
This fixes bug #586.
2015-05-27 11:09:13 +02:00
Martin Ling
9a0c4bbdbe windows: Strip CR/LF from end of system error messages.
This fixes bug #585.
2015-05-27 11:08:30 +02:00
Martin Ling
480d750c59 doc: correct structure name in sp_get_port_handle() documentation. 2015-05-06 16:33:13 +01:00
Uwe Hermann
ff6da776e8 libserialport.h.in: Fix/update some API docs. 2015-05-06 17:06:06 +02:00
Uwe Hermann
6392641545 sp_list_ports(): Actually set list_ptr NULL as documented. 2015-05-06 17:06:06 +02:00
Uwe Hermann
6aad5bdd47 Fix a potential segfault in sp_get_config_*(). 2015-05-06 17:06:06 +02:00
Uwe Hermann
5f64c28551 Fix a potential segfault in sp_get_port_handle(). 2015-05-06 17:06:05 +02:00
Uwe Hermann
eb50b1aca6 windows.c: Constify a few function parameters. 2015-04-19 19:50:56 +02:00
Uwe Hermann
9eb9f07130 sp_get_port_usb_vid_pid(): Document that usb_vid/usb_pid can be NULL. 2015-04-19 19:18:05 +02:00
Uwe Hermann
1b91c6eadb Rename timeout to timeout_ms for clarity in a few places. 2015-04-19 19:01:08 +02:00
Uwe Hermann
025c264448 autotools: Don't set/override "user variables".
This fixes bug #577.
2015-04-19 19:01:08 +02:00
Uwe Hermann
a630a469f6 Makefile.am: Simplify LDFLAGS handling a bit. 2015-04-19 19:01:08 +02:00
Uwe Hermann
f14809393a Constify the sp_get_port_description() parameter. 2015-04-19 19:01:08 +02:00
Uwe Hermann
ad036cc8ef Constify the sp_get_port_transport() parameter. 2015-04-19 18:28:10 +02:00
Uwe Hermann
3dd4a2ae39 configure.ac: Drop no longer needed SP_PKGLIBS. 2015-04-19 18:21:19 +02:00
Uwe Hermann
35578b063e 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.
2015-04-19 18:16:01 +02:00
Uwe Hermann
e4f44cf5f2 libserialport.h.in: Drop unneeded <windows.h> #include.
This is not needed and would pollute the namespace of every
libserialport user on Windows.
2015-04-19 18:15:29 +02:00
Uwe Hermann
13efecf888 libserialport.h.in: Add @since tags for new enums. 2015-04-19 18:14:48 +02:00