Skip to content

Commit

Permalink
Fix some docfx warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dotMorten committed Mar 10, 2021
1 parent 40f2bdc commit 8e89aba
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 73 deletions.
2 changes: 1 addition & 1 deletion src/NmeaParser/Gnss/GnssMonitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public string Datum
/// <seealso cref="IsFixValid"/>
public event EventHandler? LocationLost;

/// <inheritdoc />
/// <summary>Occurs when a property value changes.</summary>
public event PropertyChangedEventHandler? PropertyChanged;

private void OnPropertyChanged(IEnumerable<string> properties)
Expand Down
5 changes: 4 additions & 1 deletion src/NmeaParser/Nmea/Gsv.cs
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,10 @@ public SatelliteSystem System
}
}

/// <inheritdoc />
/// <summary>
/// Returns a string that represents the satellite vehicle.
/// </summary>
/// <returns>A string that represents the satellite vehicle.</returns>
public override string ToString()
{
switch (TalkerId)
Expand Down
11 changes: 9 additions & 2 deletions src/NmeaParser/Nmea/NmeaMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ public static NmeaMessage Parse(string message, IMultiSentenceMessage? previousS
/// </summary>
public bool IsProprietary => MessageType[0] == 'P'; //Appendix B

/// <inheritdoc />
/// <summary>
/// Returns the original NMEA string that represents this message.
/// </summary>
/// <returns>An original NMEA string that represents this message.</returns>
public override string ToString()
{
return string.Format(CultureInfo.InvariantCulture, "${0},{1}*{2:X2}", MessageType, string.Join(",", MessageParts), Checksum);
Expand Down Expand Up @@ -301,7 +304,11 @@ internal static TimeSpan StringToTimeSpan(string value)
return TimeSpan.Zero;
}

/// <inheritdoc />
/// <summary>
/// Indicates whether the current object is equal to another object of the same type.
/// </summary>
/// <param name="other">An object to compare with this object.</param>
/// <returns><c>true</c> if the current object is equal to the other parameter; otherwise, <c>false</c>.</returns>
public bool Equals(NmeaMessage other)
{
if (other.MessageType != MessageType)
Expand Down
138 changes: 69 additions & 69 deletions src/NmeaParser/SerialPortDevice.UWP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@
// * limitations under the License.
// ******************************************************************************

#if WINDOWS_UWP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using Windows.Devices.SerialCommunication;
#if WINDOWS_UWP
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Threading.Tasks;
using Windows.Devices.SerialCommunication;
using System.Runtime.InteropServices.WindowsRuntime;

namespace NmeaParser
namespace NmeaParser
{
/// <summary>
/// A Serial Port NMEA device
/// </summary>
/// <remarks>
/// <summary>
/// A Serial Port NMEA device
/// </summary>
/// <remarks>
/// <para>
/// To use the NMEA Parser against a serial device in a Windows 10 Universal app, ensure the serial device capability is enabled by opening package.appxmanifest in a text editor, and add the following to the <c>&lt;Capabilities></c> section:
/// </para>
Expand All @@ -37,8 +37,8 @@ namespace NmeaParser
/// &lt;Function Type="name:serialPort" />
/// &lt;/Device>
/// &lt;/DeviceCapability>
/// </code>
/// <code lang="cs">
/// </code>
/// <code lang="cs">
/// var selector = SerialDevice.GetDeviceSelector("COM3"); //Get the serial port on port '3'
/// var devices = await DeviceInformation.FindAllAsync(selector);
/// if(devices.Any()) //if the device is found
Expand All @@ -58,71 +58,71 @@ namespace NmeaParser
/// {
/// // called when a message is received
/// }
/// </code>
/// </remarks>
public class SerialPortDevice : NmeaDevice
{
private SerialDevice m_port;

/// <summary>
/// Initializes a new instance of the <see cref="SerialPortDevice" /> class.
/// </summary>
/// <param name="device">The serial port.</param>
/// <exception cref="System.ArgumentNullException">port</exception>
public SerialPortDevice(SerialDevice device)
{
if (device == null)
throw new ArgumentNullException("device");
m_port = device;
}

/// <summary>
/// Gets the active serial port.
/// </summary>
public SerialDevice SerialDevice
{
get
{
return m_port;
}
}

/// </code>
/// </remarks>
public class SerialPortDevice : NmeaDevice
{
private SerialDevice m_port;

/// <summary>
/// Initializes a new instance of the <see cref="SerialPortDevice" /> class.
/// </summary>
/// <param name="device">The serial port.</param>
/// <exception cref="ArgumentNullException">port</exception>
public SerialPortDevice(SerialDevice device)
{
if (device == null)
throw new ArgumentNullException("device");
m_port = device;
}

/// <summary>
/// Gets the active serial port.
/// </summary>
public SerialDevice SerialDevice
{
get
{
return m_port;
}
}

/// <inheritdoc />
protected override Task<System.IO.Stream> OpenStreamAsync()
{
return Task.FromResult<System.IO.Stream>(m_port.InputStream.AsStreamForRead(0));
}

protected override Task<System.IO.Stream> OpenStreamAsync()
{
return Task.FromResult<System.IO.Stream>(m_port.InputStream.AsStreamForRead(0));
}

/// <inheritdoc />
protected override Task CloseStreamAsync(System.IO.Stream stream)
{
return Task.CompletedTask;
}

/// <summary>
/// Writes data to the serial port (useful for RTCM/dGPS scenarios)
/// </summary>
/// <param name="buffer">The byte array that contains the data to write to the port.</param>
/// <param name="offset">The zero-based byte offset in the buffer parameter at which to begin copying
/// bytes to the port.</param>
/// <param name="count">The number of bytes to write.</param>
[Obsolete("Use WriteAsync")]
public void Write(byte[] buffer, int offset, int count)
{
m_port.OutputStream.AsStreamForWrite().Write(buffer, offset, count);
protected override Task CloseStreamAsync(System.IO.Stream stream)
{
return Task.CompletedTask;
}

/// <summary>
/// Writes data to the serial port (useful for RTCM/dGPS scenarios)
/// </summary>
/// <param name="buffer">The byte array that contains the data to write to the port.</param>
/// <param name="offset">The zero-based byte offset in the buffer parameter at which to begin copying
/// bytes to the port.</param>
/// <param name="count">The number of bytes to write.</param>
[Obsolete("Use WriteAsync")]
public void Write(byte[] buffer, int offset, int count)
{
m_port.OutputStream.AsStreamForWrite().Write(buffer, offset, count);
}

/// <inheritdoc />
/// <inheritdoc />
public override bool CanWrite => true;

/// <inheritdoc />
/// <inheritdoc />
public override Task WriteAsync(byte[] buffer, int offset, int length)
{
if (m_port == null)
throw new InvalidOperationException("Device not open");

return m_port.OutputStream.WriteAsync(buffer.AsBuffer(offset, length)).AsTask();
}
}
}
}
}
#endif

0 comments on commit 8e89aba

Please sign in to comment.