Skip to main content

Interface IWiFiNetworkAdapter

Provides an abstraction for a wifi-enabled INetworkAdapter

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface IWiFiNetworkAdapter : IWirelessNetworkAdapter, INetworkAdapter

Properties

Ssid

Access point the adapter is currently connected to

View Source
Declaration
string? Ssid { get; }

Bssid

BSSID (MAC) of the access point the ESP32 is currently connected to.

View Source
Declaration
PhysicalAddress Bssid { get; }

AutoConnect

Automatically attempt to connect to the <b>DefaultSsid</b> network after a power cycle or reset.

View Source
Declaration
bool AutoConnect { get; }

AutoReconnect

Automatically try to reconnect to an access point if there is a problem / disconnection

View Source
Declaration
bool AutoReconnect { get; }

DefaultSsid

Default access point to try to connect to if the network interface is started and the board is configured to automatically reconnect.

View Source
Declaration
string DefaultSsid { get; }

Channel

WiFi channel used for communication.

View Source
Declaration
int Channel { get; }

Methods

Connect(string, string, TimeSpan, CancellationToken, ReconnectionType)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, TimeSpan timeout, CancellationToken token, ReconnectionType reconnection = ReconnectionType.Automatic)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
System.TimeSpantimeoutTimeout period for the connection attempt
System.Threading.CancellationTokentokenCancellation token for the connection attempt
Meadow.Gateway.WiFi.ReconnectionTypereconnectionShould the adapter reconnect automatically?
Exceptions

System.ArgumentNullException
Thrown if the ssid is null or empty or the password is null.

Connect(string, string, ReconnectionType)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, ReconnectionType reconnection = ReconnectionType.Automatic)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
Meadow.Gateway.WiFi.ReconnectionTypereconnectionShould the adapter reconnect automatically?
Exceptions

System.ArgumentNullException
Thrown if the ssid is null or empty or the password is null.

Connect(string, string, CancellationToken, ReconnectionType)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, CancellationToken token, ReconnectionType reconnection = ReconnectionType.Automatic)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
System.Threading.CancellationTokentokenCancellation token for the connection attempt
Meadow.Gateway.WiFi.ReconnectionTypereconnectionShould the adapter reconnect automatically?
Exceptions

System.ArgumentNullException
Thrown if the ssid is null or empty or the password is null.

Connect(string, string, TimeSpan, ReconnectionType)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, TimeSpan timeout, ReconnectionType reconnection = ReconnectionType.Automatic)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
System.TimeSpantimeoutTimeout period for the connection attempt
Meadow.Gateway.WiFi.ReconnectionTypereconnectionShould the adapter reconnect automatically?
Exceptions

System.ArgumentNullException
Thrown if the ssid is null or empty or the password is null.

Connect(string, string, TimeSpan, CancellationToken)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, TimeSpan timeout, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
System.TimeSpantimeoutTimeout period for the connection attempt
System.Threading.CancellationTokentokenCancellation token for the connection attempt

Connect(string, string, TimeSpan)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password, TimeSpan timeout)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.
System.TimeSpantimeoutTimeout period for the connection attempt

Connect(string, string)

Start a WiFi network.

View Source
Declaration
Task Connect(string ssid, string password)
Returns

System.Threading.Tasks.Task: true if the connection was successfully made.

Parameters
TypeNameDescription
System.StringssidName of the network to connect to.
System.StringpasswordPassword for the network.

Disconnect(bool)

Disconnect from the currently active access point.

View Source
Declaration
Task Disconnect(bool turnOffWiFiInterface)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.BooleanturnOffWiFiInterfaceShould the WiFi interface be turned off?

ConnectToDefaultAccessPoint()

Connect to the default access point.

View Source
Declaration
Task ConnectToDefaultAccessPoint()
Returns

System.Threading.Tasks.Task

ConnectToDefaultAccessPoint(TimeSpan, CancellationToken)

Connect to the default access point.

View Source
Declaration
Task ConnectToDefaultAccessPoint(TimeSpan timeout, CancellationToken token)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.TimeSpantimeout
System.Threading.CancellationTokentoken

ClearStoredAccessPointInformation()

Removed any stored access point information from the coprocessor memory.

View Source
Declaration
Task ClearStoredAccessPointInformation()
Returns

System.Threading.Tasks.Task

Scan()

Get the list of access points.

View Source
Declaration
Task<IList<WifiNetwork>> Scan()
Returns

System.Threading.Tasks.Task<System.Collections.Generic.IList<Meadow.Gateway.WiFi.WifiNetwork>>: An IList (possibly empty) of access points.### Scan(CancellationToken) Get the list of access points.

View Source
Declaration
Task<IList<WifiNetwork>> Scan(CancellationToken token)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.IList<Meadow.Gateway.WiFi.WifiNetwork>>: An IList (possibly empty) of access points.

Parameters
TypeNameDescription
System.Threading.CancellationTokentokenA System.Threading.CancellationToken to be used if the Scan should be canceled.

Scan(TimeSpan)

Get the list of access points.

View Source
Declaration
Task<IList<WifiNetwork>> Scan(TimeSpan timeout)
Returns

System.Threading.Tasks.Task<System.Collections.Generic.IList<Meadow.Gateway.WiFi.WifiNetwork>>: An IList (possibly empty) of access points.

Parameters
TypeNameDescription
System.TimeSpantimeoutA System.TimeSpan representing the time to search before giving up.