Show / Hide Table of Contents

Interface INetworkEnvironment

Represents the environment that a device can interact with networks.

Inherited Members
IDeviceEnvironment.Name
IDeviceContainer.Device
IHasConnectionStatus.ConnectionStatus
Namespace: Microsoft.XboxStudios.DeviceConsole.Environments.Network
Assembly: DeviceConsole.Environments.dll
Syntax
public interface INetworkEnvironment : IDeviceEnvironment, IDeviceContainer, IHasConnectionStatus

Methods

View Source

ConnectToWiFiAsync(Guid, string, string, bool, TimeSpan?)

Connects an interface from a WiFi network.

Declaration
Task ConnectToWiFiAsync(Guid wifiInterface, string ssid, string key, bool saveProfile, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid wifiInterface

The interface to connect to the network.

string ssid

The SSID to connect to.

string key

The shared key.

bool saveProfile

True to create a profile for the network on the device, false otherwise. This will cause the device to auto-connect to the network in the future.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

ConnectToWiFiAsync(Guid, string, string, bool, CancellationToken)

Connects an interface from a WiFi network.

Declaration
Task ConnectToWiFiAsync(Guid wifiInterface, string ssid, string key, bool saveProfile, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid wifiInterface

The interface to connect to the network.

string ssid

The SSID to connect to.

string key

The shared key.

bool saveProfile

True to create a profile for the network on the device, false otherwise. This will cause the device to auto-connect to the network in the future.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

DeleteWifiProfileAsync(Guid, string, TimeSpan?)

Deletes a profile associated with a network on a specific interface.

Declaration
Task DeleteWifiProfileAsync(Guid wifiInterface, string profileName, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid wifiInterface

The WiFi interface associated with the profile to delete.

string profileName

The name of the profile to delete.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

DeleteWifiProfileAsync(Guid, string, CancellationToken)

Deletes a profile associated with a network on a specific interface.

Declaration
Task DeleteWifiProfileAsync(Guid wifiInterface, string profileName, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid wifiInterface

The WiFi interface associated with the profile to delete.

string profileName

The name of the profile to delete.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

DisconnectToWiFiAsync(Guid, TimeSpan?)

Disconnects an interface from a WiFi network.

Declaration
Task DisconnectToWiFiAsync(Guid wifiInterface, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid wifiInterface

The interface to disconnect.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

DisconnectToWiFiAsync(Guid, CancellationToken)

Disconnects an interface from a WiFi network.

Declaration
Task DisconnectToWiFiAsync(Guid wifiInterface, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid wifiInterface

The interface to disconnect.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

EnableDHCPAsync(Guid, TimeSpan?)

Enables DHCP on a network interface.

Declaration
Task EnableDHCPAsync(Guid networkInterface, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid networkInterface

The network interface to enable DHCP.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task

A task for the asynchronous operation.

View Source

EnableDHCPAsync(Guid, CancellationToken)

Enables DHCP on a network interface.

Declaration
Task EnableDHCPAsync(Guid networkInterface, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid networkInterface

The network interface to enable DHCP.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A task for the asynchronous operation.

View Source

GetNetworkInterfacesAsync(TimeSpan?)

Gets the network interfaces for the device.

Declaration
Task<IEnumerable<NetworkInterfaceInfo>> GetNetworkInterfacesAsync(TimeSpan? timeout = null)
Parameters
Type Name Description
TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task<IEnumerable<NetworkInterfaceInfo>>

An enumerable of network interfaces.

View Source

GetNetworkInterfacesAsync(CancellationToken)

Gets the network interfaces for the device.

Declaration
Task<IEnumerable<NetworkInterfaceInfo>> GetNetworkInterfacesAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task<IEnumerable<NetworkInterfaceInfo>>

An enumerable of network interfaces.

View Source

GetWifiInterfacesAsync(TimeSpan?)

Gets the WiFi interfaces for this device.

Declaration
Task<IEnumerable<WifiInterfaceInfo>> GetWifiInterfacesAsync(TimeSpan? timeout = null)
Parameters
Type Name Description
TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task<IEnumerable<WifiInterfaceInfo>>

An enumerable of WiFi interfaces.

View Source

GetWifiInterfacesAsync(CancellationToken)

Gets the WiFi interfaces for this device.

Declaration
Task<IEnumerable<WifiInterfaceInfo>> GetWifiInterfacesAsync(CancellationToken cancellationToken)
Parameters
Type Name Description
CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task<IEnumerable<WifiInterfaceInfo>>

An enumerable of WiFi interfaces.

View Source

GetWifiNetworksAsync(Guid, TimeSpan?)

Gets the WiFi networks available for this device.

Declaration
Task<IEnumerable<WifiNetwork>> GetWifiNetworksAsync(Guid wifiInterface, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid wifiInterface

The interface to get networks for.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task<IEnumerable<WifiNetwork>>

An enumerable of WiFi network.

View Source

GetWifiNetworksAsync(Guid, CancellationToken)

Gets the WiFi networks available for this device.

Declaration
Task<IEnumerable<WifiNetwork>> GetWifiNetworksAsync(Guid wifiInterface, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid wifiInterface

The interface to get networks for.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task<IEnumerable<WifiNetwork>>

An enumerable of WiFi network.

View Source

SetStaticIpAsync(Guid, IPAddress, IPAddress, IPAddress, IPAddress, IPAddress, TimeSpan?)

Sets a static IP address.

Declaration
Task SetStaticIpAsync(Guid networkInterface, IPAddress ipAddress, IPAddress subnetMask, IPAddress defaultGateway, IPAddress primaryDNS, IPAddress secondaryDNS, TimeSpan? timeout = null)
Parameters
Type Name Description
Guid networkInterface

The network interface to set a static address.

IPAddress ipAddress

The static IP address to set.

IPAddress subnetMask

The subnet mask.

IPAddress defaultGateway

The default gateway.

IPAddress primaryDNS

The primary DNS.

IPAddress secondaryDNS

The secondary DNS.

TimeSpan? timeout

The timeout for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

View Source

SetStaticIpAsync(Guid, IPAddress, IPAddress, IPAddress, IPAddress, IPAddress, CancellationToken)

Sets a static IP address.

Declaration
Task SetStaticIpAsync(Guid networkInterface, IPAddress ipAddress, IPAddress subnetMask, IPAddress defaultGateway, IPAddress primaryDNS, IPAddress secondaryDNS, CancellationToken cancellationToken)
Parameters
Type Name Description
Guid networkInterface

The network interface to set a static address.

IPAddress ipAddress

The static IP address to set.

IPAddress subnetMask

The subnet mask.

IPAddress defaultGateway

The default gateway.

IPAddress primaryDNS

The primary DNS.

IPAddress secondaryDNS

The secondary DNS.

CancellationToken cancellationToken

The cancellation token for the operation.

Returns
Type Description
Task

A Task representing the result of the asynchronous operation.

Extension Methods

IHasConnectionStatusExtensions.IsConnected(IHasConnectionStatus)
  • View Source
In This Article
Back to top Generated by DocFX