Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 293 lines (176 sloc) 10.078 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293
Version 0.0.21

* Reverted the overzealous checking for successful tcsetattr

Version 0.0.20

* Fixed a bug that caused setting of control lines (CTS,RTS etc) to throw an exception with JNA 4.0.0 on Mac OS X

* Reverted the use of CancelIoEx as it is not available on Windows XP

* Re-worked and simplified file handle closing logic in Windows to prevent hangups and work around the lack of CancelIoEx

* Added tests to the test suite for successful closing of ports
 

Version 0.0.19

* Changed to the use of CancelIoEx for canceling all I/O in close() to prevent
  hanging when I/O is in progress in an other thread.
  
* Ignore all errors when trying to clear pending wait in select()

  Thanks for Colin Leitner for contributing following!

* Handle free form device paths correctly, by returning a
  CommPortIdentifier for any existing device path, even if opening that
  port fails
 
* Changed access to test port name to use getPortName

* Added check for port ownership and fixed test case to handle a
  non-enumerated test port gracefully

* Added TwoPortSerialTest for tests that can't be run without two
independent serial ports

* Increased maximum timeout value to 1100, which was necessary to reliably
run this test on a windows machine

* Added check for valid device path in CommPortIdentifier getPortIdentifier(String portName)

* Removed port detection feature from the TestBase. It's been preventing a
  proper test setup
  
* Let the test suite return an exit value of 1 on failure
  Version 0.0.18

* Fixed problems in the Windows backend that rendered it dysfunctional

* Ignore TIOCMGET fail on port open to be compatible Linux virtual ports

* Lots of source code clean up by Colin Leitner, thanks.

* Added support for mark and space parity.

* Added support for 1.5 stop bits
  No hardware actually supports it but now you don't get an exception


Version 0.0.17

* Ignore error for TIOCGSERIAL/TIOCSSERIAL when setting standard
baudrates
* Improved port enumeration on Linux

* Fixed sendBreak "timeout value is negative" error

* Fixed WinAPI.SetCommBreak mistakenly called CloseHandle on Windows

* Fixed random "port not locked" caused by problem in JTermiosImpl.lock()

* Fixed WaitCommEvent returns an 87: bad parameter, error code on Windows


Version 0.0.16

* Just bumped the version number because what was supposed to
be release 0.0.15 actually reported version number 0.0.15.rc2.
No code changes.

Version 0.0.15

* Improved the Windows back end ie fixed bugs revealed by the
changes in the front end that were done to improve Linux
performance.

Version 0.0.14 *** EXPERIMENTAL ***

* More re-factoring to improve read performance and code

* Fixes to numerous corner cases to conform to specification

* Added getNativeFileDescriptor() to allow mixing and matching JTermios
raw calls with PureJavaComm functionality. Caveat emptor!
* In raw read mode (purejavacomm.rawreadmode == true) the maximum
allowed enableReceiveThreshold(value) is 255. An attempt to set
a too large value will result in UnsupportedCommOperationException.
* The maximum enableReceiveTimeout(value) is now 255000 msec
ie 25.5 seconds. An attempt to set a too large value will
result in UnsupportedCommOperationException.


Version 0.0.13 *** EXPERIMENTAL ***

* Removed some debugging output from SerialPort.close() that
was left there by mistake
* Added a new property that disables the internal use of
a pipe to get nudge select()/poll() out of coma. The
pipe uses two extra file descriptors so in a huge
system this maybe a critical resource. To disable
the use of the pipe set 'purejavacomm.usenudgepipe' to 'false'

Version 0.0.12 *** EXPERIMENTAL ***

* This version includes a major re-factoring of receive timeout and
threshold handling to improve performance on low end platforms
like RaspberryPI and to improve conformance to the JavaComm spec.
This version has had limited testing so it may unintentionally
break existing applications, proceed with caution. This
version has not been tested on Windows for the lack
of suitable setup.

* New faster DirectMapping for poll() in Linux backend

* Linux backend now defaults to poll() instead of select()
to default to better performance. This can be overridden
by setting the system property 'purejavacomm.usepoll' to 'false'.

* Re-factored receive timeout and threshold handling that
exploits the platform native VMIN and VTIME to reduce
CPU loading
* Added property named 'purejavacomm.rawreadmode' that further
reduces overhead in InputStream.read(...) with the
risk of indefinite blocking on reads without timeout.

* Improved event handling to not to poll at all if control
line notifications are not requested, to improve performance
on low end platforms. Currently this feature is not available
on the Windows backend, where it is typically not needed.

* A blocking read() can now be interrupted by close()
* A blocking read() with timeout can no longer block indefinitely
even if the serial line is indefinitely idle

* Added equals() and hashCode() methods to CommPortIdentfier
to fix ownership mechanism
* PureJavaSeriaPort.getInputStream()/getOutputStream() now
return same stream instances if called multiple times.
* Number of potential multithreading issues fixed


Version 0.0.11

* Moved over to JNA DiretMapping in Linux back end to squeeze
out better performance on low end Linux system like
RaspberryPI
* Added property named 'purejavacomm.pollperiod' to allow tuning of
polling period for port control lines. Default is 10 (msec)
if the property is not set, this is compatible with previous
practice and RXTX.

* Changed property name 'purejavacomm.use_poll' to 'purejavacomm.usepoll'
for consistency. Old name is supported but deprecated.

* Added pipe() to JTermios API, not implemented on Windows

* Fixed getReceiveThreshold() and isReceiveThresholdEnabled() to
return correct values
* Fixed a bug that caused read(...) to block if the requested
number of bytes was less that the set receive threshold value

* Re-ordered logging initialization so that setting the log level/mask in
code always works and overrides any properties regardless of when/where
the setting is set in code.

* Fixed a logging format typo in Linux/poll code path

* Removed flushing of the serial port while opening it as this is not
required by JavaComm spec, RXTX does not do it, and it may loose
data if the device starts send something as soon as the port is open.
* Fixed PureJavaSerialPort to set FLOWCONTROL_NONE in hardware when opening the port
(previously the hardware was untouched which was confusing because it looked like
the default was no flow control.)
* Fixed checkReturnCode() to return the correct class/line where the error code was checked


Version 0.0.10

* Fixed a missing field in getFieldOrder() for Linux

Version 0.0.9

* Added support for JNA 3.5.0 which require getFieldOrder() for all Struct derived classes

* Changed Linux backend to ignore EINVAL error in ioctl/TIOCGSERIAL/TIOCSSERIAL calls
as all USB CDC ACM ack USB/Serial Dongles don't support it
  

Version 0.0.8

- Mostly thanks to Alexander Salgado

* Added support for internally switching to poll() instead of select()

- poll is useful if the operating system uses file descriptors that overflow 'fd_set'
- to use poll() set system property purejavacomm.use_poll = true
- only available for Linux at the moment, for other platforms
   purejavacomm.use_poll is ignored

* Fixed poll() in jtermios.linux.JTermiosImpl.java

- poll() can now be used instead of select() , which has the benefit of
  marginally less overhead and support file descriptors that overdflow
  what select() can handle, rare but useful if it happens
  
* Fixed a few wrong constants in jtermios.linux.JTermiosImpl.java

- constant for baudrate 1200 was wrong (resulted in 600)
- some error codes were wrong (probably had no effect)


Version 0.0.7

* On Linux ignore failure of TIOCGSERIAL in when trying to use standard baudrates

- not every serial port driver supports TIOCGSERIAL, so when we set standard baudrate
  we try to turn of custom divisor using TIOCGSERIAL, but if it fails we just ignore it
  
- related to above logging for JTermiosImpl.setspeed() was improved to help debugging


Version 0.0.6

* Added support for FreeBSD

- thanks to the persistent efforts of Denver Hull

* Fixed a synchronization issue with control line state change detection

- this bug often caused failure in Test1.java

* Moved baudrate setting to each individual backend to support non standard baudrates

- setting of non standard baudrates is very specific to OS and thus best
  handled separately for each platform

* Changed the way baudrate setting is handled in Mac OS X

- the code now first tries the standard (POSIX) way of setting the baudate
  and if that fails then it tries the Mac OS X specific ioctl IOSSIOSPEED
  
* Change port enumeration matching to use a regular expression.

- each backend defines its own rules for matching port names during enumeration,
  see implementation of each jtermios.JTermios.JTermiosInterface.getPortNamePattern().
  
- for each backend the pattern can be overridden by setting the system property
  purejavacomm.portnamepattern.<backend-fully-qualified-classname>.
  
- the pattern can be globally overriden by setting the system property
  purejavacomm.portnamepattern
  
- the current default backend patterns, as returned by getPortNamePattern(),
  are as follows:
  
    OS Regular expression Port name...
    -------------------------------------------------------------------
    Linux ^tty* Starts with 'tty'
    Mac OS ^(tty\.|cu\.).* Starts with 'cu.' or 'tty.'
    FreeBSD ^(tty\.|cu\.).* Starts with 'cu.' or 'tty.'
    Solaris .* Anything goes
    Windows ^COM.* Starts with 'COM'
  
  
  
Something went wrong with that request. Please try again.