Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jcurl/RJCP.DLL.SerialPortStream
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: release/2.0.3.0
Choose a base ref
...
head repository: jcurl/RJCP.DLL.SerialPortStream
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.x
Choose a head ref

Commits on Jan 23, 2017

  1. Verified

    This commit was signed with the committer’s verified signature.
    plyr4 dave vader
    Copy the full SHA
    2c36e43 View commit details
  2. Fix spelling for test case

    jcurl committed Jan 23, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    plyr4 dave vader
    Copy the full SHA
    7561799 View commit details

Commits on Feb 4, 2017

  1. 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
    jcurl committed Feb 4, 2017
    Copy the full SHA
    b13de4a View commit details
  2. Copy the full SHA
    d69bb94 View commit details

Commits on Feb 22, 2017

  1. Update and remove TODO items

    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.
    jcurl committed Feb 22, 2017
    Copy the full SHA
    7fa935d View commit details
  2. 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
    jcurl committed Feb 22, 2017
    Copy the full SHA
    56285df View commit details
  3. 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
    jcurl committed Feb 22, 2017
    Copy the full SHA
    67e761d View commit details
  4. Copy the full SHA
    0ebe8e8 View commit details

Commits on Mar 25, 2017

  1. 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
    jcurl committed Mar 25, 2017
    Copy the full SHA
    8e66cc1 View commit details

Commits on Apr 7, 2017

  1. 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
    jcurl committed Apr 7, 2017
    Copy the full SHA
    ffac792 View commit details
  2. Update the version of libnserial to 1.1.1 (from 1.1.0)

    Issue: DOTNET-82
    jcurl committed Apr 7, 2017
    Copy the full SHA
    4264370 View commit details

Commits on Apr 8, 2017

  1. Fixed project.json wrong compile paths

    Federico Dipuma authored and jcurl committed Apr 8, 2017
    Copy the full SHA
    2b748eb View commit details
  2. Update version to 2.1.1

    jcurl committed Apr 8, 2017
    Copy the full SHA
    2c3c12f View commit details

Commits on May 5, 2017

  1. 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
    jcurl committed May 5, 2017
    Copy the full SHA
    a41f0cc View commit details
  2. Properly clean up pin monitoring thread on Linux

    Issue: DOTNET-89
    jcurl committed May 5, 2017
    Copy the full SHA
    e4fc582 View commit details
  3. 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
    jcurl committed May 5, 2017
    Copy the full SHA
    8db1e5a View commit details

Commits on May 6, 2017

  1. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    607d80f View commit details
  2. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    6d34d48 View commit details
  3. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    bf2d820 View commit details
  4. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    7765137 View commit details
  5. Copy the full SHA
    b25ce3c View commit details
  6. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    71c0d4e View commit details
  7. Mark manual tests as explicit

    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
    jcurl committed May 6, 2017
    Copy the full SHA
    df17f05 View commit details
  8. 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
    jcurl committed May 6, 2017
    Copy the full SHA
    9a89ea6 View commit details

Commits on May 7, 2017

  1. 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
    jcurl committed May 7, 2017
    Copy the full SHA
    891452d View commit details

Commits on May 8, 2017

  1. 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
    jcurl committed May 8, 2017
    Copy the full SHA
    7ac3f3c View commit details
  2. 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
    jcurl committed May 8, 2017
    Copy the full SHA
    8202852 View commit details

Commits on May 13, 2017

  1. Bump version to 2.1.2

    Issue: DOTNET-103
    jcurl committed May 13, 2017
    Copy the full SHA
    5fca4a6 View commit details

Commits on May 22, 2017

  1. 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
    jcurl committed May 22, 2017
    Copy the full SHA
    bc29f81 View commit details

Commits on May 25, 2017

  1. Rename BUILD to BUILD.md

    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 committed May 25, 2017
    Copy the full SHA
    1d490d5 View commit details
  2. Allow building for OSes that don't support TIOCNXCL and TIOCEXCL

    Issue: DOTNET-106
    Jason Curl committed May 25, 2017
    Copy the full SHA
    86eeb55 View commit details

Commits on May 26, 2017

  1. Removed Doxygen warnings for 1.8.11

    Issue: DOTNET-60
    jcurl committed May 26, 2017
    Copy the full SHA
    63b5455 View commit details

Commits on Jun 16, 2017

  1. 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
    jcurl committed Jun 16, 2017
    Copy the full SHA
    4e00560 View commit details

Commits on Oct 31, 2017

  1. 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.
    ardave authored and jcurl committed Oct 31, 2017
    Copy the full SHA
    f7a533e View commit details

Commits on Apr 25, 2018

  1. 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
    jcurl committed Apr 25, 2018
    Copy the full SHA
    15a5805 View commit details
  2. 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
    jcurl committed Apr 25, 2018
    Copy the full SHA
    ab930fa View commit details
  3. 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
    jcurl committed Apr 25, 2018
    Copy the full SHA
    20b6c70 View commit details
  4. 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
    jcurl committed Apr 25, 2018
    Copy the full SHA
    b2ec92b View commit details

Commits on Apr 26, 2018

  1. Bump version to 2.1.3

    jcurl committed Apr 26, 2018
    Copy the full SHA
    2b58498 View commit details

Commits on May 13, 2018

  1. 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
    jcurl committed May 13, 2018
    Copy the full SHA
    b6a2b48 View commit details
  2. 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
    jcurl committed May 13, 2018
    Copy the full SHA
    b36cdd2 View commit details
  3. Bump version of libnserial to 1.1.3

    Ran all unit tests and pass where expected.
    
    Issue: DOTNET-160
    jcurl committed May 13, 2018
    Copy the full SHA
    ea93c24 View commit details

Commits on May 29, 2018

  1. Bump version to 2.1.4

    jcurl committed May 29, 2018
    Copy the full SHA
    cab862b View commit details
  2. 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
    Amarok79 authored and jcurl committed May 29, 2018
    Copy the full SHA
    96e1d1d View commit details

Commits on May 31, 2018

  1. 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
    jcurl committed May 31, 2018
    Copy the full SHA
    56a666d View commit details
  2. 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
    jcurl committed May 31, 2018
    Copy the full SHA
    4999c40 View commit details
  3. 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
    jcurl committed May 31, 2018
    Copy the full SHA
    93eb323 View commit details

Commits on Jun 1, 2018

  1. Don't use Enum.HasFlag

    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
    jcurl committed Jun 1, 2018
    Copy the full SHA
    dbca712 View commit details

Commits on Aug 17, 2018

  1. Update BUILD.md to be Markdown compliant

    Make minor formatting to the BUILD.md document
    jcurl committed Aug 17, 2018
    Copy the full SHA
    6a561cd View commit details
  2. 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.
    jcurl committed Aug 17, 2018
    Copy the full SHA
    ae4b7af View commit details
Showing with 13,619 additions and 8,717 deletions.
  1. +221 −0 .editorconfig
  2. +8 −10 .gitignore
  3. +8 −0 .vscode/settings.json
  4. +286 −0 BUILD.md
  5. +247 −0 CHANGES.md
  6. +0 −19 Changes.txt
  7. +1 −1 LICENSE → LICENSE.md
  8. +333 −233 README.md
  9. +50 −212 SerialPortStream.sln
  10. +0 −2 SerialPortStream.sln.GhostDoc.user.dic
  11. +30 −29 build.bat
  12. +513 −328 code/Datastructures/CircularBuffer.cs
  13. +189 −0 code/Datastructures/ReusableList.cs
  14. +6 −7 code/Datastructures/TimerExpiry.cs
  15. +14 −46 code/GlobalSuppressions.cs
  16. +923 −0 code/ISerialPortStream.cs
  17. +55 −0 code/InternalApplicationException.cs
  18. +18 −13 code/LocalAsyncResult.cs
  19. +12 −13 code/Native/INativeSerial.cs
  20. +1 −9 code/Native/ISerialBufferSerialData.cs
  21. +10 −8 code/Native/ISerialBufferStreamData.cs
  22. +32 −0 code/Native/Platform.cs
  23. +68 −46 code/Native/ReadToCache.cs
  24. +59 −65 code/Native/SerialBuffer.cs
  25. +56 −48 code/Native/Unix/INativeSerialDll.cs
  26. +24 −0 code/Native/Unix/SafeNativeMethods.cs
  27. +30 −0 code/Native/Unix/SafeSerialHandle.cs
  28. +3 −1 code/Native/Unix/SerialReadWriteEvent.cs
  29. +147 −203 code/Native/Unix/SerialUnix.cs
  30. +68 −0 code/Native/Unix/SysErrNo.cs
  31. +167 −0 code/Native/Unix/UnsafeNativeMethods.cs
  32. +282 −142 code/Native/UnixNativeSerial.cs
  33. +233 −180 code/Native/WinNativeSerial.cs
  34. +175 −0 code/Native/Windows/CfgMgr32.Types.cs
  35. +105 −0 code/Native/Windows/CfgMgr32.cs
  36. +6 −6 code/Native/Windows/CommErrorEventArgs.cs
  37. +4 −4 code/Native/Windows/CommEventArgs.cs
  38. +11 −13 code/Native/Windows/CommModemStatus.cs
  39. +291 −220 code/Native/Windows/CommOverlappedIo.cs
  40. +67 −69 code/Native/Windows/CommProperties.cs
  41. +31 −32 code/Native/Windows/CommState.cs
  42. +52 −7 code/Native/Windows/{NativeMethods.cs → Kernel32.Types.cs}
  43. +90 −0 code/Native/Windows/Kernel32.cs
  44. +97 −0 code/Native/Windows/Marshalling.cs
  45. +0 −14 code/Native/Windows/SafeNativeMethods.cs
  46. +0 −131 code/Native/Windows/UnsafeNativeMethods.cs
  47. +2 −2 code/Native/Windows/WinError.cs
  48. +18 −2 code/PortDescription.cs
  49. +2 −22 code/Properties/AssemblyInfo.cs
  50. +4 −3 code/SerialData.cs
  51. +2 −7 code/SerialDataEventArgs.cs
  52. +4 −3 code/SerialError.cs
  53. +2 −2 code/SerialErrorReceivedEventArgs.cs
  54. +4 −3 code/SerialPinChange.cs
  55. +2 −2 code/SerialPinChangedEventArgs.cs
  56. +2,318 −2,048 code/SerialPortStream.cs
  57. +98 −69 code/SerialPortStream.csproj
  58. +0 −31 code/SerialPortStream.nuspec
  59. +0 −95 code/SerialTrace.cs
  60. +37 −0 code/System/EntryPointNotFoundException.cs
  61. +71 −0 code/Trace/LineSplitter.cs
  62. +39 −0 code/Trace/Log.cs
  63. +181 −0 code/Trace/LogSource.cs
  64. +61 −0 code/Trace/LogSourceFactory.cs
  65. +125 −0 code/Trace/LoggerTraceListener.cs
  66. +0 −4 code/packages.config
  67. +28 −0 dll/docker/Dockerfile
  68. +103 −0 dll/docker/README.md
  69. +121 −0 dll/docker/libnserial-build.sh
  70. +0 −9 dll/serialunix/BUILD
  71. +34 −0 dll/serialunix/BUILD.md
  72. +2 −2 dll/serialunix/CMakeLists.txt
  73. +2 −0 dll/serialunix/CMakeModules/serial.cmake
  74. +0 −18 dll/serialunix/TODO
  75. +37 −17 dll/serialunix/build.sh
  76. +13 −1 dll/serialunix/libnserial/CMakeLists.txt
  77. +7 −1 dll/serialunix/libnserial/comptest/CMakeLists.txt
  78. +65 −0 dll/serialunix/libnserial/comptest/ListPortTest.cpp
  79. +6 −0 dll/serialunix/libnserial/comptest/SerialModemSignalsTest.cpp
  80. +17 −17 dll/serialunix/libnserial/comptest/SerialParityTest.cpp
  81. +0 −4 dll/serialunix/libnserial/comptest/SerialReadWrite.cpp
  82. +10 −17 dll/serialunix/libnserial/comptest/SerialSendReceiveTest.cpp
  83. +7 −0 dll/serialunix/libnserial/config.h.in
  84. +0 −12 dll/serialunix/libnserial/doxyfile.in
  85. +15 −1 dll/serialunix/libnserial/errmsg.c
  86. +8 −1 dll/serialunix/libnserial/errmsg.h
  87. +3 −3 dll/serialunix/libnserial/events.c
  88. +188 −58 dll/serialunix/libnserial/modem.c
  89. +22 −0 dll/serialunix/libnserial/modem.h
  90. +50 −0 dll/serialunix/libnserial/netfx.c
  91. +59 −0 dll/serialunix/libnserial/netfx.h
  92. +17 −3 dll/serialunix/libnserial/nserial.c
  93. +26 −0 dll/serialunix/libnserial/nserial.h
  94. +26 −6 dll/serialunix/libnserial/openserial.c
  95. +427 −0 dll/serialunix/libnserial/portlinux.c
  96. +35 −0 dll/serialunix/libnserial/portnone.c
  97. +18 −1 dll/serialunix/libnserial/serialhandle.h
  98. +39 −0 dll/serialunix/libnserial/stringbuf.c
  99. +19 −0 dll/serialunix/libnserial/stringbuf.h
  100. +11 −6 dll/serialunix/libnserial/threaddata.c
  101. +2 −0 dll/serialunix/libnserial/unittest/CMakeLists.txt
  102. +64 −0 dll/serialunix/libnserial/unittest/serialerror.cpp
  103. +1 −1 dll/serialunix/libnserial/unittest/serialinit.cpp
  104. +126 −0 dll/serialunix/libnserial/unittest/serialmodem.cpp
  105. +16 −0 dll/serialunix/libnserial/unittest/serialopen.cpp
  106. +0 −6 packages/repositories.config
  107. +911 −1,157 test/DatastructuresTest/CircularBufferTest.cs
  108. +28 −94 test/DatastructuresTest/DatastructuresTest.csproj
  109. +13 −0 test/DatastructuresTest/GlobalSuppressions.cs
  110. +0 −40 test/DatastructuresTest/Properties/AssemblyInfo.cs
  111. +42 −48 test/DatastructuresTest/TimerExpiryTest.cs
  112. +0 −4 test/DatastructuresTest/packages.config
  113. +1 −1 test/SerialPortStreamTest/App.config
  114. +15 −0 test/SerialPortStreamTest/GlobalSuppressions.cs
  115. +0 −39 test/SerialPortStreamTest/Properties/AssemblyInfo.cs
  116. +0 −411 test/SerialPortStreamTest/ReadToTest.cs
  117. +30 −8 test/SerialPortStreamTest/SerialConfiguration.cs
  118. +87 −0 test/SerialPortStreamTest/SerialPortReceive.cs
  119. +537 −0 test/SerialPortStreamTest/SerialPortStreamCharTest.cs
  120. +29 −0 test/SerialPortStreamTest/SerialPortStreamLoggerTest.cs
  121. +798 −0 test/SerialPortStreamTest/SerialPortStreamManualTest.cs
  122. +147 −0 test/SerialPortStreamTest/SerialPortStreamParityTest.cs
  123. +572 −0 test/SerialPortStreamTest/SerialPortStreamRxTxTest.cs
  124. +538 −0 test/SerialPortStreamTest/SerialPortStreamSimpleTest.cs
  125. +0 −2,196 test/SerialPortStreamTest/SerialPortStreamTest.cs
  126. +77 −85 test/SerialPortStreamTest/SerialPortStreamTest.csproj
  127. +25 −42 test/SerialPortStreamTest/{MsdnFrameworkTest.cs → System/IO/Ports/SerialPortTest.cs}
  128. +30 −0 test/SerialPortStreamTest/System/Text/EncodingTest.cs
  129. +51 −0 test/SerialPortStreamTest/Trace/GlobalLogger.cs
  130. +29 −0 test/SerialPortStreamTest/Trace/SerialLogger.cs
  131. +29 −0 test/SerialPortStreamTest/Trace/SerialLoggerFactory.cs
  132. +13 −0 test/SerialPortStreamTest/appsettings.json
  133. +0 −4 test/SerialPortStreamTest/packages.config
221 changes: 221 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true

# Don't use tabs for indentation.
[*]
indent_style = space

# JSON files
[*.json]
indent_size = 2

# Powershell files
[*.ps1]
indent_size = 2

# Shell script files
[*.sh]
end_of_line = lf
indent_size = 2

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_size = 2

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2

# C# files
[*.cs]

#### Core EditorConfig Options ####

# Indentation and spacing
indent_size = 4
tab_width = 4

# New line preferences
#end_of_line = crlf
insert_final_newline = false

#### .NET Coding Conventions ####

# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true

# this. and Me. preferences
dotnet_style_qualification_for_event = false:silent
dotnet_style_qualification_for_field = false:silent
dotnet_style_qualification_for_method = false:silent
dotnet_style_qualification_for_property = false:silent

# Language keywords vs BCL types preferences
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent

# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent

# Expression-level preferences
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_throw_expression = false:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion

# Field preferences
dotnet_style_readonly_field = true:suggestion

# Parameter preferences
dotnet_code_quality_unused_parameters = non_public:suggestion

#### C# Coding Conventions ####

# var preferences
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = false:silent

# Expression-bodied members
csharp_style_expression_bodied_accessors = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_indexers = false:silent
csharp_style_expression_bodied_lambdas = false:silent
csharp_style_expression_bodied_local_functions = false:silent
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = false:silent

# Pattern matching preferences
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_prefer_switch_expression = false:suggestion

# Null-checking preferences
csharp_style_conditional_delegate_call = false:suggestion

# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async

# Code-block preferences
csharp_prefer_braces = true:silent
csharp_prefer_simple_using_statement = false:suggestion

# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_unused_value_assignment_preference = discard_variable:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:silent

# 'using' directive preferences
csharp_using_directive_placement = inside_namespace:silent

#### C# Formatting Rules ####

# New line preferences
csharp_new_line_before_catch = false
csharp_new_line_before_else = false
csharp_new_line_before_finally = false
csharp_new_line_before_members_in_anonymous_types = false
csharp_new_line_before_members_in_object_initializers = false
csharp_new_line_before_open_brace = accessors,methods,properties,types
csharp_new_line_between_query_expression_clauses = false

# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = false

# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = true

#### Naming styles ####

# Naming rules

dotnet_naming_rule.interface_should_be_begins_with_i.severity = warning
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications

dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles

dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/code/bin
/code/obj
/distribute
/test/DatastructuresTest/bin
/test/DatastructuresTest/obj
/test/SerialPortStreamTest/bin
/test/SerialPortStreamTest/obj
/packages/NUnit.2.6.4
/packages/Mono.Posix.4.0.0.0
/.vs
bin/
obj/
TestResults/
/distribute/
/packages/
.vs/
*.nupkg
*.suo
*.user
*.userprefs
*.GhostDoc.xml
*.snk
*.exe
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"omnisharp.enableEditorConfigSupport": true,
"omnisharp.enableRoslynAnalyzers": true,
"editor.rulers": [
120
],
"rewrap.wrappingColumn": 120
}
Loading