Class NetworkAdapterBase
A base class for INetworkAdapter implementations
Assembly: Meadow.dll
View Source
public abstract class NetworkAdapterBase : INetworkAdapter
Derived:
Meadow.Devices.WiFiNetworkAdapter
Implements:
Meadow.Hardware.INetworkAdapter
Properties
IsConnected
returns the connection state of the NetworkAdapter
View Source
public abstract bool IsConnected { get; }
MacAddress
Gets the physical (MAC) address of the network adapter
View Source
public virtual PhysicalAddress MacAddress { get; }
InterfaceType
Gets the network interface type
View Source
public NetworkInterfaceType InterfaceType { get; }
Name
Gets the friendly name of the Adapter
View Source
public virtual string Name { get; }
IpAddress
IP Address of the network adapter.
View Source
public IPAddress IpAddress { get; }
DnsAddresses
DNS Addresses of the network adapter.
View Source
public IPAddressCollection DnsAddresses { get; }
SubnetMask
Subnet mask of the adapter.
View Source
public IPAddress SubnetMask { get; }
Gateway
Default gateway for the adapter.
View Source
public IPAddress Gateway { get; }
Methods
RaiseNetworkConnecting()
Raises the Meadow.NetworkAdapterBase.NetworkConnecting event
View Source
protected void RaiseNetworkConnecting()
RaiseConnectFailed()
Raises the Meadow.NetworkAdapterBase.NetworkConnectFailed event
View Source
protected void RaiseConnectFailed()
RaiseNetworkConnected<T>(T)
Raises the Meadow.NetworkAdapterBase.NetworkConnected event
View Source
protected void RaiseNetworkConnected<T>(T args) where T : NetworkConnectionEventArgs
Parameters
Type | Name |
---|---|
<T> | args |
Type Parameters
T
RaiseNetworkDisconnected(NetworkDisconnectionEventArgs)
Raises the Meadow.NetworkAdapterBase.NetworkDisconnected event
View Source
protected void RaiseNetworkDisconnected(NetworkDisconnectionEventArgs args)
Parameters
Type | Name |
---|---|
Meadow.Hardware.NetworkDisconnectionEventArgs | args |
RaiseNetworkError(NetworkErrorEventArgs)
Raises the Meadow.NetworkAdapterBase.NetworkError event
View Source
protected void RaiseNetworkError(NetworkErrorEventArgs args)
Parameters
Type | Name |
---|---|
Meadow.Hardware.NetworkErrorEventArgs | args |
Refresh()
Refreshes the NetworkAdapter's information
View Source
protected void Refresh()
Events
NetworkConnecting
Event raised when a network is connecting
View Source
public event NetworkStateHandler? NetworkConnecting
Event Type
Meadow.Hardware.NetworkStateHandler
NetworkConnected
Event raised when a network is connected
View Source
public event NetworkConnectionHandler? NetworkConnected
Event Type
Meadow.Hardware.NetworkConnectionHandler
NetworkDisconnected
Event raised when a network is disconnected
View Source
public event NetworkDisconnectionHandler? NetworkDisconnected
Event Type
Meadow.Hardware.NetworkDisconnectionHandler
NetworkConnectFailed
Event raised when a auto-reconnecting to a network has terminaled
View Source
public event NetworkStateHandler? NetworkConnectFailed
Event Type
Meadow.Hardware.NetworkStateHandler
NetworkError
Raised when a network error occurs
View Source
public event NetworkErrorHandler NetworkError
Event Type
Meadow.Hardware.NetworkErrorHandler