diff --git a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics.csproj b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics.csproj index c0bee6c..064fac9 100644 --- a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics.csproj +++ b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics.csproj @@ -27,6 +27,7 @@ DEBUG;TRACE prompt 4 + bin\Debug\Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics.xml pdbonly diff --git a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Notecard.cs b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Notecard.cs index 394e5fa..f4baf74 100644 --- a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Notecard.cs +++ b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics/Notecard.cs @@ -6,12 +6,20 @@ namespace Bytewizer.TinyCLR.Drivers.Blues.Notecard.Diagnostics { + /// + /// Configures the to use the serial interface for communication with the host. + /// public sealed class NotecardLogger : IDisposable { private readonly GpioPin enablePin; private readonly UartController uartController; private readonly GpioController gpioController; + /// + /// Initializes a default instance of the class. + /// + /// The uart controller to use. + /// The gpio pin to use enable the serial interface. public NotecardLogger(UartController uartController, int enablePin) : this(uartController, new UartSetting() { @@ -21,9 +29,14 @@ public NotecardLogger(UartController uartController, int enablePin) StopBits = UartStopBitCount.One, Handshaking = UartHandshake.None }, enablePin) - { - } - + { } + + /// + /// Initializes a new instance of the class. + /// + /// The uart controller to use. + /// The uart controller settings to use. + /// The gpio pin to use enable the serial interface. public NotecardLogger(UartController uartController, UartSetting uartSettings, int enablePin) { this.uartController = uartController; @@ -38,10 +51,19 @@ public NotecardLogger(UartController uartController, UartSetting uartSettings, i this.enablePin.Write(GpioPinValue.High); } + /// + /// Enable the notecard debug interface. + /// public void Enable() => this.enablePin.Write(GpioPinValue.High); + /// + /// Disable the notecard debug interface. + /// public void Disable() => this.enablePin.Write(GpioPinValue.Low); + /// + /// Enable debug message logging. + /// public void TraceOn() { Enable(); @@ -50,6 +72,9 @@ public void TraceOn() this.uartController.Write(writeBuffer); } + /// + /// Disable degug message logging. + /// public void TraceOff() { var writeBuffer = Encoding.UTF8.GetBytes("{\"req\":\"card.trace\",\"mode\":\"off\"}\n"); @@ -58,6 +83,9 @@ public void TraceOff() Disable(); } + /// + /// Pro-actively frees resources owned by this instance. + /// public void Dispose() { this.enablePin.Dispose(); @@ -65,7 +93,16 @@ public void Dispose() this.gpioController.Dispose(); } + + /// + /// An event that is raised when a message is available. + /// public event MessageAvailableEventHandler MessageAvailable; + + + /// + /// An event that is raised when a message is available. + /// public delegate void MessageAvailableEventHandler(string message); private string TempData { set; get; } = string.Empty; diff --git a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard/Bytewizer.TinyCLR.Drivers.Blues.Notecard.csproj b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard/Bytewizer.TinyCLR.Drivers.Blues.Notecard.csproj index 67d636f..d1fa90e 100644 --- a/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard/Bytewizer.TinyCLR.Drivers.Blues.Notecard.csproj +++ b/src/Bytewizer.TinyCLR.Drivers.Blues.Notecard/Bytewizer.TinyCLR.Drivers.Blues.Notecard.csproj @@ -27,6 +27,7 @@ DEBUG;TRACE prompt 4 + bin\Debug\Bytewizer.TinyCLR.Drivers.Blues.Notecard.xml pdbonly