Skip to content

Commit

Permalink
add an argument for disconnect event which carrier reason
Browse files Browse the repository at this point in the history
  • Loading branch information
halyssonJr committed Feb 18, 2024
1 parent 0e2d1ad commit c70e673
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ namespace Meadow.Hardware;
/// Delegate containing information about a network disconnection event
/// </summary>
/// <param name="sender"></param>
public delegate void NetworkDisconnectionHandler(INetworkAdapter sender);
/// <param name="args"></param>
public delegate void NetworkDisconnectionHandler(INetworkAdapter sender, NetworkDisconnectionEventArgs args);

/// <summary>
/// Delegate containing information about a network error event.
Expand Down
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 reson)
{
When = DateTime.UtcNow;
Reason = reson;
}
}

0 comments on commit c70e673

Please sign in to comment.