Class ConnectionManager
Definition
- Namespace:
- Tizen.Network.Connection
- Assembly:
- Tizen.Network.Connection.dll
This is the ConnectionManager class. It provides functions to manage data connections.
public static class ConnectionManager
- Inheritance
-
objectConnectionManager
Properties
View SourceBluetoothState
The state of the Bluetooth connection.
Declaration
public static ConnectionState BluetoothState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | Bluetooth connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
CellularState
The state of the cellular connection.
Declaration
public static CellularState CellularState { get; }
Property Value
Type | Description |
---|---|
CellularState | Cellular network state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
CurrentConnection
The type and state of the current profile for data connection.
Declaration
public static ConnectionItem CurrentConnection { get; }
Property Value
Type | Description |
---|---|
ConnectionItem | Instance of ConnectionItem. |
EthernetCableState
Checks if the ethernet cable is attached or not.
Declaration
public static EthernetCableState EthernetCableState { get; }
Property Value
Type | Description |
---|---|
EthernetCableState | Ethernet cable state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
EthernetState
The Ethernet connection state.
Declaration
public static ConnectionState EthernetState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | Ethernet connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
WiFiState
The state of the Wi-Fi connection.
Declaration
public static ConnectionState WiFiState { get; }
Property Value
Type | Description |
---|---|
ConnectionState | WiFi connection state. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
Methods
View SourceAddRoute(AddressFamily, string, IPAddress, IPAddress)
Adds a route to the routing table.
Declaration
public static void AddRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
string | interfaceName | The name of the network interface. |
System.Net.IPAddress | hostAddress | The IP address of the host. |
System.Net.IPAddress | gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when an interfaceName or a hostAddress or a gateway is null. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
CreateCellularProfile(ConnectionProfileType, string)
Creates a cellular profile handle.
Declaration
public static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword)
Parameters
Type | Name | Description |
---|---|---|
ConnectionProfileType | type | The type of profile. Cellular profile type is supported. |
string | keyword | The keyword included in profile name. |
Returns
Type | Description |
---|---|
CellularProfile | CellularProfile object. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when a keyword value is null. |
System.InvalidOperationException | Thrown when a method fails due to invalid operation. |
GetAllIPv6Addresses(ConnectionType)
Gets all the IPv6 addresses of the current connection.
Declaration
public static IEnumerable<IPAddress> GetAllIPv6Addresses(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | type | The type of current network connection. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T><System.Net.IPAddress> | A list of IPv6 addresses of the connection. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetIPAddress(AddressFamily)
Gets the IP address of the current connection.
Declaration
public static IPAddress GetIPAddress(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
Returns
Type | Description |
---|---|
System.Net.IPAddress | IP address of the connection (global address in case of IPv6). |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetMacAddress(ConnectionType)
Gets the MAC address of the Wi-Fi or ethernet.
Declaration
public static string GetMacAddress(ConnectionType type)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | type | The type of current network connection. |
Returns
Type | Description |
---|---|
string | MAC address of the Wi-Fi or ethernet. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetProxy(AddressFamily)
Gets the proxy address of the current connection.
Declaration
public static string GetProxy(AddressFamily family)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
Returns
Type | Description |
---|---|
string | Proxy address of the connection. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
GetStatistics(ConnectionType, StatisticsType)
Gets the statistics information.
Declaration
public static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | connectionType | The type of connection (only WiFi and Cellular are supported). |
StatisticsType | statisticsType | The type of statistics. |
Returns
Type | Description |
---|---|
long | The statistics information associated with statisticsType. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to invalid operation. |
RemoveRoute(AddressFamily, string, IPAddress, IPAddress)
Removes a route from the routing table.
Declaration
public static void RemoveRoute(AddressFamily family, string interfaceName, IPAddress hostAddress, IPAddress gateway)
Parameters
Type | Name | Description |
---|---|---|
AddressFamily | family | The address family. |
string | interfaceName | The name of network interface. |
System.Net.IPAddress | hostAddress | The IP address of the host. |
System.Net.IPAddress | gateway | The gateway address. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.ArgumentNullException | Thrown when an interfaceName or a hostAddress or a gateway is null. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
ResetStatistics(ConnectionType, StatisticsType)
Resets the statistics information.
Declaration
public static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType)
Parameters
Type | Name | Description |
---|---|---|
ConnectionType | connectionType | The type of connection (only WiFi and Cellular are supported). |
StatisticsType | statisticsType | The type of statistics. |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
System.ArgumentException | Thrown when a value is an invalid parameter. |
System.OutOfMemoryException | Thrown when memory is not enough to continue execution. |
System.InvalidOperationException | Thrown when a connection instance is invalid or when a method fails due to an invalid operation. |
Events
View SourceConnectionTypeChanged
An event is called when the type of the current connection is changed.
Declaration
public static event EventHandler<ConnectionTypeEventArgs> ConnectionTypeChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><ConnectionTypeEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
EthernetCableStateChanged
An event for the ethernet cable is plugged [in/out] event.
Declaration
public static event EventHandler<EthernetCableStateEventArgs> EthernetCableStateChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><EthernetCableStateEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
IPAddressChanged
An event is called when the IP address is changed.
Declaration
public static event EventHandler<AddressEventArgs> IPAddressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><AddressEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |
ProxyAddressChanged
An event is called when the proxy address is changed.
Declaration
public static event EventHandler<AddressEventArgs> ProxyAddressChanged
Event Type
Type | Description |
---|---|
System.EventHandler<TEventArgs><AddressEventArgs> |
Exceptions
Type | Condition |
---|---|
System.NotSupportedException | Thrown when a feature is not supported. |
System.UnauthorizedAccessException | Thrown when a permission is denied. |