Skip to main content

Interface IWiFiNetworkAdapter

Provides an abstraction for a wifi-enabled INetworkAdapter

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

Properties

Ssid

Access point the adapter is currently connected to

View Source
string? Ssid { get; }

Bssid

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

View Source
PhysicalAddress Bssid { get; }

AutoConnect

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

View Source
bool AutoConnect { get; }

AutoReconnect

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

View Source
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
string DefaultSsid { get; }

Channel

WiFi channel used for communication.

View Source
int Channel { get; }

Methods

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

Start a WiFi network.

View Source
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
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
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
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
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
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
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
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
void ConnectToDefaultAccessPoint()

ClearStoredAccessPointInformation()

Removed any stored access point information from the coprocessor memory.

View Source
Task ClearStoredAccessPointInformation()
Returns

System.Threading.Tasks.Task

Scan()

Get the list of access points.

View Source
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
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
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.