-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #198 from WildernessLabs/v1.9.0
Release 1.9.0
- Loading branch information
Showing
24 changed files
with
508 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Meadow | ||
namespace Meadow; | ||
|
||
/// <summary> | ||
/// Delegate representing a time changed event handler. | ||
/// </summary> | ||
/// <param name="utcTime">The updated UTC time.</param> | ||
public delegate void TimeChangedEventHandler(DateTime utcTime); | ||
|
||
/// <summary> | ||
/// Interface for a Network Time Protocol (NTP) client object. | ||
/// </summary> | ||
public interface INtpClient | ||
{ | ||
/// <summary> | ||
/// Delegate representing a time changed event handler. | ||
/// Event called when the time is changed. | ||
/// </summary> | ||
/// <param name="utcTime">The updated UTC time.</param> | ||
public delegate void TimeChangedEventHandler(DateTime utcTime); | ||
event TimeChangedEventHandler TimeChanged; | ||
|
||
/// <summary> | ||
/// Interface for a Network Time Protocol (NTP) client object. | ||
/// Gets a value indicating whether the NTP client is enabled. | ||
/// </summary> | ||
public interface INtpClient | ||
{ | ||
/// <summary> | ||
/// Event called when the time is changed. | ||
/// </summary> | ||
event TimeChangedEventHandler TimeChanged; | ||
bool Enabled { get; } | ||
|
||
/// <summary> | ||
/// Gets a value indicating whether the NTP client is enabled. | ||
/// </summary> | ||
bool Enabled { get; } | ||
/// <summary> | ||
/// Gets or sets the poll period for NTP synchronization. | ||
/// </summary> | ||
TimeSpan PollPeriod { get; set; } | ||
|
||
/// <summary> | ||
/// Gets or sets the poll period for NTP synchronization. | ||
/// </summary> | ||
TimeSpan PollPeriod { get; set; } | ||
} | ||
/// <summary> | ||
/// Start an NTP time synchronization | ||
/// </summary> | ||
/// <param name="ntpServer">An optional NTP server address. If null, the device will use the platform-configured NTP server address</param> | ||
/// <returns><b>true</b> if successful, otherwise <b>false</b></returns> | ||
Task<bool> Synchronize(string? ntpServer = null); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
Source/Meadow.Contracts/Hardware/Networking/EthernetNetworkConnectionEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Net; | ||
|
||
namespace Meadow.Hardware; | ||
|
||
/// <summary> | ||
/// Data relating to a Ethernet connection. | ||
/// </summary> | ||
public class EthernetNetworkConnectionEventArgs : NetworkConnectionEventArgs | ||
{ | ||
/// <summary> | ||
/// Construct a EthernetNetworkConnectionEventArgs request. | ||
/// </summary> | ||
/// <param name="ipAddress">IP address of the device.</param> | ||
/// <param name="subnet">Subnet of the device.</param> | ||
/// <param name="gateway">Gateway address of the device.</param> | ||
public EthernetNetworkConnectionEventArgs(IPAddress ipAddress, IPAddress subnet, IPAddress gateway) | ||
: base(ipAddress, subnet, gateway) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
Source/Meadow.Contracts/Hardware/Networking/NetworkDisconnectionEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
|
||
namespace Meadow.Hardware; | ||
|
||
/// <summary> | ||
/// Data relating to a WiFi disconnect event. | ||
/// </summary> | ||
public class NetworkDisconnectionEventArgs : EventArgs | ||
{ | ||
/// <summary> | ||
/// Date and time the event was generated. | ||
/// </summary> | ||
public DateTime When { get; private set; } | ||
|
||
/// <summary> | ||
/// Disconnect reason | ||
/// </summary> | ||
public string Reason { get; } | ||
|
||
/// <summary> | ||
/// Construct a NetworkDisconnectionEventArgs object. | ||
/// </summary> | ||
public NetworkDisconnectionEventArgs(string reason) | ||
{ | ||
When = DateTime.UtcNow; | ||
Reason = reason; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
using System; | ||
|
||
namespace Meadow.Peripherals.Displays; | ||
|
||
/// <summary> | ||
/// Enum for Display color mode, defines bit depth and RGB order | ||
/// </summary> | ||
[Flags] | ||
public enum ColorMode : int | ||
{ | ||
/// <summary> | ||
/// 1-bit color | ||
/// </summary> | ||
Format1bpp = 1 << 0, | ||
/// <summary> | ||
/// 2-bit color | ||
/// </summary> | ||
Format2bpp = 1 << 1, | ||
/// <summary> | ||
/// 4-bit grayscale | ||
/// </summary> | ||
Format4bppGray = 1 << 2, | ||
/// <summary> | ||
/// 4-bit grayscale | ||
/// </summary> | ||
Format4bppIndexed = 1 << 3, | ||
/// <summary> | ||
/// 8-bit grayscale | ||
/// </summary> | ||
Format8bppGray = 1 << 4, | ||
/// <summary> | ||
/// 8-bit color | ||
/// </summary> | ||
Format8bppRgb332 = 1 << 5, | ||
/// <summary> | ||
/// 12-bit color | ||
/// </summary> | ||
Format12bppRgb444 = 1 << 6, | ||
/// <summary> | ||
/// 15-bit color | ||
/// </summary> | ||
Format16bppRgb555 = 1 << 7, | ||
/// <summary> | ||
/// 16-bit color | ||
/// </summary> | ||
Format16bppRgb565 = 1 << 8, | ||
/// <summary> | ||
/// 18-bit color | ||
/// </summary> | ||
Format18bppRgb666 = 1 << 9, | ||
/// <summary> | ||
/// 24-bit color | ||
/// </summary> | ||
Format24bppRgb888 = 1 << 10, | ||
/// <summary> | ||
/// 24-bit color | ||
/// </summary> | ||
Format24bppGrb888 = 1 << 11, | ||
/// <summary> | ||
/// 32-bit color | ||
/// </summary> | ||
Format32bppRgba8888 = 1 << 12, | ||
} |
Oops, something went wrong.