-
Notifications
You must be signed in to change notification settings - Fork 200
Comparing changes
Open a pull request
base repository: jcurl/RJCP.DLL.SerialPortStream
base: release/2.0.3.0
head repository: jcurl/RJCP.DLL.SerialPortStream
compare: v2.x
Commits on Jan 23, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 2c36e43 - Browse repository at this point
Copy the full SHA 2c36e43View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7561799 - Browse repository at this point
Copy the full SHA 7561799View commit details
Commits on Feb 4, 2017
-
Use a smarter algorithm to get the available ports on Linux
We iterate over /sys/class/tty/* looking for tty's. We check that there's a device associated to ignore psuedotty's and that they must have a kernel major:minor number. For platform:8250 we open the device and check further. Only devices that exist in /dev, and are user accessible which appear real are shown (multiple nodes to the same device are ignored). The description returned is the name of the device given by udev in the uevent file. The libnserial library is updated to version 1.1.0 as we now have a new C-API. The SerialPortStream remains compatible with libnserial 1.0.x, and if that is installed on the system, SerialPortStream will revert to old behaviour. Tested on Linux. Simulated v1.0.0 library that fallback works (with EntryPointNotFoundException). Issue: DOTNET-34
Configuration menu - View commit details
-
Copy full SHA for b13de4a - Browse repository at this point
Copy the full SHA b13de4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for d69bb94 - Browse repository at this point
Copy the full SHA d69bb94View commit details
Commits on Feb 22, 2017
-
These items have been in the repository for quite some time and are arguably no longer relevant. If it's required, then put them in a bug tracking system instead.
Configuration menu - View commit details
-
Copy full SHA for 7fa935d - Browse repository at this point
Copy the full SHA 7fa935dView commit details -
Support .NET Standard 1.5 (.NET Core 1.0 and .NET FX 4.6.x)
Original patch from Jaime Olivares <jaime_olivares@hotmail.com>, reworked as described in the following sections: Rebased .NET Core, enabling GetPort() functionality also for .NET Standard. .NET Standard doesn't support ApplicationException, so a more explicit InternalApplicationException is created. Functionality for getting the serial ports was reenabled. The libnserial v1.1 adds this functionality. Unfortunately, .NET standard doesn't support System.EntryPointNotFoundException (it's raised on Windows, but it's not exposed). So there's an ugly hack that in case of an exception when calling the method under Unix, we remap all exceptions to System.EntryPointNotFoundException. Note: On Windows, you'll no longer get port descriptions, as the WMI functionality is not available under .NET Standard. Note: On Linux, exceptions aren't mapped properly under .NET Standard as there's no mapping of errno to an appropriate exception, like there is for Mono. You won't be able to capture them properly. This is to be considered a bug. Note: {Begin|End}{Read|Write} isn't defined in .NET Standard. They use ReadAsync and WriteAsync instead. Issue: DOTNET-72, #10
Configuration menu - View commit details
-
Copy full SHA for 56285df - Browse repository at this point
Copy the full SHA 56285dfView commit details -
Added proper exception support for Linux.
For .NET Standard and Mono, we now do our own mapping of 'errno' to constants defined by libnserial. This allows us to raise the correct exceptions in .NET Standard. Mono now raises more exceptions than previously (may cause a breaking change in existing code under Linux). This library will not work on .NET Standard 1.5 under Unix operating systems, unless libnserial.so.1.1 is in the path. The older library does not provide the mapping routines. On Mono, you can continue to use the old library and we use the old mapping algorithm. Remember, as soon as you update the library, you'll get the new exceptions automatically. Issue: DOTNET-75
Configuration menu - View commit details
-
Copy full SHA for 67e761d - Browse repository at this point
Copy the full SHA 67e761dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ebe8e8 - Browse repository at this point
Copy the full SHA 0ebe8e8View commit details
Commits on Mar 25, 2017
-
Remove platform check on Linux for Mono.
A platform check was introduced to ensure that for NET Standard 1.5, the user has the library nserial 1.1.0 or later installed. This is useful for Mono, but not required. Issue: DOTNET-81
Configuration menu - View commit details
-
Copy full SHA for 8e66cc1 - Browse repository at this point
Copy the full SHA 8e66cc1View commit details
Commits on Apr 7, 2017
-
Close a serial port properly on Linux with Native Lib.
In some cases after closing the serial port and immediately trying to reopen it, we'd return EACCES indicating that the serial port is in use. This occurs because of the usage of the ioctl(TIOCEXCL). It's not possible at all anymore to open the serial port. So just before we now close the serial port, we reset the exclusive flag with ioctl(TIOCNXCL), which allows the serial port to always be reopened. Tested by modifying the Mono test case to run 100 times, which now passes (it didn't before). Issue: DOTNET-82
Configuration menu - View commit details
-
Copy full SHA for ffac792 - Browse repository at this point
Copy the full SHA ffac792View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4264370 - Browse repository at this point
Copy the full SHA 4264370View commit details
Commits on Apr 8, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 2b748eb - Browse repository at this point
Copy the full SHA 2b748ebView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c3c12f - Browse repository at this point
Copy the full SHA 2c3c12fView commit details
Commits on May 5, 2017
-
Abort pin monitoring on Linux for devices that don't support it
For some serial devices, such as ttyACM* USB devices, the ioctl(TIOCMIWAIT) returns an error. Now if an error occurs, we propogate it to the .NET implementation which already correctly ends the monitoring thread. Previously, the error was ignored in a loop resulting in 100% CPU utilization. Issue: DOTNET-85, #22
Configuration menu - View commit details
-
Copy full SHA for a41f0cc - Browse repository at this point
Copy the full SHA a41f0ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4fc582 - Browse repository at this point
Copy the full SHA e4fc582View commit details -
Fix race condition when checking/aborting modem events.
The method serial_waitformodemevent should only be called at most once. There is already some code to protect the structure used for waiting for the event, but none when cancelling, or when waiting for the event twice (meaning that the code was incomplete and did nothing). This commit finishes the implementation. In addition, we now report errors when creating the critical section, and errors when creating the cancellable thread. Issue: DOTNET-86, DOTNET-87
Configuration menu - View commit details
-
Copy full SHA for 8db1e5a - Browse repository at this point
Copy the full SHA 8db1e5aView commit details
Commits on May 6, 2017
-
Make usage of pthread_setcancel{state|type} portable
According to the linux manpage, the second parameter may be NULL, but this is not standard in the Posix specification. We should provide a pointer to an int, even if we don't use it. Added test cases to ensure that the function serial_waitformodemevent can be aborted by serial_abortwaitformodemevent. Tested that this works. We tested also what happens if the type is PTHREAD_CANCEL_DEFERRED instead of PTHREAD_CANCEL_ASYNCHRONOUS and it turns out that the call to ioctl(TIOCMIWAIT, ...) is not a cancellation point. Issue: DOTNET-93
Configuration menu - View commit details
-
Copy full SHA for 607d80f - Browse repository at this point
Copy the full SHA 607d80fView commit details -
Properly handle errors from pthreads
Pthreads return the error number, not -1 like just about every other system call. So handle this properly. Issue: DOTNET-94
Configuration menu - View commit details
-
Copy full SHA for 6d34d48 - Browse repository at this point
Copy the full SHA 6d34d48View commit details -
We have to add delays between setting and checking CTS/RTS and DTR/DTS
Implement a 10ms delay in the test case. It appears that for the USB serial device used for testing, setting the RTS/DTR pins isn't done by the OS immediately. Issue: DOTNET-96
Configuration menu - View commit details
-
Copy full SHA for bf2d820 - Browse repository at this point
Copy the full SHA bf2d820View commit details -
Correct race condition when aborting a modem event
There was the possibility of returning an error when aborting a modem event, depending on timing if a signal arrived at the same time. There should be no error from aborting a modem event even there's nothing to abort. Issue: DOTNET-95
Configuration menu - View commit details
-
Copy full SHA for 7765137 - Browse repository at this point
Copy the full SHA 7765137View commit details -
Configuration menu - View commit details
-
Copy full SHA for b25ce3c - Browse repository at this point
Copy the full SHA b25ce3cView commit details -
Treat EINTR as a non-fatal interrupt
If a signal occurs for whatever reason, the OS may return EINTR as an error code. This was being treated as a fatal error in the .NET implementation. libnserial now returns zero for serial_read and serial_write as is the case for EAGAIN / EWOULDBLOCK. The .NET code was optimized slightly so that in case zero is returned, it skips a buffer check and tries again (this change is non-functional). Issue: DOTNET-91
Configuration menu - View commit details
-
Copy full SHA for 71c0d4e - Browse repository at this point
Copy the full SHA 71c0d4eView commit details -
Manual tests that are explicit won't be automatically run from NUnit in the VSIDE, MonoDevelop IDE or the NUnit runner unless explicitly set. Issue: DOTNET-88
Configuration menu - View commit details
-
Copy full SHA for df17f05 - Browse repository at this point
Copy the full SHA df17f05View commit details -
Thread names on Linux too long
Shorten the names of the .NET threads (I/O and pin monitoring) to something shorter. Issue: DOTNET-92, #24
Configuration menu - View commit details
-
Copy full SHA for 9a89ea6 - Browse repository at this point
Copy the full SHA 9a89ea6View commit details
Commits on May 7, 2017
-
Provide an implementation for DiscardInBuffer and DiscardOutBuffer
The implementations on Linux remained not implemented, throwing an exception. The issue does not affect Windows. Issue: DOTNET-97, #26
Configuration menu - View commit details
-
Copy full SHA for 891452d - Browse repository at this point
Copy the full SHA 891452dView commit details
Commits on May 8, 2017
-
Use a SafeHandle for libnserial
Previously used an IntPtr. Wrapping this around a SafeHandle implementation protects against some memory errors. Further, the Dispose pattern can be simplified and we don't need a Finalizer (which we were previously missing). Issue: DOTNET-100
Configuration menu - View commit details
-
Copy full SHA for 7ac3f3c - Browse repository at this point
Copy the full SHA 7ac3f3cView commit details -
Don't execute some test cases under the Monodevelop IDE
The test cases run and cause follow up failures, making testing tedious. Add value to test cases by not running those we know cause issues. Issue: DOTNET-101
Configuration menu - View commit details
-
Copy full SHA for 8202852 - Browse repository at this point
Copy the full SHA 8202852View commit details
Commits on May 13, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 5fca4a6 - Browse repository at this point
Copy the full SHA 5fca4a6View commit details
Commits on May 22, 2017
-
Support devices that don't work with overlapped WaitCommEvent.
Some devices, notably a Arduino Uno clone (with CH340 on board), would return error 87 (ERROR_INVALID_PARAMETER) on a call to WaitCommEvent, but it does work with the GetReceiveStats (Windows API ClearCommError function) to know when data is available to read. The flush functionality should still work on write, even without the TX_EMPTY event that we'd miss with WaitCommEvent, because we set this every time our internal buffer is empty. All unit test cases on Windows with the COM-0-COM driver work. Testing on the Arduino CH340 borad done by GitHub user AndreiGorlov. Issue: DOTNET-98, #25
Configuration menu - View commit details
-
Copy full SHA for bc29f81 - Browse repository at this point
Copy the full SHA bc29f81View commit details
Commits on May 25, 2017
-
Indicate that the file is in the format of 'markdown'. The file `BUILD` would be removed when running `build.sh` on systems that don't support case sensitive file names, such as Cygwin. Issue: DOTNET-105
Jason Curl committedMay 25, 2017 Configuration menu - View commit details
-
Copy full SHA for 1d490d5 - Browse repository at this point
Copy the full SHA 1d490d5View commit details -
Allow building for OSes that don't support TIOCNXCL and TIOCEXCL
Issue: DOTNET-106
Jason Curl committedMay 25, 2017 Configuration menu - View commit details
-
Copy full SHA for 86eeb55 - Browse repository at this point
Copy the full SHA 86eeb55View commit details
Commits on May 26, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 63b5455 - Browse repository at this point
Copy the full SHA 63b5455View commit details
Commits on Jun 16, 2017
-
Updgrade project to work with .NET Core 1.0.4
Originally provided as a pull request from Danny <dannyb2100@hotmail.com> in #28. Moved the csproj for netstandard 1.5 in the same folder as the rest, provided a solution file for VS2017. The dependencies in the CSPROJ file are now 4.3.0 to match that in the NuSpec file for .NET STandard 1.5. Build script and NuSpec was updated for the new binaries. Issue: DOTNET-104, #20
Configuration menu - View commit details
-
Copy full SHA for 4e00560 - Browse repository at this point
Copy the full SHA 4e00560View commit details
Commits on Oct 31, 2017
-
Correct paths for CMake in README.md
Issue found by user ardave with #40. Additionally corrected a similar sentence above to make the instructions consistent.
Configuration menu - View commit details
-
Copy full SHA for f7a533e - Browse repository at this point
Copy the full SHA f7a533eView commit details
Commits on Apr 25, 2018
-
Increase timeout for test case ListPorts
When running on a Windows machine that has 4 emulated ports and four bluetooth ports, the management engine of the desktop version of windows may take some time. 10 seconds is not enough. The code that is taking its time is: public PortDescription[] GetPortDescriptions() { ... ManagementObjectCollection objects; using (ManagementObjectSearcher q = new ManagementObjectSearcher("select * from Win32_SerialPort")) { objects = q.Get(); using (ManagementObjectCollection.ManagementObjectEnumerator enumerator = objects.GetEnumerator()) { while (enumerator.MoveNext()) { ManagementObject current = (ManagementObject)enumerator.Current; string k = current["DeviceID"].ToString(); if (list.ContainsKey(k)) { list[k].Description = current["Name"].ToString(); } } } } ... Issue: DOTNET-152
Configuration menu - View commit details
-
Copy full SHA for 15a5805 - Browse repository at this point
Copy the full SHA 15a5805View commit details -
SerialPortStream: The IsDisposable flag should not be publicly settable
Additionally, clean up Dispose() to reduce indenting, and properly do a GC.SuppressFinalize. The GC change is to meet the Dispose programming pattern and is required in case the classes are derived from. That these classes aren't derived from means that this change is cosmetic and a coding standard change only. All unit tests pass on Windows. Issue: DOTNET-154
Configuration menu - View commit details
-
Copy full SHA for ab930fa - Browse repository at this point
Copy the full SHA ab930faView commit details -
Use constant for infinite timeout
Code uses -1 in many places to mean an infinite timeout. Instead, use System.Threading.Timeout.Infinite to differentiate between other uses of -1. This code change should not result in a change of the binaries, that constants are not stored in code. Issue: DOTNET-155
Configuration menu - View commit details
-
Copy full SHA for 20b6c70 - Browse repository at this point
Copy the full SHA 20b6c70View commit details -
Avoid deadlock in event handling
When an event occurs, a "m_EventLock" was taken to check the number of bytes received which took the lock "m_ReadLock". Separately, the main I/O thread would take the lock "m_ReadLock" and may indicate that an error occurred trying to take "m_EventLock". This may result in a deadlock situation of a read event occurs simultaneously with an error event. Issue: DOTNET-156, #50
Configuration menu - View commit details
-
Copy full SHA for b2ec92b - Browse repository at this point
Copy the full SHA b2ec92bView commit details
Commits on Apr 26, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 2b58498 - Browse repository at this point
Copy the full SHA 2b58498View commit details
Commits on May 13, 2018
-
Use correct header when parsing for serial ports on Linux
When compiling on GCC 7.3.0 on Ubuntu 18.04, we got the error: .../dll/serialunix/libnserial/portlinux.c:243:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. int major = major(sb.st_rdev); ^~~~~~~~~~~~~~~~~~~~~~~~~~ Include the correct headers and the warning goes away. Issue: DOTNET-158
Configuration menu - View commit details
-
Copy full SHA for b6a2b48 - Browse repository at this point
Copy the full SHA b6a2b48View commit details -
Test Cases: Fix compatibility issues with GCC 7.3.0
When compiling on Ubuntu 18.04, the unit test cases fail to compile due to two changes: * 'auto_ptr' is considered deprecated, and unique_ptr should be used instead. * char is signed, and values greater than 128 raised an error due to narrowing Issue: DOTNET-159
Configuration menu - View commit details
-
Copy full SHA for b36cdd2 - Browse repository at this point
Copy the full SHA b36cdd2View commit details -
Bump version of libnserial to 1.1.3
Ran all unit tests and pass where expected. Issue: DOTNET-160
Configuration menu - View commit details
-
Copy full SHA for ea93c24 - Browse repository at this point
Copy the full SHA ea93c24View commit details
Commits on May 29, 2018
-
Configuration menu - View commit details
-
Copy full SHA for cab862b - Browse repository at this point
Copy the full SHA cab862bView commit details -
Sign the .NET Standard 1.5 assembly
Introduced 'Signed_Release' build configuration to netstandard 1.5 project; enable signing for that configuration. Adapted build script to use Signed_Release build configuration for dotnet projects Issue: DOTNET-161, #55
Configuration menu - View commit details
-
Copy full SHA for 96e1d1d - Browse repository at this point
Copy the full SHA 96e1d1dView commit details
Commits on May 31, 2018
-
Reduce number of objects created when Writing, Reading, Flushing
Instead of creating a new array of WaitHandle objects on everytime a read, write or flush is done, prepare the arrays in the constructor and use that. Looking into the .NET 4.7.1 reference sources, the method WaitHandles.WaitAny makes a copy of that array too, so there is no need to create it twice and burden GC0. Issue: DOTNET-162
Configuration menu - View commit details
-
Copy full SHA for 56a666d - Browse repository at this point
Copy the full SHA 56a666dView commit details -
Reduce CPU and Memory if tracing is disabled
Before printing out a trace, first check if it would be traced with the TraceSource.ShouldTrace command. Particularly, to make this as fast as possible and have the possibility for inlining, an internal implementation is made caching what trace events may be traced in a bit field. The GC is improved as we no longer need to create arrays for the TraceSource.TraceEvent(xxx, params object[] args), where the compiler will allocate an array automatically, and then box any value types into the array thus creating more objects on the GC heap. Issue: DOTNET-163
Configuration menu - View commit details
-
Copy full SHA for 4999c40 - Browse repository at this point
Copy the full SHA 4999c40View commit details -
Reduce number of WaitHandles created in I/O loop
Instead of creating a new array of WaitHandle objects on every iteration of the I/O loop, we keep a fixed set of arrays and reuse them. Issue: DOTNET-164
Configuration menu - View commit details
-
Copy full SHA for 93eb323 - Browse repository at this point
Copy the full SHA 93eb323View commit details
Commits on Jun 1, 2018
-
The Enum.HasFlag operation results in two boxing operations and is significantly slower than using integer boolean arithmetic. The boxing arises through converting the Enum type to a reference type, so that HasFlag can be called. The second boxing operation is converting the flag to test from an enum type to a reference type for the test. This change would also slightly reduce CPU load. Issue: DOTNET-165
Configuration menu - View commit details
-
Copy full SHA for dbca712 - Browse repository at this point
Copy the full SHA dbca712View commit details
Commits on Aug 17, 2018
-
Update BUILD.md to be Markdown compliant
Make minor formatting to the BUILD.md document
Configuration menu - View commit details
-
Copy full SHA for 6a561cd - Browse repository at this point
Copy the full SHA 6a561cdView commit details -
Fix minor warnings indicated by VSCode
After installing VScode and installing the suggested C/C++-plugin, VScode reported some warnings. Although these don't affect the code, they might improve readability.
Configuration menu - View commit details
-
Copy full SHA for ae4b7af - Browse repository at this point
Copy the full SHA ae4b7afView commit details
There are no files selected for viewing