Matthias Behr
57f72772a9
Add EINTR handling to SerialImpl::write ( #233 )
...
EINTR can still happen on write. Don't throw the exception in that
case but retry.
In case of other errors add more details to the SerialException.
2021-06-10 15:13:58 -07:00
Atomie CHEN
a93fc844d9
Solve issue Custom Baudrate OSX #139 of original repo; inspired by PySerial source code and #57 of github.com/npat-efault/picocom, we need to set custom baudrate after calling tcsetattr; tested on macOS Mojave 10.14.4 ( #218 )
2021-06-10 14:57:40 -07:00
Mike Purvis
d3713af096
Support 500kbps serial ports. ( #167 )
2018-01-09 07:22:43 -08:00
rhd
827c4a784d
Fix issue with write() and a timeout of 0. ( #137 )
...
* Fix issue with write() and a timeout of 0.
* fix up style
2017-01-20 17:34:49 -08:00
aleksey-sergey
02dfff7883
fixing unix timeouts handling ("timer_tests.short_interval" failure) ( #147 )
2016-11-28 17:38:53 -08:00
aleksey-sergey
4d69fb2e41
fix timeouts handling on Unix systems ( #142 )
...
fixed "singed long" overflow that took place on attempt
to use ~3000ms or bigger timeouts on Unix systems
2016-11-28 14:06:00 -08:00
Patrick O'Leary
c5b4bbd181
on OS X, use SYSTEM_CLOCK, not CALENDAR_CLOCK
...
Analogously to using `CLOCK_MONOTONIC` on Linux to time events in favor of `CLOCK_REALTIME`, `SYSTEM_CLOCK` should be used in favor of `CALENDAR_CLOCK` on OS X.
Ref: http://stackoverflow.com/questions/11680461/monotonic-clock-on-osx
2015-11-10 17:28:45 -06:00
Patrick O'Leary
98f1c31e81
on Linux, use CLOCK_MONOTONIC for clock_gettime()
...
On Linux systems which are being driven by an external time source (NTP or PTP), it is possible that time appears to slew in reverse under `CLOCK_REALTIME`. Since the timer function is used to time durations of events (calls to `select()`), it is better to use `CLOCK_MONOTONIC`, which isn't subject to slewing.
2015-11-10 09:40:30 -06:00
Alexander Bulychev
e26a977173
fix for clang build on macosx
2015-04-06 16:53:33 +03:00
Tomaz Solc
dda5b6308e
Add 576000 baud support for Unix
2015-01-06 15:15:31 +01:00
William Woodall
8036553a1e
improve error message when mark or space parity are not supported
2014-12-09 13:50:24 -08:00
David Hodo
6f464948f0
Make MARK/SPACE partiy support optional
2014-12-09 14:50:37 -06:00
achronop
b376f85fb0
Add MARK/SPACE parity bit option
2014-12-07 21:33:53 +02:00
Christopher Baker
3f0d49a602
Make sure AvailabilityMacros.h is included for build systems that do not include it by default.
...
- Required for macros such as MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_MIN_REQUIRED, etc.
2014-07-21 12:29:38 -05:00
William Woodall
051824894b
style fixup
2014-07-02 15:01:53 -07:00
Konstantina Kastanara
04d4763926
Added return value control in Serial::SerialImpl::close () in unix.cc and win.cc
2014-05-07 18:49:37 +03:00
Mike Purvis
d74c74bf15
Fill out waitByteTimes, integrate it into read as discussed in ticket #37
2013-11-19 12:27:56 -05:00
Mike Purvis
28025034bd
Add waitReadable and waitByteTimes stubs.
2013-11-19 12:27:56 -05:00
Mike Purvis
a9bf8d804d
Pre-fill buffer at start of read, to avoid the select if unnecessary.
2013-11-18 11:26:04 -05:00
Mike Purvis
c3855adbb0
Wrap nanoseconds when >= 1e9, rather than > 1e9.
2013-11-14 22:02:07 -05:00
Mike Purvis
fbffc18dd7
Fix for computing an expiry without rollover.
2013-11-08 10:03:27 -05:00
Mike Purvis
2e5e8f940b
Divide by 1e9 to get seconds from nanoseconds, instead of 1e6.
2013-10-31 21:48:44 -04:00
William Woodall
cfac5bbcc9
use static casts rather than C-style casting
...
C-style casting can result in undesired reinterpret_casts
So we should avoid them, see:
http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used
2013-10-31 19:44:34 -04:00
Mike Purvis
3f2ed36849
Of course, the timespec_from_ms function must return its result.
2013-10-31 19:43:49 -04:00
Mike Purvis
5820056aef
Remove TimerExpiredException.
2013-10-31 19:43:49 -04:00
Mike Purvis
589e7b9a3b
Eliminate modulus operator.
2013-10-31 19:43:49 -04:00
Mike Purvis
d8a1ef4ecf
Rename now function to timespec_now and timeout_time to expiry, for greater clarity.
2013-10-31 19:43:49 -04:00
Mike Purvis
6747711632
Implement MillisecondTimer in the unix read() and write() functions.
2013-10-31 19:43:49 -04:00
Mike Purvis
16a024691b
Add MillisecondTimer class.
2013-10-31 19:43:49 -04:00
William Woodall
e8f913b4a4
Contributor notice
2013-10-30 11:53:06 -07:00
William Woodall
092836d78f
[style] whitespace changes only
2013-10-30 11:42:35 -07:00
Christopher Baker
0e5f7fa317
Fix broken ioctl calls, add exception handling.
2013-10-27 18:50:06 -05:00
Christopher Baker
9d04c09f10
Code guards for platform-specific implementations.
...
(when not using cmake / catkin)
2013-10-27 18:49:07 -05:00
William Woodall
3db36faa14
Update how custom baudrates are handled on OS X
...
This is taken from the example serial program
on Apple's developer website, see:
http://free-pascal-general.1045716.n5.nabble.com/Non-standard-baud-rates-in-OS-X-IOSSIOSPEED-IOCTL-td4699923.html
2013-07-31 16:54:15 -07:00
William Woodall
516a5c7e82
Fixed another Exception misspelling.
2013-06-11 17:05:24 -07:00
William Woodall
308be5b337
Merge pull request #25 from wjwwood/fix_exceptions
...
fix, by Thomas Hoppe <thomas.hoppe@cesys.com>
2013-06-11 14:40:18 -07:00
William Woodall
060634bf91
Potential timing fix for read and write.
...
Fixes #27
2013-05-22 21:45:20 -07:00
William Woodall
2b4bafbfd2
fix, by Thomas Hoppe <thomas.hoppe@cesys.com>
...
For SerialException's:
- The name was misspelled…
- Use std::string's for error messages to prevent corruption of messages on some platforms
2013-05-08 13:52:28 -07:00
William Woodall
667eedeb2f
Adding baudrates: 1000000, 11520000, 2000000, 2500000, 3000000, 3500000, and 4000000 to the unix.cc implementation. This is an attempting to work around issue #18 , needs testing on a non-USB serial adapter that can handle higher baudrates.
2012-07-08 19:45:35 -05:00
William Woodall
83ae470c78
Silly little bug in the custom baud rate code. Should fix #18 .
2012-06-18 19:04:35 -05:00
William Woodall
da1207609f
Fixing a bug in the unix write code which may have prevented it from writing in some cases, and updating some of the comments and error messages in the write function that still read like the read function
2012-06-14 18:51:24 -05:00
William Woodall
2ae490b3ac
Fixes to flowcontrol that solve a wierd bug on Linux and fix an oversight on Windows.
2012-06-12 16:55:11 -05:00
William Woodall
95790064d8
Fixing warning in Linux
2012-06-12 00:25:28 -05:00
William Woodall
493883da81
Fixing some warnings from compiling on Linux
2012-06-07 18:16:20 -05:00
William Woodall
520ccb54f4
Merge branch 'new_api' of github.com:wjwwood/serial into new_api
...
Conflicts:
.gitignore
2012-06-06 18:58:51 -05:00
William Woodall
6fac95d633
Adding initial windows support.
2012-06-06 18:56:44 -05:00
William Woodall
dcc73db6a8
Syntax fix
2012-05-11 15:28:23 -05:00
William Woodall
15f01a53a1
Adjustments to the read timeouts
2012-05-10 11:43:17 -05:00
William Woodall
937e834698
Updating the unix implementation to support the more sophisticated timeout system.
2012-05-09 19:51:56 -05:00
William Woodall
194169e5e6
More updates to the documentation and new api after comments from john and michael.
2012-05-02 21:49:09 -05:00